Skip to content

feat(server): Admin REST APIs for identity providers and auth settings#1281

Open
theothersideofgod wants to merge 5 commits into
feat/oauth-module-loadersfrom
feat/admin-identity-providers
Open

feat(server): Admin REST APIs for identity providers and auth settings#1281
theothersideofgod wants to merge 5 commits into
feat/oauth-module-loadersfrom
feat/admin-identity-providers

Conversation

@theothersideofgod

Copy link
Copy Markdown
Contributor

Summary

  • Add REST APIs for managing OAuth identity providers (/identity-providers)
  • Add REST API for managing auth settings (/app-settings-auth)
  • Fix loader TTL to properly expire after 5 minutes (not refreshed on reads)
  • Lower permission requirement from admin to app member for Dashboard users

Changes

Identity Providers API (/identity-providers)

  • GET /identity-providers - List all providers
  • GET /identity-providers/:slug - Get provider details
  • PATCH /identity-providers/:slug - Update provider config (clientId, enabled, scopes, etc.)
  • POST /identity-providers/:slug/secret - Set/rotate client secret

Auth Settings API (/app-settings-auth)

  • GET /app-settings-auth - Get current settings
  • PATCH /app-settings-auth - Update settings
  • Exposes allowIdentitySignIn and allowIdentitySignUp fields for OAuth control

Fixes

  • updateAgeOnGet: false in LRU cache - TTL now expires from first set, not refreshed on reads
  • Direct SQL for secret rotation (bypasses broken rotate_identity_provider_platform_secret function)
  • Permission check uses app_memberships_sprt instead of app_admin_grants

Test Plan

  • Test identity providers CRUD via REST API
  • Test auth settings GET/PATCH
  • Test OAuth flow with GitHub provider
  • Verify cache expiration works correctly

🤖 Generated with Claude Code

theothersideofgods and others added 5 commits June 8, 2026 20:10
Add endpoints for managing OAuth/OIDC identity provider configurations:
- GET /identity-providers - list all providers
- GET /identity-providers/:slug - get provider details
- PATCH /identity-providers/:slug - update provider config
- POST /identity-providers/:slug/secret - rotate client secret

Requires administrator role. Uses module loaders to discover schemas
and function names at runtime.

Also adds prefix and rotateSecretFunction fields to IdentityProvidersConfig
for calling the generated rotate_identity_provider_{prefix}_secret procedure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add endpoints for managing auth settings (cookie, captcha, OAuth config):
- GET /app-settings-auth - get current settings
- PATCH /app-settings-auth - update settings

Requires administrator role. Uses sessions_module discovery to find
the app_settings_auth table in tenant DB.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
TTL now counts from first cache set, not refreshed on reads.
Previously, any request accessing cached data would reset the TTL,
causing config changes to never take effect while traffic exists.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change permission check from isAppAdmin to isAppMember
- Fix secret rotation by using direct SQL instead of broken stored function
- The rotate_identity_provider_platform_secret function has a bug
  (missing database_id), bypassed with direct INSERT/UPDATE

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add allow_identity_sign_in and allow_identity_sign_up fields to GET/PATCH
- Change permission check from isAppAdmin to isAppMember
- These fields control whether OAuth login/signup is enabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@theothersideofgod theothersideofgod changed the base branch from main to feat/oauth-module-loaders June 9, 2026 14:18
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