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

supabase / auth / 17648046512
69%

Build:
DEFAULT BRANCH: master
Ran 11 Sep 2025 02:44PM UTC
Jobs 1
Files 161
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

11 Sep 2025 02:36PM UTC coverage: 67.943% (-0.8%) from 68.733%
17648046512

push

github

web-flow
feat(oauth2): add `/oauth/token` endpoint (#2159)

## Summary
This PR completes the OAuth2 server implementation by adding the
`/token` endpoint, enabling full OAuth2 authorization code flow &
refresh token support.

## Key Features Added:
### OAuth Token Endpoint (POST /oauth/token) supporting:
- `authorization_code` grant type for exchanging authorization codes for
access
- refresh_token grant type for token refresh
- Both JSON and form-encoded request bodies
- OAuth Client authentication via Basic auth or request body parameters
(form params and JSON body)

### Token Service Integration:
- Integrated OAuth server with the existing token service
- Added OAuth-specific authentication method
(`oauth_provider/authorization_code`)
- Enhanced token generation to include OAuth client context in JWT
claims.

## Database Changes:
- Added `oauth_client_id` field to `sessions` table for OAuth client
tracking. So an OAuth clients can use a refresh token only if the
session is issued for them. Similarly, a session issued to a client can
only be refreshed by that client (i.e user can't use
`/token?grant_type=refresh_token` endpoint with a refresh token obtained
through `/oauth/token` endpoint.)

## Next Steps
- Adding ratelimit for the `/token` endpoint
- Store token auth method for oauth clients in the database

88 of 303 new or added lines in 13 files covered. (29.04%)

13 existing lines in 2 files now uncovered.

12630 of 18589 relevant lines covered (67.94%)

65.72 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
75.99
-2.63% internal/api/middleware.go
2
45.83
-1.31% internal/models/errors.go
2
66.32
-1.08% internal/models/refresh_token.go
4
74.07
-5.93% internal/api/shared/context.go
4
63.04
-0.93% internal/models/factor.go
7
75.7
-5.3% internal/models/oauth_client.go
14
73.98
-1.37% internal/tokens/service.go
24
0.0
-41.38% internal/api/oauthserver/auth.go
156
31.02
-33.03% internal/api/oauthserver/handlers.go

Uncovered Existing Lines

Lines Coverage ∆ File
6
0.0
-41.38% internal/api/oauthserver/auth.go
7
75.99
-2.63% internal/api/middleware.go
Jobs
ID Job ID Ran Files Coverage
1 17648046512.1 11 Sep 2025 02:44PM UTC 161
67.94
GitHub Action Run
Source Files on build 17648046512
  • Tree
  • List 161
  • Changed 15
  • Source Changed 0
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • a89a0b05 on github
  • Prev Build on master (#17459483364)
  • Next Build on master (#17727234968)
  • 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