You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(frontier): check that Usage.user_id is a uuid when set - #506
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Usage.user_idmust now be a uuid when it is set. An emptyuser_idis still allowed, for usage that no user triggered.The rule has the same form as the other optional uuid fields:
ignore: IGNORE_IF_ZERO_VALUEwithstring: {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_idas 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_idthat is not a uuid now gets a validation error.