Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfluxDB 2.X (Auth) Support #1170

Closed
mweber89 opened this issue Jul 14, 2023 · 3 comments
Closed

InfluxDB 2.X (Auth) Support #1170

mweber89 opened this issue Jul 14, 2023 · 3 comments

Comments

@mweber89
Copy link

In InfluxDB 2.x, passing the token or username/password directly within the URL is not supported. The recommended method is to include the authentication information in the request headers. This helps ensure secure transmission of sensitive information.
I can't find in the docs, how to configure request headers, hence the request to have a closer look into the InfluxDB 2.x requirements.

@evernat
Copy link
Member

evernat commented Jul 16, 2023

According to influxdb doc, Basic Authentication is still supported in InfluxDB 2.x by using the InfluxDB 1.x compatibility API:
https://docs.influxdata.com/influxdb/v2.7/reference/api/influxdb-1x/

Note that when you have username and password or token in the influxdb url as explained in the javamelody doc, javamelody will in fact send a http request header like Authorization: Basic INFLUX_USERNAME:INFLUX_PASSWORD_OR_TOKEN as explained in influxdb doc:
https://docs.influxdata.com/influxdb/v2.7/reference/api/influxdb-1x/#basic-authentication
So yes, a http request header is already used by javamelody and not query string parameters.

@evernat
Copy link
Member

evernat commented Jul 16, 2023

The header is set here, if you search it:
https://github.com/javamelody/javamelody/blob/master/javamelody-core/src/main/java/net/bull/javamelody/internal/model/LabradorRetriever.java#L307

@evernat
Copy link
Member

evernat commented Jul 17, 2023

And I have added support to set an influxdb-api-token parameter like the influxdb-url parameter: cd34d03 and ea73a31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants