Skip to content

feat(auth): parity oauth authorisation - #818

Closed
diegofesanto wants to merge 6 commits into
supabase:masterfrom
diegofesanto:feature/oauth-authorization
Closed

diegofesanto wants to merge 6 commits into
supabase:masterfrom
diegofesanto:feature/oauth-authorization

Conversation

@diegofesanto

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

feature

What is the current behavior?

What is the new behavior?

  • Parity OAuth Authorisation request

Additional context

Add any other context or screenshots.

@diegofesanto
diegofesanto marked this pull request as draft November 20, 2026 14:01
@Tr00d

Tr00d commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@diegofesanto I've run a quick review from Claude on this PR, to see if it matches the requirements. Here's the output:

  1. The capability keys don't match your cards.
  • Client.cs:1357-1394 annotates the methods with auth.oauth.get_authorization_details, .approve_authorization, .deny_authorization, .list_grants and .revoke_grant. Your cards use auth.oauth_server.*.
  • The registry already groups the admin capabilities as auth.oauth_admin.* (sdk-compliance.yaml:256). So auth.oauth.* looks invented.
  • The five cards would stay not_implemented, and the generated matrix would carry keys that aren't in the registry. This is probably the most important fix.
  • I haven't checked this against the registry repo itself, only against sdk-compliance.yaml.
  1. AuthorizationOptions.SkipBrowserRedirect does nothing.
  • Api.cs:438-453 accepts options but never reads it. The Client passes it through and it's dropped.
  • The deny contract test passes SkipBrowserRedirect = true and asserts the body is unchanged, so it locks in the no-op.
  • That's dead public API, and nothing is unshipped-only about the cost: it ships in PublicAPI.Unshipped.txt. A .NET SDK doesn't navigate a browser, so I'd drop the parameter and the record. If you keep it, document that it's ignored.
  1. GetAuthorizationDetails doesn't escape authorizationId.
  • Api.cs:428 interpolates the raw id into the path. SubmitAuthorizationDecision right below it uses PathSegment.Escape.
  • An id containing / or ? changes the request path. Escape it.
  1. Likely coverage and mutation gaps.
  • I see no tests for the converter's Write branches (details, redirect, throw), the non-object JsonException, or the three ?? throw / ?? new List fallbacks in Api.cs.
  • There's no server-rejection test for any of the five calls.
  • The skill requires 100% coverage and no surviving mutants on changed lines, so I'd expect gate.sh to fail. I haven't run it.
  1. The E2E tests probably can't be rerun.
  • They use fixed seeded ids. Approve and deny flip pending to approved or denied, and revoke consumes the grant.
  • A second run without a stack reset would likely fail. I'd check how the existing OAuth-admin E2E tests handle this.
  • Related: the seed user in the migration has no auth.identities row. Password sign-in probably still works, but I haven't confirmed it.

Smaller items

  • Naming: the new client methods lack the Async suffix, while GetClaimsAsync, UnenrollRecoveryCodesAsync and CreateOAuthClientAsync have it.
  • Test: OAuthAuthorization_ShouldNotSendRequest_GivenCancelledToken covers only GetAuthorizationDetails, passes an empty id, and names its local list.
  • Converter: it re-parses with GetRawText() instead of root.Deserialize(options).
  • Models: string.Empty defaults hide missing fields, and OAuthGrant.Scopes is a mutable List on a sealed record.
  • Unrelated changes:
    • A stray in Gotrue.Tests.csproj.
    • The ILogger using-cleanup in Api.cs.
    • A 296-line supabase/supabase.lock and four .gitignore entries. Is the lock file meant to be committed?
  • PR description: it's a template with an empty "current behavior" and a one-line "new behavior".

@Tr00d

Tr00d commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

@diegofesanto In order to avoid this PR to drift too much from master, I created another PR that supersedes this one: #1058
I addressed all the points that I raised, and you're still referenced in the PR.
Therefore, I'm closing this one. Thanks for doing most of the work!

@Tr00d Tr00d closed this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants