• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / auth / 16805096183
69%

Build:
DEFAULT BRANCH: master
Ran 07 Aug 2025 01:02PM UTC
Jobs 1
Files 152
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Aug 2025 12:55PM UTC coverage: 70.825% (+0.2%) from 70.585%
16805096183

push

github

web-flow
feat: add oauth2 client support (#2098)

## Summary

This PR implements OAuth2 client support in Supabase Auth, enabling
applications to register OAuth clients programmatically. This is a
foundational step toward full OAuth 2.1 server compliance.

## Features Added

### Client Registration Endpoints
- Manual Registration (POST /admin/oauth/clients) - Admin-only endpoint
for manual client registration
- Dynamic Registration (POST /oauth/clients/register) - OAuth 2 Dynamic
Client Registration compliant endpoint (configurable by env variable)

 ### Client Management Endpoints
- List Clients (GET /admin/oauth/clients) - List all registered OAuth 
- Get Client (GET /admin/oauth/clients/{client_id}) - Retrieve specific
client
- Delete Client (DELETE /admin/oauth/clients/{client_id}) - Soft-delete
OAuth clients

## Notes on Technical Implementation

### Database Schema
- New `oauth_clients` table
- Indexing & soft-delete support

### Code Organization
- New `internal/api/oauthserver` package for OAuth server functionality.
This package aimed to include all oauth server code. Note that Supabase
Auth as of today is already a OAuth client to other OAuth Providers (i.e
google)
- Shared utilities in `internal/api/shared` to avoid circular
dependencies. Planning to move the necessary code as we go. Started with
`sendJSON` function.
- Comprehensive test coverage with both unit and integration tests

## Quick Test
Register a new OAuth client:
```sh
curl -X POST http://localhost:9999/oauth/clients/register \
    -H "Content-Type: application/json" \
    -d '{
      "client_name": "My App",
      "redirect_uris": ["https://myapp.example.com/callback"]
    }'
```

## Important Note
There is no breaking change in this PR. This is purely additive
functionality that doesn't affect existing authentication flows.

358 of 448 new or added lines in 13 files covered. (79.91%)

12235 of 17275 relevant lines covered (70.82%)

70.53 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
77.78
internal/api/oauthserver/utils.go
2
77.78
internal/api/shared/http.go
14
79.8
-3.41% internal/api/middleware.go
14
85.42
internal/models/oauth_client.go
16
88.15
internal/api/oauthserver/service.go
17
41.38
internal/api/oauthserver/auth.go
25
77.88
internal/api/oauthserver/handlers.go
Jobs
ID Job ID Ran Files Coverage
1 16805096183.1 07 Aug 2025 01:02PM UTC 152
70.82
GitHub Action Run
Source Files on build 16805096183
  • Tree
  • List 152
  • Changed 8
  • Source Changed 0
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8fae0158 on github
  • Prev Build on master (#16772506231)
  • Next Build on master (#17045427327)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc