mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 06:55:53 +03:00
[PR #457] [MERGED] Add http header auth #964
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#964
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/healthchecks/healthchecks/pull/457
Author: @Phyxius
Created: 12/3/2020
Status: ✅ Merged
Merged: 12/9/2020
Merged by: @cuu508
Base:
master← Head:add-http-header-auth📝 Commits (7)
ae4e6c5Add HTTP header authentiation backend/middlewareabfd434Add docs for remote header authcec1e98Improve docs on external auth1fd87aaAdd warning for unknown REMOTE_USER_HEADER_TYPE10f6708Move active check for header auth to middleware3659c81Add test cases for remote header login1d58dc4Improve header-based authentication📊 Changes
5 files changed (+164 additions, -0 deletions)
View changed files
📝
README.md(+22 -0)📝
hc/accounts/backends.py(+30 -0)📝
hc/accounts/middleware.py(+50 -0)➕
hc/accounts/tests/test_remote_user_header_login.py(+56 -0)📝
hc/settings.py(+6 -0)📄 Description
I wanted to self-host healthchecks and integrate it with my central authentication system (see #185), so rather than develop something specific to my needs, I added support for HTTP header-based authentication. This way, people can integrate whatever auth system they want (LDAP, mTLS, SAML, OAuth, whatever) at the reverse proxy level and remove the need for healthchecks to care about the implementation details.
I added two new settings (with corresponding environment variables):
REMOTE_USER_HEADER— set this to the header you wish to authenticate with. HTTP headers will be prefixed withHTTP_and have any dashes converted to underscores. Headers without that prefix can be set by the WSGI server itself only, which is more secure.REMOTE_USER_HEADER_TYPE— If set toEMAIL, the specified header will be treated as the user's email. If set toID, the specified header will be set to the user's UUID. Any other value (including empty, the default) disables header-based authentication.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.