Skip to content

Conversation

@RogerHYang
Copy link
Contributor

@RogerHYang RogerHYang commented Oct 23, 2025

resolves #9481
resolves #9888


Note

Adds OIDC role-to-Phoenix role mapping (ADMIN/MEMBER/VIEWER) via env-configured claim path and strict mode, applying/syncing roles on login with extensive tests.

  • Auth/OIDC:
    • Introduce OAuth2UserRoleName (ADMIN|MEMBER|VIEWER) and reject SYSTEM for OAuth2.
    • Add env-driven role mapping config: ROLE_ATTRIBUTE_PATH, ROLE_MAPPING, ROLE_ATTRIBUTE_STRICT in OAuth2ClientConfig.from_env with robust validation.
    • Update OAuth2Client to extract role via JMESPath, map/validate roles, and honor strict/non-strict behavior; extend has_sufficient_claims to consider roles.
    • Enhance login flow (oauth2.py): validate ID token errors, validate access, extract/map role, and assign/sync role on sign-in/create (preserve role when mapping disabled).
  • Testing:
    • Add comprehensive unit/integration tests for role mapping, strict mode, groups interplay, and claim sufficiency; refactor OIDC integration tests into tests/integration/auth/test_oidc.py.
    • Extend mock OIDC server/fixtures to emit role claims and new env cases.

Written by Cursor Bugbot for commit a7e7a51. This will update automatically on new commits. Configure here.

@RogerHYang RogerHYang requested a review from a team as a code owner October 23, 2025 06:37
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Oct 23, 2025
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: 📘 Todo

1 participant