-
Notifications
You must be signed in to change notification settings - Fork 82
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
Allow auth to be skipped for some paths #70
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: darshanime <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
This should be documented, and we should use the configuration we read on every request.
I think a better name for it would be basic_auth_excluded_paths
} | ||
|
||
func (u *webHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | ||
// Check if path has auth excluded. | ||
if _, ok := u.authExcludedPaths[r.URL.Path]; ok { | ||
u.logger.Log("msg", "Bypassing auth, path in auth_excluded_paths", "path", r.URL.Path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave logging out if this pull request until we figure out #63.
if _, ok := u.authExcludedPaths[r.URL.Path]; ok { | ||
u.logger.Log("msg", "Bypassing auth, path in auth_excluded_paths", "path", r.URL.Path) | ||
u.handler.ServeHTTP(w, r) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be below HTTP headers, and after we check that there are users set.
closes prometheus/prometheus#9166
Signed-off-by: darshanime [email protected]