fix(settings): bridge REQUIRE_API_KEY env var to requireApiKey setting - #3080
Closed
thatssoheil wants to merge 1 commit into
Closed
fix(settings): bridge REQUIRE_API_KEY env var to requireApiKey setting#3080thatssoheil wants to merge 1 commit into
thatssoheil wants to merge 1 commit into
Conversation
The README documents REQUIRE_API_KEY=true as the way to enforce a Bearer API key on /v1/* for internet-exposed deploys, but nothing in the runtime ever read it - the 9 enforcement sites only checked the dashboard DB setting, which defaults to true (locking local-only installs out until toggled). Resolve the env var as the default at merge time so a fresh deploy honors REQUIRE_API_KEY, while a stored dashboard setting still wins over the env default. Closes decolua#2834
Author
|
Closing as superseded: maintainer claytontavaresdan already bridged REQUIRE_API_KEY to requireApiKey in #3120 (settingsRepo defaults). His reads the env at module load and only accepts exactly "true"; mine accepted true/1/yes/on at merge time, so cherry-pick envTruthy() if wanted. |
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.
What
Bridges the REQUIRE_API_KEY env var to the requireApiKey dashboard setting: env initializes the default (true/1/yes/on honored), a stored dashboard value still wins. Read lazily so env set after import is honored.
Note on the default change
The code default was requireApiKey: true but the README (line ~1303) documents the default as false. This aligns code with docs: fresh installs default to open (README behavior), REQUIRE_API_KEY=true restores enforcement, and a stored dashboard value always wins (existing installs with the toggle on keep auth).
Closes #2834