fix: wire --encryption-key, honour false booleans, match 2.4.0 MFA default - #7
fix: wire --encryption-key, honour false booleans, match 2.4.0 MFA default#7lakhansamani wants to merge 6 commits into
Conversation
✅ Deploy Preview for authorizer-helm-chart ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
--enable-totp-login/--enable-mfa/--enable-email-otp/--enable-sms-otp don't exist in the authorizer binary; cobra rejects unknown flags so every release from this chart crash-loops on boot. Renamed to the current --disable-totp-login/--disable-webauthn-mfa/--disable-email-otp/ --disable-sms-otp/--disable-mfa flags. Fixed COUCHBASE_RAM_QUOTA: the env var was defined as COUCHBASE_BUCKET_RAM_QUOTA while args read $COUCHBASE_RAM_QUOTA, so couchbase_bucket_ram_quota silently never reached the flag. Wired --url (CWE-640 host-header-injection mitigation): AUTHORIZER_URL was set as an env var but never passed as a flag, so authorizer_url in values.yaml was a no-op. Added --oauth2-1-strict and --enable-org-discovery. Exposed ~25 toggles in values.yaml that were previously hardcoded into the args template with no values.yaml key at all (enable_signup, enforce_mfa, app_cookie_secure, enable_basic_authentication, disable_admin_header_auth, and friends) — operators had no way to override them. Re-pinned appVersion to 2.4.0-rc.7: 2.3.0 predates the flag rename above, so it doesn't have the --disable-* flags either. Move to the stable 2.4.0 tag once it ships.
Three defects found deploying this chart to a real k3d cluster.
1. --encryption-key was not wired at all. Server 2.4.0 refuses to start
when it and --jwt-secret are both empty, which is the normal state of
an RS*/ES* install — so every RSA/ECDSA deployment via this chart
would fail to boot. Added through values, secret and arg.
2. `{{ .Values.x | default true }}` is wrong for booleans: Go template
`default` substitutes on ANY empty value and `false` is empty, so an
explicit `false` was silently discarded. 12 flags could not be turned
off, among them enable_playground, enable_graphql_introspection,
enable_grpc_reflection and enable_signup — precisely the ones an
operator disables to harden production. Replaced with a helper that
only substitutes a genuinely absent value.
3. enforce_mfa defaulted to true, the pre-2.4.0 server default. The
server flipped it to false, so the chart silently forced mandatory
MFA enrollment with no way to decline (compounded by defect 2, which
made setting it false ineffective).
Verified on k3d: RS256 install boots, is_mfa_enforced reports false,
and --set enable_playground=false now renders "false".
ebd3c9b to
c670dbc
Compare
|
Rebased onto Do not merge yet — this crash-loops on the image it pins. Installed the rebased branch on kind:
The flag is real, just unreleased: it was added in Note the deployment renders args unconditionally, so the flag is passed even when Two ways forward:
The other two defects verify clean on the rebased branch — with Also worth folding in: |
--encryption-key does not exist before 2.4.0-rc.15, and the chart passed it unconditionally, so every install crash-looped with "unknown flag" on the appVersion this branch pinned (2.4.0-rc.7). Pin the first image that has the flag, and gate the arg on the value so a user pinning an older image.tag still boots. The env var was already gated the same way.
|
Rebased onto The crash-loop is fixed.
Without the gate the chart hard-requires a 2.4.0+ binary; anyone pinning an older Rendering verified:
Also updated Worth knowing about the requirement, since it is broader than the description says: any config with no I will run the kind install once |
Three flags added in server 2.4.0 had no chart surface: --microsoft-allowed-tenants, --fga-allow-unconstrained-agents, and --oauth-allow-unverified-provider-email. Both booleans default false, matching the server's secure-by-default posture. 2.4.0 also turned --enable-email-verification with no SMTP from a per-user quirk into a fatal boot error. In-cluster that surfaces as a CrashLoopBackOff whose cause is one line of container log, so the chart now refuses to render it. The condition mirrors the server's IsEmailServiceEnabled exactly — host set, port > 0, sender email set — so it cannot reject a config the server would accept.
|
Pushed Three new 2.4.0 flags had no chart surface
Both booleans default Render-time guard for a combination that now crash-loops2.4.0 turned In-cluster that presents as a The condition mirrors the server's Verified
The third case is the one that matters — a guard that blocks valid configs is worse than no guard. Also confirmed end-to-end wiring rather than just eyeballing the template: each flag reaches the container |
|
rc.15 was tagged and released but its build was cancelled, so no image was ever pushed. It was also cut from a commit predating the audit, so it could not have carried the new flags or the boot-time SMTP check this chart's guard assumes. rc.16 is the first RC with both; verified against the published image.
✅ Blocker cleared — re-pinned to
|
rc.17 adds the verify-email decision core and the empty-subject token rejection, which rc.16 was built one commit too early to include.
Re-pinned to
|
| Suite | Result |
|---|---|
make test-all-db |
exit 0 — 42 packages, 0 failures, all seven backends (internal/storage 215s + arangodb, cassandradb, couchbase, dynamodb, mongodb, sql, schemas) |
make e2e-playground |
exit 0 — 86 passed (37.7s) |
Run sequentially rather than in parallel: no port overlap, but Scylla plus six authorizer instances and browsers contend for CPU, and a false red there costs more than it saves. Both stacks tore down cleanly — zero leaked containers either time.
rc.17 provenance verified two independent ways
Tag SHAs:
rc.17 -> 0ada7ef4 (the #755 merge commit, == main)
rc.16 -> 3f17f68a (one commit earlier)
And in the published images themselves:
ConsumeEmailVerificationToken: rc.17 → 3 matches
rc.16 → 0 matches
Plus all four new flags present in the rc.17 image (--encryption-key, --fga-allow-unconstrained-agents, --microsoft-allowed-tenants, --oauth-allow-unverified-provider-email).
helm lint clean; the chart renders image: quay.io/authorizer/authorizer:2.4.0-rc.17.
Ready to merge from my side.
Three defects found by deploying this chart to a real k3d cluster (not by reading it).
1.
--encryption-keywas not wired — RSA/ECDSA installs cannot bootServer 2.4.0 refuses to start when both
--encryption-keyand--jwt-secretare empty, which is the normal state of anRS*/ES*install. The chart had no way to set it, so every RSA/ECDSA deployment would crash-loop. Added throughvalues.yaml, aSecret, and the container arg.2. Twelve booleans could not be set to
false{{ .Values.x | default true }}is wrong for booleans — Go templatedefaultsubstitutes on any empty value, andfalseis empty. So an explicitfalsewas silently discarded and the flag stayedtrue.Affected, among others:
enable_playgroundenable_graphql_introspectionenable_grpc_reflectionenable_signupapp_cookie_secure/admin_cookie_secureThese are exactly the flags an operator turns off to harden a production deployment. Replaced with an
authorizer.boolhelper that substitutes only a genuinely absent (nil) value.3.
enforce_mfastill carried the pre-2.4.0 defaultThe server flipped
--enforce-mfafromtruetofalsein 2.4.0. The chart still defaulted it totrue, so Helm deployments silently forced mandatory MFA enrollment — and because of defect 2, setting itfalsedid nothing.Verification on k3d
--encryption-keyboots and serves/.well-known/openid-configuration→HTTP 200meta.is_mfa_enforced→false--set authorizer.enable_playground=falsenow rendersvalue: "false"helm lintcleanAlso worth knowing
sqlite is unusable with this chart:
readOnlyRootFilesystem: trueand there is no volume option (still open inTODO.md), so the DB file cannot be written. I used Postgres. Worth either documenting or adding a volume.