feat(oidc): runtime MOKOSH_OIDC_SCOPES override for SPA scope query (BUNYIP-142) #337
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!337
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-142-runtime-oidc-scopes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plumbs the requested OIDC scope string through the same runtime-config
seam the SPA already uses for issuer / client_id / hub_base_url, so a
deployment can opt in to bunyip's
profileclaim emission (and theJIT path BUNYIP-141 ships) without rebuilding the wasm bundle.
Changes:
oidc_scopestowindow.__MOKOSH_CONFIG__whenMOKOSH_OIDC_SCOPESis set; sameshape as the other emit_field calls (escaped, only emitted when
non-empty so dev / unconfigured deployments stay on the compile-time
default).
OidcConfig::resolvepullsoidc_scopesfrom runtime_config and Box::leaks it over thecompile-time default. Absent the override the
option_env!("MOKOSH_OIDC_SCOPES") fallback chain is unchanged.
After this lands operators set
MOKOSH_OIDC_SCOPES: openid email offline_access profileon themokosh-www service in their compose-variables.yml (c-01 + nc-01 PR in
the docker repo) and the next /oauth2/authorize round-trip requests
profile, which BUNYIP-140's consent screen surfaces, BUNYIP-141'sJIT path consumes, and BUNYIP-139's user fields populate.
#BUNYIP-142
Plumbs the requested OIDC scope string through the same runtime-config seam the SPA already uses for issuer / client_id / hub_base_url, so a deployment can opt in to bunyip's `profile` claim emission (and the JIT path BUNYIP-141 ships) without rebuilding the wasm bundle. Changes: - oci-build/entrypoint.sh: emit `oidc_scopes` to `window.__MOKOSH_CONFIG__` when `MOKOSH_OIDC_SCOPES` is set; same shape as the other emit_field calls (escaped, only emitted when non-empty so dev / unconfigured deployments stay on the compile-time default). - src/modules/oidc/config.rs: `OidcConfig::resolve` pulls `oidc_scopes` from runtime_config and Box::leaks it over the compile-time default. Absent the override the option_env!("MOKOSH_OIDC_SCOPES") fallback chain is unchanged. After this lands operators set `MOKOSH_OIDC_SCOPES: openid email offline_access profile` on the mokosh-www service in their compose-variables.yml (c-01 + nc-01 PR in the docker repo) and the next /oauth2/authorize round-trip requests `profile`, which BUNYIP-140's consent screen surfaces, BUNYIP-141's JIT path consumes, and BUNYIP-139's user fields populate. #BUNYIP-142