feat: ListCurrentUserPATs and GetCurrentUserPAT proto#447
feat: ListCurrentUserPATs and GetCurrentUserPAT proto#447
Conversation
📝 WalkthroughWalkthroughThis pull request extends the Frontier Service API with new Personal Access Token (PAT) management capabilities by adding list and get RPC endpoints, along with corresponding request/response message types, and enhances the PAT data model with role, project, and timestamp fields. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
raystack/frontier/v1beta1/frontier.proto (1)
2879-2884: Consider addingorg_idfor API consistency.
GetCurrentUserPATRequestonly requiresid, whileListCurrentUserPATsRequestrequiresorg_id. This creates an asymmetry in the API surface.While the PAT
idis likely globally unique (UUID), includingorg_idwould:
- Maintain consistency with the list endpoint
- Enable explicit org-level authorization checks
- Follow the pattern used by similar requests like
GetServiceUserRequestandGetOrganizationInvitationRequestIf the omission is intentional (e.g., PAT lookup by UUID is sufficient), please confirm and disregard.
Suggested change
message GetCurrentUserPATRequest { string id = 1 [ (validate.rules).string.uuid = true, (google.api.field_behavior) = REQUIRED ]; + string org_id = 2 [ + (validate.rules).string.uuid = true, + (google.api.field_behavior) = REQUIRED + ]; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@raystack/frontier/v1beta1/frontier.proto` around lines 2879 - 2884, Add an org_id field to the GetCurrentUserPATRequest message to match ListCurrentUserPATsRequest and enable org-level authorization: in message GetCurrentUserPATRequest, add a second field like `string org_id = 2 [(validate.rules).string.uuid = true, (google.api.field_behavior) = REQUIRED];` so both id and org_id are present (refer to GetServiceUserRequest and GetOrganizationInvitationRequest for the same pattern).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@raystack/frontier/v1beta1/frontier.proto`:
- Around line 2879-2884: Add an org_id field to the GetCurrentUserPATRequest
message to match ListCurrentUserPATsRequest and enable org-level authorization:
in message GetCurrentUserPATRequest, add a second field like `string org_id = 2
[(validate.rules).string.uuid = true, (google.api.field_behavior) = REQUIRED];`
so both id and org_id are present (refer to GetServiceUserRequest and
GetOrganizationInvitationRequest for the same pattern).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b8e96487-0684-4237-91b8-f825ade2a16b
📒 Files selected for processing (2)
raystack/frontier/v1beta1/frontier.protoraystack/frontier/v1beta1/models.proto
Summary by CodeRabbit