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

Adding support for file based configuration of basic auth username in http client config #511

Merged
merged 7 commits into from Sep 4, 2023

Conversation

wasim-nihal
Copy link
Contributor

Including changes to have username_file option for basic auth configuration.

Changes for the ticket: prometheus/prometheus#12576

@roidelapluie , request you to review the changes.

…ent config.

Signed-off-by: Wasim Nihal <sswasim64@gmail.com>
@wasim-nihal
Copy link
Contributor Author

Please find the configuration documentation changes at prometheus/prometheus#12749

config/http_config.go Outdated Show resolved Hide resolved
config/http_config.go Outdated Show resolved Hide resolved
}

func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
if len(req.Header.Get("Authorization")) != 0 {
return rt.rt.RoundTrip(req)
}
username, err := getBasicAuthUsername(*rt)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think extra funtions are needed of they do not share code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed the comment. Moved this logic back to the basic auth RoundTrip method.

wasim-nihal and others added 6 commits September 2, 2023 13:43
…ent config.

Signed-off-by: Wasim Nihal <sswasim64@gmail.com>
Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Nihal <38865967+wasim-nihal@users.noreply.github.com>
Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Nihal <38865967+wasim-nihal@users.noreply.github.com>
…common into username-file-12576

Signed-off-by: Wasim Nihal <sswasim64@gmail.com>
…common into username-file-12576

Signed-off-by: Wasim Nihal <sswasim64@gmail.com>
@wasim-nihal
Copy link
Contributor Author

@roidelapluie, I have addressed the above review comments. Request you to review the changes

@roidelapluie roidelapluie merged commit 4047c78 into prometheus:main Sep 4, 2023
7 checks passed
@roidelapluie
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants