Skip to content

Commit 1f804a2

Browse files
authored
feat(openapi): add OAuth 2.1 server endpoints and clarify OAuth modes (#2165)
## Summary - Add OAuth server endpoints to openapi doc: - POST /oauth/clients/register - dynamic client registration - POST /oauth/token - token endpoint - GET /oauth/authorize - authorization endpoint - GET /oauth/authorizations/{id} - get authorization details - POST /oauth/authorizations/{id}/consent - approve/deny authorization - Admin endpoints: /admin/oauth/clients/* for client management - Clarify OAuth documentation with two distinct modes: - oauth-client: Auth service as OAuth client (external providers) - oauth-server: Auth service as OAuth provider (for other apps) - Add OAuthClientSchema for consistent client object structure - Document configuration requirements (`GOTRUE_OAUTH_SERVER_ENABLED`, `GOTRUE_OAUTH_SERVER_ALLOW_DYNAMIC_REGISTRATION`)
1 parent b0a0c3e commit 1f804a2

File tree

2 files changed

+579
-6
lines changed

2 files changed

+579
-6
lines changed

internal/api/oauthserver/handlers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ func (s *Server) OAuthServerClientList(w http.ResponseWriter, r *http.Request) e
216216
ctx := r.Context()
217217
db := s.db.WithContext(ctx)
218218

219+
// TODO(cemal) :: Add pagination, check the `/admin/users` endpoint for reference
219220
var clients []models.OAuthServerClient
220221
if err := db.Q().Where("deleted_at is null").Order("created_at desc").All(&clients); err != nil {
221222
return apierrors.NewInternalServerError("Error listing OAuth clients").WithInternalError(err)

0 commit comments

Comments
 (0)