Skip to content

feat: add admin routes to manage OAuth providers at runtime#95

Merged
Bccorb merged 1 commit into
mainfrom
feat/oauth-provider-admin-routes
Jul 21, 2026
Merged

feat: add admin routes to manage OAuth providers at runtime#95
Bccorb merged 1 commit into
mainfrom
feat/oauth-provider-admin-routes

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #62. Adds admin-scoped routes to manage OAuth providers at runtime, so admins can list, add, update, and remove providers without hand-editing system_config or replacing the whole oauth_providers array.

New routes on the SystemConfig admin surface:

  • GET /system-config/oauth-providers (list, requireAdmin('read'))
  • POST /system-config/oauth-providers (add, 409 on duplicate id)
  • PATCH /system-config/oauth-providers/:id (update, 404 on unknown id)
  • DELETE /system-config/oauth-providers/:id (remove, 404 on unknown id)

Mutations require requireAdmin('write'), validate against OAuthProviderConfigSchema, invalidate the system-config cache, and record a system_config_updated audit event. Client secrets stay out of the API surface: providers reference clientSecretEnv (the env var name) and the routes never accept or return a raw secret.

The existing whole-array PATCH /system-config/admin path is unchanged, so this is additive. The per-provider routes exist to give concurrency-safe, single-provider semantics (no last-write-wins clobber on the shared array) plus dedicated OpenAPI coverage.

Contract impact (ripple)

This is a contract change (new routes). Coordinated PRs:

  • seamless-auth-server: adds proxy passthroughs + a core cookie-requirements entry for the new paths.
  • seamless-auth-admin-dashboard: migrates the provider editor to the per-provider routes.

Testing

  • 11 new integration tests in tests/integration/systemConfig/oauthProviders.spec.ts.
  • Full suite green via the pre-commit gate: 962 passing, coverage 99%+.

Add GET/POST/PATCH/DELETE /system-config/oauth-providers so admins can list,
add, update, and remove OAuth providers without hand-editing system_config or
replacing the whole oauth_providers array. Each mutation validates against
OAuthProviderConfigSchema, invalidates the system-config cache, and records a
system_config_updated audit event. Client secrets stay out of the API surface:
providers reference clientSecretEnv and the routes never accept or return a raw
secret. The existing whole-array PATCH /system-config/admin path is unchanged.

Closes #62
@Bccorb
Bccorb merged commit fe78de9 into main Jul 21, 2026
2 of 3 checks passed
@Bccorb
Bccorb deleted the feat/oauth-provider-admin-routes branch July 21, 2026 18:36
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.

Add admin endpoints to manage OAuth providers at runtime

1 participant