-
Notifications
You must be signed in to change notification settings - Fork 1
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
HTTP Basic auth support #6
Conversation
c29ee18
to
a612ad3
Compare
a612ad3
to
65d71da
Compare
b229401
to
42e0f6a
Compare
af40417
to
66ac4f6
Compare
66ac4f6
to
262a86b
Compare
an unrelated question but how is the system-api protected against DOS attacks here? |
Good questions. Keep in mind, this API is not public! It's only available to the operator, who configures access on his cloud firewall and doesn't expose it publicly. |
df27728
to
6b1e6ca
Compare
📝 Summary
Enables basic auth support for API requests.
The basic auth password is configurable through API and/or file. If set via API, the salted hash is stored in the file to persist across reboots.
Config-file updates:
basic_auth_secret_path
specifies the file to store the salted, hashed secret in. It's loaded (or created) on startup.admin
)/api/v1/set-basic-auth
is called, it uses the payload as secret (immediately) and writes the hash of the secret it to the file (for reuse across restarts).Only the salted SHA256 hash of the password is stored, both in the file as well as in memory.
The secret can be overwritten (updated) via API call, if the request provides the previous http basic auth secret.
Also added tests and updated the README.
✅ I have run these commands
make lint
make test
go mod tidy