fix(reconcile): tighten permission name and namespace validation to SpiceDB grammar - #1889
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesCustom permission validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change tightens permission and namespace validation to prevent invalid configurations from reaching apply time; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
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 |
Coverage Report for CI Build 32238271615Coverage increased (+0.03%) to 48.782%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
|
Review: tighten permission grammar to SpiceDB (RFC 0001 Rule 3) Verified on this branch: This meets Rule 3 for the modes it claims. The new patterns Verdict: approve with nits. I am putting the two permission-validation items here, since this is the grammar PR. #1892 now stacks on top of this branch and inherits this grammar, so fixing them here fixes them for both. Nits:
|
1be71eb to
f60571f
Compare
|
Follow-up on the two items.
|
|
Re-review (head f60571f) Build, tests, and lint are all green. The slug-length fix is correct and complete. Still open (pre-existing, not claimed in this commit): the Verdict: approve with nits. |
3e21c89 to
9ef21ae
Compare
f60571f to
3cd15ce
Compare
…ncile, reject reserved verbs
8190849 to
adfa630
Compare
What
Plan-time validation for a permission's verb and
service/resourcenamespace was looser than the identifier grammar SpiceDB enforces at apply. An ordinary input planned cleanly and then failed at apply with a 500:id)Read)A permission's verb becomes a SpiceDB relation name directly, and its
service/resourcebecomes a SpiceDB object type name, so both must satisfy SpiceDB's grammar: start with a lowercase letter, lowercase alphanumerics, three to sixty-four characters.This tightens
IsValidPermissionNameandpermissionNamespaceReto that grammar. The no-underscore rule for the namespace parts and the verb is kept, since the slug joins service, resource, and verb with_.Why
RFC 0001 Rules 2 and 3: the file states a desired state that can actually apply, and validation happens before apply. A plan that looks clean must not fail at the server.
Testing
TestIsValidPermissionNameand expandedTestIsValidPermissionNamespacecover the tightened cases.CreatePermissionhandler test fixtures, which used uppercase names SpiceDB would reject.internal/bootstrap/schema,internal/reconcile, andinternal/api/v1beta1connectpass.Stack
Stacked on
fix/reconcile-framework-known-fields.