Skip to content

feat(auth): add OAuth 2.1 client admin endpoints - #809

Merged
grdsdev merged 1 commit into
mainfrom
feat/oauth-client-admin-endpoints
Oct 6, 2025
Merged

grdsdev merged 1 commit into
mainfrom
feat/oauth-client-admin-endpoints

Conversation

@grdsdev

@grdsdev grdsdev commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds OAuth 2.1 client administration endpoints to support managing OAuth clients when the OAuth 2.1 server is enabled in Supabase Auth.

Changes

This PR introduces a new admin.oauth namespace with the following methods:

  • listClients(params:) - List all OAuth clients with optional pagination
  • createClient(params:) - Create a new OAuth client
  • getClient(clientId:) - Get details of a specific OAuth client
  • deleteClient(clientId:) - Delete an OAuth client
  • regenerateClientSecret(clientId:) - Regenerate the secret for an OAuth client

Implementation Details

  1. New Types (in Types.swift):

    • OAuthClient - OAuth client object with all properties
    • OAuthClientGrantType - Supported grant types (authorization_code, refresh_token)
    • OAuthClientResponseType - Supported response types (code)
    • OAuthClientType - Client confidentiality (public, confidential)
    • OAuthClientRegistrationType - Registration type (dynamic, manual)
    • CreateOAuthClientParams - Parameters for creating a new OAuth client
    • ListOAuthClientsPaginatedResponse - Paginated response for listing clients
  2. New File (AuthAdminOAuth.swift):

    • Implements all OAuth client administration methods
    • Follows existing patterns from AuthAdmin.swift
    • Includes proper documentation and warnings about service_role key
  3. Tests (AuthAdminOAuthTests.swift):

    • Comprehensive test coverage for all methods
    • Mock HTTP responses following existing test patterns
    • All tests passing ✅

Related

Ported from supabase-js: supabase/supabase-js#1582

Test Plan

  • All new tests pass
  • Build succeeds
  • Follows existing code patterns and conventions
  • Documentation includes warnings about service_role key usage

🤖 Generated with Claude Code

Adds OAuth 2.1 client administration endpoints to support managing OAuth clients when the OAuth 2.1 server is enabled in Supabase Auth.

New admin.oauth namespace with methods:
- listClients() - List all OAuth clients with pagination
- createClient() - Create a new OAuth client
- getClient() - Get a specific OAuth client
- deleteClient() - Delete an OAuth client
- regenerateClientSecret() - Regenerate client secret

Includes comprehensive types and tests following existing patterns.

Ported from supabase-js PR: supabase/supabase-js#1582

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@grdsdev
grdsdev requested a review from a team October 2, 2025 14:41
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 18196434658

Details

  • 94 of 96 (97.92%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 78.043%

Changes Missing Coverage Covered Lines Changed/Added Lines %
Sources/Auth/AuthAdminOAuth.swift 83 85 97.65%
Totals Coverage Status
Change from base Build 18162185304: 0.3%
Covered Lines: 5687
Relevant Lines: 7287

💛 - Coveralls

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.

3 participants