Skip to content

feat: OIDC group-to-role mapping and various improvements#5

Merged
leonmeijer merged 2 commits intomainfrom
feature/oidc-group-mapping-and-fixes
Jan 17, 2026
Merged

feat: OIDC group-to-role mapping and various improvements#5
leonmeijer merged 2 commits intomainfrom
feature/oidc-group-mapping-and-fixes

Conversation

@leonmeijer
Copy link
Owner

Summary

  • OIDC Group-to-Role Mapping: Automatically assign Console roles based on OIDC group membership
  • Global Admin Groups: Configure OIDC groups that grant global admin access via OIDC_ADMIN_GROUPS env var
  • Configurable PULSAR_CLUSTER: Make cluster name configurable via environment variable
  • New OIDC Groups Settings Page: UI for configuring group mappings per environment

Additional Improvements (on top of original PR #4)

  • Security: Remove hardcoded JWT token from test script, use environment variables
  • Bug fix: Fix admin revocation - actually revoke is_global_admin when user leaves admin OIDC groups
  • Code quality: Extract duplicated formatBytes to shared utility src/lib/format.ts
  • Performance: Fix N+1 query in topic listing with asyncio.gather parallel batching

New Environment Variables

Variable Description Default
OIDC_ROLE_CLAIM OIDC claim containing user groups groups
OIDC_ADMIN_GROUPS Comma-separated admin groups
OIDC_SYNC_ROLES_ON_LOGIN Sync roles on every login true
PULSAR_CLUSTER Pulsar cluster name standalone

Test plan

  • Configure OIDC_ADMIN_GROUPS=admins and verify users in that group become global admins
  • Verify admin status is revoked when user leaves admin group (with sync enabled)
  • Create group-to-role mapping in UI and verify role assignment on login
  • Verify UI works with both global OIDC config and per-environment database config
  • Test topic listing performance with many topics

Based on PR #4 by @pezzking

🤖 Generated with Claude Code

pezzking and others added 2 commits January 16, 2026 19:32
OIDC Group Mapping:
- Add automatic role assignment based on OIDC group membership
- Support global admin groups via OIDC_ADMIN_GROUPS env var
- Add OIDC_ROLE_CLAIM config for custom group claim name
- Add OIDC_SYNC_ROLES_ON_LOGIN to sync roles on every login
- New Settings > OIDC Groups page for UI configuration
- Support both env var config and per-environment database config
- Auto-create database record when saving with global OIDC config

Backend:
- Add group mapping fields to oidc_providers table (migration 007)
- Update auth service with group extraction and role mapping logic
- Add OIDC provider CRUD endpoints for environment configuration
- Make PULSAR_CLUSTER configurable via environment variable

Frontend:
- Add OIDCSettingsPage for group mapping configuration
- Add OIDC Groups navigation item in sidebar
- Update API hooks and types for OIDC provider config

Documentation:
- Update README with OIDC group mapping documentation
- Add .env.example with all configuration options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove hardcoded JWT token from test_producer.py, use env vars instead
- Fix admin revocation bug: actually revoke is_global_admin when user
  leaves admin OIDC groups (was a no-op pass statement)
- Extract duplicated formatBytes to shared utility src/lib/format.ts
- Fix N+1 query in topic listing with asyncio.gather parallel batching

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@leonmeijer leonmeijer merged commit 6b380fd into main Jan 17, 2026
2 checks passed
@leonmeijer leonmeijer deleted the feature/oidc-group-mapping-and-fixes branch January 17, 2026 07:50
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