Repository navigation
feat(dashboard-api): accept federated portal identity, scope by account - #445
Merged
Merged
Conversation
The spore.host portal signs in via Globus→STS AssumeRoleWithWebIdentity, so its X-AWS-Credentials caller resolves to an assumed-role ARN (arn:aws:sts::<acct>:assumed-role/spore-portal-launch/<session>), not an IAM :user/ ARN. The old auth path treated any non-:user/ caller as a "web" Cognito identity requiring an email claim + a CLI-linked IAM ARN (spawn auth link) — neither of which the browser-native, no-paste portal sends. Result: every portal API call 401'd. Recognize a caller assuming a trusted portal launch role and scope its data by its OWN verified AWS account (the tenant key the portal decided on), skipping the Cognito/email/CLI-link requirement. The account always comes from the SigV4-verified caller, so trusting a role NAME here can never widen access beyond the account that already holds those creds. - portalAccountFromARN: parse assumed-role ARN, match role name against the allow list, return the verified account. - allow list defaults to [spore-portal-launch], overridable per-deploy via SPAWN_DASHBOARD_PORTAL_ROLES (e.g. spore-ucla-launch for self-deploys). - federated portal identities are not cached (per-session role ARN would churn a spawn-user-accounts row per login). - CLI (:user/) and existing Cognito paths are untouched. Unblocks portal Slice 5 (shared/multi-tenant features via X-AWS-Credentials).
scttfrdmn
added a commit
that referenced
this pull request
Jul 28, 2026
Backfills Unreleased entries for #443 (spawn onboard), #444, #445 and #446, which merged without changelog entries, and commits the generated reference for spawn onboard — check-docs only diffs tracked files, so docs-gen/onboard.md was never added when the command landed. Sections reordered to Keep-a-Changelog order (Added first), matching prior releases.
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.
Why
The spore.host portal signs in via Globus→STS
AssumeRoleWithWebIdentity, so itsX-AWS-Credentialscaller resolves (viaGetCallerIdentity) to an assumed-role ARN —arn:aws:sts::<acct>:assumed-role/spore-portal-launch/<session>— not an IAM:user/ARN.The existing auth path (
getUserFromCredentialsHeader) treats any non-:user/caller as a "web" Cognito identity that must present an email claim + a CLI-linked IAM ARN (spawn auth link). The browser-native, no-paste portal sends neither, so every portal API call 401s today (confirmed live:GET api.spore.host/api/strata/catalog→ 401).This blocks portal Slice 5 (shared/multi-tenant features via
X-AWS-Credentials: strata catalog, cost-history, teams, Slack).What
Recognize a caller assuming a trusted portal launch role and scope its data by its own verified AWS account — the tenant key the portal decided on — skipping the Cognito/email/CLI-link requirement.
portalAccountFromARN: parse the assumed-role ARN, match the role name against an allow list, return the verified account.[spore-portal-launch], overridable per-deploy viaSPAWN_DASHBOARD_PORTAL_ROLES(e.g.spore-ucla-launchfor institution self-deploys).spawn-user-accountsrow per login).:user/) and existing Cognito paths are untouched.Security
The account is always the SigV4-verified caller's own (from
GetCallerIdentity). Trusting a role name here can never widen access beyond the account that already holds those credentials — same invariant as the phone-home registrar.Tests
auth_test.go: role recognition (trusted role → account; IAM user / unknown role / malformed / no-session → rejected), env-override allow list, default-when-unset.go build ./...+go test ./...green.