Repository navigation
feat(auth): support env vars for OAuth provider credentials - #3048
Merged
Merged
Conversation
Auth config secrets (Google/GitHub client ID/secret, Resend API key) can now be injected via environment variables instead of requiring the build-auth-config init container. A Zod schema parses the auth-config file with file-first, env-fallback semantics. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
Contributor
Release OptionsSuggested: Minor ( React with an emoji to override the release type:
Current version:
|
Auth configuration is now driven entirely by AUTH_* environment variables parsed through a single Zod schema (auth-env.ts). This removes the need for auth-config.json, the configmap-auth Helm template, and the init container that merged secrets into the file. config.json is still supported for non-auth config (theme, logo, monitoring). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
All config-view sections now display the actual environment variable names (NODE_ENV, DATABASE_URL, AUTH_GOOGLE_CLIENT_ID, etc.) instead of camelCase property names. Padding bumped to 36 chars for longer names. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
viktormarinho
added a commit
that referenced
this pull request
Aug 3, 2026
…othing The chart has had no template consuming .Values.configMap.authConfig or secret.authConfigSecretName since configmap-auth.yaml was deleted (#3048, env-var auth) — but the README and examples/secrets-example.yaml kept documenting both, including a second Secret with camelCase keys (googleClientId, resendApiKey) the server never reads. This is an active trap: the real prod values in deco-apps-cd carry a full authConfig block (google, resend, magic-link) that renders to nothing — auth there actually works because the ExternalSecret feeds AUTH_* keys via envFrom. README now shows the real mechanism (AUTH_* in meshConfig/Secret, schema in apps/api/src/auth/auth-env.ts) and the example Secret carries AUTH_* keys.
viktormarinho
added a commit
that referenced
this pull request
Aug 3, 2026
001.md described the file-based auth-config.json design that #3048/#5120 replaced with AUTH_* env vars, plus a pre-split architecture; nothing links to it except its README entry and one step of the add-mcp-tools skill, both removed (the skill's 'Document in Spec' step told contributors to document new tools in a file that described a system that no longer exists). monitoring-share-plugin.md was referenced by nothing at all.
viktormarinho
added a commit
that referenced
this pull request
Aug 3, 2026
…5579) * chore: delete the dead auth-config.json tail and the stray EFS RFC Auth moved to AUTH_* environment variables (auth-env.ts) — core/config.ts even warns that a config-file 'auth' key is ignored. Nothing reads auth-config.json anymore, but its tail survived everywhere: - auth-config.json at the repo root: snuck in via #5575 (a sandbox-daemon PR), tracked ever since, read by nothing. Deleted. - apps/api/auth-config.example.json, tests/resilience/auth-config.test.json: referenced by nothing. Deleted. - .github/workflows/e2e.yml wrote the file before every run — for nothing. Step deleted. - .cursor/worktrees.json copied a file that does not exist. Line deleted. - apps/api/src/auth/index.ts's header claimed the exact opposite of reality ('file-based, not environment variables'). Fixed, with the .gitignore entry, the AGENTS.md config line, and config.example.json's pointer. - deploy/helm/studio/README.md documented a configmap-auth.yaml template that does not exist in templates/. Section removed, following ones renumbered. efs-spec.md (an L2 golden-cache RFC draft) also landed at the root in #5575. Deleted — it was never referenced by anything in the repo. Not touched: decostudio-alias/ stays at the root on purpose — it is the published npm alias (decostudio → decocms) with its own publish workflow, and it must stay OUT of the workspaces globs so its 'decocms': '*' dependency resolves against the registry instead of being workspace-linked. spec/001.md's auth-config mentions are a historical design document and were left alone. * docs(helm): stop documenting authConfig values the chart renders to nothing The chart has had no template consuming .Values.configMap.authConfig or secret.authConfigSecretName since configmap-auth.yaml was deleted (#3048, env-var auth) — but the README and examples/secrets-example.yaml kept documenting both, including a second Secret with camelCase keys (googleClientId, resendApiKey) the server never reads. This is an active trap: the real prod values in deco-apps-cd carry a full authConfig block (google, resend, magic-link) that renders to nothing — auth there actually works because the ExternalSecret feeds AUTH_* keys via envFrom. README now shows the real mechanism (AUTH_* in meshConfig/Secret, schema in apps/api/src/auth/auth-env.ts) and the example Secret carries AUTH_* keys. * chore(api): delete apps/api/spec — a stale v1 design document 001.md described the file-based auth-config.json design that #3048/#5120 replaced with AUTH_* env vars, plus a pre-split architecture; nothing links to it except its README entry and one step of the add-mcp-tools skill, both removed (the skill's 'Document in Spec' step told contributors to document new tools in a file that described a system that no longer exists). monitoring-share-plugin.md was referenced by nothing at all. * chore: delete .cursorindexingignore Stale editor config from 2024 (last touched in #1218); the paths it excluded no longer exist in the repo.
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 is this contribution about?
After removing the
build-auth-configinit container (#3047), OAuth sign-in broke because the Helmlookupfunction doesn't reliably inject secrets into the ConfigMap (e.g. during ArgoCD rendering). This PR adds env var support for auth provider credentials so they can be injected directly via Kubernetes Secrets as environment variables, removing the need for the init container entirely.Auth config is now parsed through a Zod schema with file-first, env-fallback semantics: values from
auth-config.jsontake precedence, missing/empty values fall back to env vars (AUTH_GOOGLE_CLIENT_ID,AUTH_GOOGLE_CLIENT_SECRET,AUTH_GITHUB_CLIENT_ID,AUTH_GITHUB_CLIENT_SECRET,AUTH_RESEND_API_KEY).How to Test
AUTH_GOOGLE_CLIENT_IDandAUTH_GOOGLE_CLIENT_SECRETset as env vars (via k8s Secret) and no Google credentials inauth-config.jsonCLIENT_ID_AND_SECRET_REQUIREDerrorMigration Notes
New optional env vars for auth secrets — no action needed if credentials are already in
auth-config.json. For Helm users, credentials can now be set undersecret.AUTH_GOOGLE_CLIENT_ID, etc. invalues.yaml. Helm chart bumped to0.3.1.Review Checklist
Summary by cubic
Switch auth to
AUTH_*environment variables parsed by a singlezodschema, removingauth-config.jsonand the Helm ConfigMap mount. Restores OAuth/email flows without the init container and simplifies Docker/Helm; the CLI config view now shows env var names in original case.New Features
auth-env.tsparsesAUTH_*into runtime config (Google/GitHub OAuth, Resend/SendGrid, Microsoft SSO, magic link, email OTP, and email/password toggle); JWT now requiresMESH_JWT_SECRETorBETTER_AUTH_SECRETonly.AUTH_*inbuild-child-env.ts; CLI config view shows env var names (original case) and provider status.auth-config.jsonmounts and ConfigMap; add Secret entries forAUTH_*; chart bumped to0.3.1.Migration
auth-config.json, move values to env vars (e.g.AUTH_GOOGLE_CLIENT_ID,AUTH_GITHUB_CLIENT_SECRET,AUTH_RESEND_API_KEY,AUTH_SENDGRID_API_KEY,AUTH_SSO_MS_CLIENT_ID). Theauthkey inconfig.jsonis ignored;config.jsonremains for non-auth settings..Values.secret.AUTH_*; no ConfigMap/auth-config mount needed.Written for commit 5765587. Summary will update on new commits.