Skip to content

Add group assumption for OAuth authentication - #308

Merged
mihaimitrea-db merged 4 commits into
mainfrom
rbac-oauth-group-assumption
Sep 4, 2026
Merged

Add group assumption for OAuth authentication#308
mihaimitrea-db merged 4 commits into
mainfrom
rbac-oauth-group-assumption

Conversation

@mihaimitrea-db

Copy link
Copy Markdown
Contributor

Summary

Adds group role assumption to OAuth M2M and OIDC token exchange requests. This is the second PR in the stack and is stacked on #307.

Why

#307 makes group configuration available to authentication and prevents unsupported PAT or CLI strategies from silently ignoring it. OAuth providers still need to send that group to the token endpoint; otherwise the issued token does not assume the requested role.

This PR completes the flow by sending assume_group only during OAuth token acquisition. It does not add group headers to ordinary API calls or change generated client options.

What changed

Interface changes

Behavioral changes

  • OAuth M2M token grants include assume_group for non-empty group IDs.
  • OIDC token exchanges include assume_group for non-empty group IDs.
  • Repeated token requests retain the configured group.
  • Rejected grouped requests preserve the server error and are not retried without the group.
  • Explicit credentials use only their own group configuration; profile and environment groups apply only to default credentials.
  • Ordinary generated-client API requests contain the OAuth bearer token but no group-role headers.

Internal changes

  • Adds focused M2M and OIDC coverage for workspace, account/unified, and account-wide endpoint shapes.
  • Adds isolation, repeated-request, empty-group, and rejection tests.
  • Adds a dedicated generated-client boundary test covering profile, environment, and explicit credentials.
  • Adds auth documentation and changelog entries.
  • Does not modify generated source files or dependencies.

How is this tested?

Passed the full repository checks:

  • npm run format
  • npm run lint
  • npm run typecheck
  • npm test
  • npm run test:browser
  • npm run build

@mihaimitrea-db
mihaimitrea-db marked this pull request as ready for review August 26, 2026 16:40
@mihaimitrea-db mihaimitrea-db self-assigned this Aug 26, 2026
@mihaimitrea-db
mihaimitrea-db force-pushed the rbac-oauth-group-assumption branch from ee8c2b5 to f690262 Compare September 3, 2026 11:25
Comment thread packages/auth/README.md Outdated
Comment thread packages/auth/tests/oidc/tokensource.test.ts
Comment thread packages/auth/tests/credentials/m2m.test.ts
Base automatically changed from rbac-group-configuration to main September 4, 2026 09:16
@mihaimitrea-db
mihaimitrea-db force-pushed the rbac-oauth-group-assumption branch from d0b1ae9 to 8c7315d Compare September 4, 2026 09:17
@mihaimitrea-db
mihaimitrea-db added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 1859cbc Sep 4, 2026
45 checks passed
@mihaimitrea-db
mihaimitrea-db deleted the rbac-oauth-group-assumption branch September 4, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants