Skip to content

fix(supabase_common): accept uppercase and mixed-case UUIDs in validation - #1656

Merged
spydon merged 1 commit into
mainfrom
worktree-1649
Aug 6, 2026
Merged

spydon merged 1 commit into
mainfrom
worktree-1649

Conversation

@spydon

@spydon spydon commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

uuidRegex in packages/supabase_common/lib/src/uuid.dart only matched lowercase hexadecimal characters, so validateUuid rejected otherwise valid uppercase or mixed-case UUID strings. UUIDs are case-insensitive per RFC 9562/4122, and such identifiers are commonly returned by external identity providers and databases.

This affects GoTrueAdminOAuthApi.getClient, updateClient, deleteClient and regenerateClientSecret, which validate the client id before issuing the request.

Changes

  • packages/supabase_common/lib/src/uuid.dart — pass caseSensitive: false to the UUID RegExp.
  • packages/gotrue/test/src/helper_test.dart — flip the uppercase test from rejecting to accepting, add a mixed-case case, and update the uuidRegex case test. Non-hexadecimal characters such as G are still rejected.

Outcome

Implemented.

Reference

Fixes #1649

Compliance matrix

No change needed. The fix is internal to an existing helper and adds no public symbols; the capabilities it affects (auth.oauth_admin.get_client, auth.oauth_admin.update_client, auth.oauth_admin.delete_client, auth.oauth_admin.regenerate_client_secret) are already implemented in sdk-compliance.yaml.

Summary by CodeRabbit

  • Bug Fixes
    • UUID validation now accepts uppercase and mixed-case hexadecimal characters.
    • UUID format matching is consistently case-insensitive.

SDK-1424

…tion

UUIDs are case-insensitive per RFC 9562/4122, but the validation regex
only matched lowercase hexadecimal characters, so uppercase identifiers
returned by external identity providers or databases were rejected.
@spydon
spydon requested a review from a team as a code owner August 6, 2026 08:30
@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The UUID regular expression now accepts uppercase and mixed-case hexadecimal characters. Tests cover uppercase and mixed-case inputs for both validateUuid and uuidRegex.

Changes

UUID validation

Layer / File(s) Summary
Case-insensitive UUID validation
packages/supabase_common/lib/src/uuid.dart, packages/gotrue/test/src/helper_test.dart
uuidRegex now matches hexadecimal characters without regard to case. Tests verify uppercase and mixed-case UUIDs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: dshukertjr

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes implement case-insensitive UUID validation and add tests for uppercase and mixed-case UUIDs without changing the public API.
Out of Scope Changes check ✅ Passed The changes are limited to UUID validation and its tests, which directly support the linked issue objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: UUID validation now accepts uppercase and mixed-case hexadecimal characters.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-1649

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@spydon
spydon merged commit 691690c into main Aug 6, 2026
48 checks passed
@spydon
spydon deleted the worktree-1649 branch August 6, 2026 08:42
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.

parity(auth): accept uppercase UUIDs in UUID validation [from supabase-js]

2 participants