Skip to content

feat(frontier): check that Usage.user_id is a uuid when set - #506

Merged
AmanGIT07 merged 1 commit into
mainfrom
feat/frontier-usage-user-id-uuid
Dec 1, 2026
Merged

AmanGIT07 merged 1 commit into
mainfrom
feat/frontier-usage-user-id-uuid

Conversation

@AmanGIT07

Copy link
Copy Markdown
Contributor

Usage.user_id must now be a uuid when it is set. An empty user_id is still allowed, for usage that no user triggered.

The rule has the same form as the other optional uuid fields: ignore: IGNORE_IF_ZERO_VALUE with string: {uuid: true}. A lowercase or uppercase uuid in the dashed form passes. A uuid without dashes or in braces is rejected, as on every other uuid field, and so is any other text.

Frontier stores user_id as text and casts it to a uuid to find the user behind a transaction. A stored value that is not a uuid fails that cast, and the organization's token search fails with it. With this rule, frontier's request validation rejects such a value before it is stored.

This is not a wire change. A client that sends a user_id that is not a uuid now gets a validation error.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Usage.user_id field retains field number 7. Its validation now ignores the zero value and requires nonzero values to be UUIDs.

Suggested reviewers: kushsharma

Merge Risk: Minimal · up to d03e7

Non-empty Usage.user_id values must now be valid UUIDs, and clients that send other text will get a validation error. Empty values and existing UUIDs are unaffected, so there is no known merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: Usage.user_id must be a UUID when set. It matches the raw summary, which describes UUID validation on Usage.user_id that ignores zero values. The title uses the conve…
Description check Passed The description explains the change in detail. It says Usage.user_id must be a UUID when set, and an empty value stays allowed. It names the IGNORE_IF_ZERO_VALUE and string uuid rule, and it gives the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: Usage.user_id must be a UUID when set. It matches the raw summary, which describes UUID validation on Usage.user_id that ignores zero values. The title uses the conventional feat(frontier) prefix and is specific, so it passes.

Full details: Description check

Explanation

The description explains the change in detail. It says Usage.user_id must be a UUID when set, and an empty value stays allowed. It names the IGNORE_IF_ZERO_VALUE and string uuid rule, and it gives the reason: a non-UUID stored value breaks the token search cast. It matches the raw summary and the objectives, so it passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Buf (1.74.0)

raystack/frontier/v1beta1/models.proto

fatal: unable to access 'https://github.com/raystack/proton.git/': Failed to connect to github.com:443 over proxy 127.0.0.1 after 0 ms: Could not connect to server
fatal: could not fetch 1599734ecea7b9c021bc8b6ba99356308388f167 from promisor remote

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 66db41eb-6437-4816-b2a7-9b59f9d204db
Commits

Reviewing files that changed from the base of the PR and between 94668c3 and d03e73f.

Files selected for processing: 1

  • raystack/frontier/v1beta1/models.proto

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Validate / validate (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedNov 30, 2026, 6:39 PM

@AmanGIT07
AmanGIT07 merged commit e0e28b4 into main Dec 1, 2026
3 checks passed
@AmanGIT07
AmanGIT07 deleted the feat/frontier-usage-user-id-uuid branch December 1, 2026 14:27
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.

2 participants