Skip to content

One list of secret names, and a tripwire for the drift - #202

Merged
adamjohnwright merged 2 commits into
mainfrom
fix/secret-names-drift
Sep 10, 2026
Merged

One list of secret names, and a tripwire for the drift#202
adamjohnwright merged 2 commits into
mainfrom
fix/secret-names-drift

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

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. 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 #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_NAMES 7 names
compose.yaml secrets: 6 names, 2 of them absent from SECRET_NAMES
bin/chat-fastapi.py its own copy — drifted in both directions, missing four and carrying one the shared list lacked

chat-fastapi.py now uses SECRET_NAMES. There is one list.

Two tripwires

  • every secret compose.yaml declares must be one the app loads
  • no second literal list may exist in chat-fastapi.py

Perturbation-checked: removing the OAuth names again fails the first test.

And why it was easy to miss

env_template documented none of the OAuth settings — not the IDs, not the secrets, not CHAINLIT_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 *_SECRET values can be mounted as Docker secrets instead.

LITERAL_API_KEY stays the one documented exception: loadable, but no deployment here uses it.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits September 10, 2026 17:54
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>
@adamjohnwright
adamjohnwright merged commit 110e232 into main Sep 10, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the fix/secret-names-drift branch September 10, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant