fix: relax SearchOrganizationTokens authz to GetPermission#1592
fix: relax SearchOrganizationTokens authz to GetPermission#1592rohilsurana merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adjusts the authorization permission requirement for the SearchOrganizationTokens RPC endpoint. The endpoint's authorization validation rule in the ChangesToken Search Authorization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
8400979 to
84587c4
Compare
There was a problem hiding this comment.
Pull request overview
Relaxes authorization for the SearchOrganizationTokens billing/transactions endpoint from requiring organization update permission to requiring organization get permission, aligning it with other read-only billing endpoints (e.g., ListBillingTransactions, TotalDebitedTransactions).
Changes:
- Update
SearchOrganizationTokensauthz check to useschema.GetPermissioninstead ofschema.UpdatePermission. - Keep authorization scoped to the organization object derived from
SearchOrganizationTokensRequest.id.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/server/connect_interceptors/authorization.go (1)
998-1001: ⚡ Quick winLGTM — permission correctly relaxed to
GetPermissionfor this read-only search endpoint.The change aligns
SearchOrganizationTokenswith other read-only billing endpoints (ListBillingTransactions,GetBillingBalance, etc.) that all useschema.GetPermission.One adjacent observation (out of scope for this PR, but worth a follow-up):
SearchOrganizationInvoices(Line 994) andGetUpcomingInvoice/ListInvoices(Lines 990, 1002) are also read-only but still requireschema.UpdatePermission. If the intent is to allow org members with read access to view billing data broadly, those endpoints may warrant the same relaxation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 04654d02-72ee-4acb-aefa-428db5b67ba9
📒 Files selected for processing (1)
pkg/server/connect_interceptors/authorization.go
Coverage Report for CI Build 25491223094Coverage remained the same at 41.963%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Summary
SearchOrganizationTokensauthorization fromUpdatePermissiontoGetPermissionto align withListBillingTransactionsand other read-only billing endpointsTest plan