refactor: restructure PAT scopes to use role-resource type pairing#1475
refactor: restructure PAT scopes to use role-resource type pairing#1475
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughRefactors PATs from role/project ID lists to scope-based Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
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 |
Pull Request Test Coverage Report for Build 23538167499Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
core/userpat/service_test.go (1)
1161-1167: Round-trip the scope matrix through enrichment.This harness verifies the
policyService.Createset, but it never asserts thePAT.Scopesreturned fromCreate/Get. Because of that, reconstruction bugs like org scopes gainingresource_idsor unstable ordering would still pass. Please add a returned-scope assertion for at least one mixed org+project case.Also applies to: 1186-1235
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5b692cfe-50e2-4bc3-aa5f-e15a3f8d2503
⛔ Files ignored due to path filters (4)
proto/v1beta1/frontier.pb.gois excluded by!**/*.pb.go,!proto/**proto/v1beta1/frontier.pb.validate.gois excluded by!proto/**proto/v1beta1/models.pb.gois excluded by!**/*.pb.go,!proto/**proto/v1beta1/models.pb.validate.gois excluded by!proto/**
📒 Files selected for processing (8)
Makefilecore/userpat/errors/errors.gocore/userpat/models/pat.gocore/userpat/service.gocore/userpat/service_test.gointernal/api/v1beta1connect/user_pat.gointernal/api/v1beta1connect/user_pat_test.gotest/e2e/regression/pat_test.go
Description:
Summary
role_ids[]+project_ids[]with structuredrepeated PATScope scopesin Create, Update, Get, List, and PAT responseapp/organizationorapp/project) and optional resource IDsErrScopeMismatcherror for role-resource type compatibility validationPATScope structure
Example
Changes
Test
✅ Manual: verified per-project role assignment works (different roles on different projects)
✅ Manual: Create, Update, Get, List return correct scopes with resource IDs
✅ E2E: make e2e-test (pat_test.go updated)