feat: make API key authentication optional#2
Merged
Conversation
Add an `auth.enabled` config flag (default true) so the built-in API key check can be disabled for setups that delegate authentication to a reverse proxy (HTTP basic auth, OIDC/forward-auth, etc.). When disabled, both the regular and admin auth layers pass through, so all endpoints are open and the reverse proxy becomes the trust boundary. The server logs a prominent startup warning, louder when not bound to a loopback address. The flag is read live, so it can be toggled from the dashboard (Settings -> Require API Key) without a restart. Closes #1
Replace the green status dot in the sidebar header with the project logo (rounded chip) and swap the dashboard favicon for the same artwork, downscaled to 256x256.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1
Adds an
auth.enabledconfig flag (defaulttrue) so the built-in API key check can be disabled, for setups that delegate authentication to a reverse proxy (HTTP basic auth, OIDC/forward-auth, etc.) — as requested in #1.Behavior
auth.enabled: falsedisables all authentication, including the admin endpoints — the reverse proxy becomes the only trust boundary.bindAddressis not loopback.Also in this PR
Testing
./gradlew buildgreen.runServer: 401 without key / 200 with key when enabled; live toggle → 200 without key (incl./api/admin/keys) when disabled; re-enabling restores 401; the flag persists toconfig/mcrestapi.json.