WIP: Collar SSO #9
No reviewers
Labels
No labels
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/collar!9
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/oidc-auth"
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?
@anish Could you please review this plan and make sure it makes sense?
@kritdass wrote in #9 (comment):
mostly looks good, as for forgejo authentication i had a conversation with claude on the ideal approach:
@anish does this split make sense? Broker as the default, direct OAuth as an explicit fallback:
redirect_urisandaudiencesoverrides toOidcClientFeature(crates/governance-schema/src/team.rs) and its generator (crates/governance-tfgen/src/generators/keycloak.rs), including schema/docs/tests. Register Collar indata/teams/devops.yamlas a public PKCE client with audiencesgrafanaandcollar-broker.identity-brokering-api:v2inkeycloak/server.nix. Inkeycloak/providers.nix, provision confidential clientcollar-broker, allow token retrieval only forcmu-dev, and store its secret in OpenBao. Both files are undermodules/hosts/scottylabs/infra-01/.aud: collar-broker, andazp: collar. Use its subject, with no caller-supplied user or provider. Retrieve from Keycloak's V2cmu-devendpoint and return only the Forgejo access token and expiry. Refresh tokens stay in Keycloak.modules/hosts/scottylabs/infra-01/observability/grafana.nix, checking issuer, audience, and client. Keep browser OAuth and the existing role mapping; verify CLI and browser login resolve to the same account.src/auth.rsandsrc/oauth.rsfor Keycloak login/refresh/logout and relay access. Open Keycloak account linking during login ifcmu-devis missing or revoked. Keep direct OAuth opt-in. Add deployment-log queries through Grafana insrc/kennel.rs; no Kennel API changes.Before rollout, test expired access tokens, refresh rotation, revoked links, cross-user denial, and wrong-client/provider requests.
For session length, do you prefer bounded
offline_accessor longer normal sessions? Offline sessions need separate revocation from browser logout. Issued access tokens can remain valid until expiry; full offboarding still includes disabling Forgejo. Direct OAuth credentials also need separate revocation.The callback can stay
http://127.0.0.1/callback: Keycloak 26.8.1 ignores the port for loopback matching, sohttp://127.0.0.1:*isn't needed.@kritdass wrote in #9 (comment):
GET /projects/{project}/branches/{branch}) that i modified collar to use, so the logs section should get project/branch/commit from there instead of the kennel/deploy status2a4d97e1689bbe296042@anish Collar's SSO implementation is now on this PR. Could you handle these platform prerequisites before rollout?
Once those are deployed, we can verify university sign-in, account linking, expired and rotated tokens, revocation, account matching, and live deployment logs. The CLI uses normal sessions and broker-only Forgejo access, as you requested. Details are in docs/design/oidc.md.
Kennel Deployments
Last updated for commit
b787257.9bbe296042c6ca5349b9c6ca5349b9b787257656View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.