One list of secret names, and a tripwire for the drift - #202
Merged
Conversation
Adversarial review of #197/#198 found a bug I shipped: compose.yaml declares OAUTH_AUTH0_CLIENT_SECRET and OAUTH_GOOGLE_CLIENT_SECRET as Docker secrets, and SECRET_NAMES did not list them. That gap is silent. A secret in it is mounted into the container and never read, so the value falls back to the environment -- and a deployment that moved it out of .env and into a Docker secret, which is exactly what the secrets work invites, would lose it. The first symptom is a login that stops working, a long way from the cause. There were three hand-maintained lists: SECRET_NAMES, compose.yaml's secrets block, and a copy inside chat-fastapi.py that had drifted from SECRET_NAMES in both directions -- missing four names and carrying one the shared list lacked. chat-fastapi.py now uses SECRET_NAMES. Two tests make the drift loud: every secret compose declares must be one the app loads, and no second literal list may exist. Removing the OAuth names again fails the first, which is the check that matters. env_template documented none of the OAuth settings, which is why they were easy to miss. All seven are there now, commented out, with a note that the secrets can be mounted instead. LITERAL_API_KEY stays the one documented exception -- loadable, unused by any deployment here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Adversarial review of #197/#198 found a bug I shipped.
compose.yamldeclaresOAUTH_AUTH0_CLIENT_SECRETandOAUTH_GOOGLE_CLIENT_SECRETas Docker secrets.SECRET_NAMESdid not list them.That gap is silent. A secret in it is mounted into the container and never read, so the value falls back to the environment — and a deployment that moved it out of
.envand into a Docker secret, which is exactly what #197 invites, would lose it. The first symptom is a login that stops working, a long way from the cause.Three hand-maintained lists
SECRET_NAMEScompose.yamlsecrets:bin/chat-fastapi.pychat-fastapi.pynow usesSECRET_NAMES. There is one list.Two tripwires
compose.yamldeclares must be one the app loadschat-fastapi.pyPerturbation-checked: removing the OAuth names again fails the first test.
And why it was easy to miss
env_templatedocumented none of the OAuth settings — not the IDs, not the secrets, notCHAINLIT_AUTH_SECRET, which every provider needs. An operator cannot supply a setting nobody told them about. All seven are there now, commented out, with a note that the*_SECRETvalues can be mounted as Docker secrets instead.LITERAL_API_KEYstays the one documented exception: loadable, but no deployment here uses it.🤖 Generated with Claude Code