Repository navigation
bug(ross): #252: disallow wildcards in apis route roles - #259
Open
imdeepmind wants to merge 1 commit into
Open
imdeepmind wants to merge 1 commit into
imdeepmind wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #252
Restricts RBAC wildcard patterns (
*andprefix:*) strictly to role inheritance definitions (rbac.roles.<role>.includes) and disallows them in route policy role requirements (apis.<key>.roles).Changes
ross/src/validators/config/validate-rbac.ts: Reject*andprefix:*inapis.<key>.roleswith a clear validation error on startup.ross/src/lib/config/api.ts: RemoveexpandWildcardsfromresolveApiPolicyand constructrolesdirectly asnew Set(rawRoles).ross/src/lib/server/prevalidation.ts: RemoveexpandWildcardsfrombuildPreValidationwhen normalizing arrayroles.validate-rbac.test.ts,api.test.ts,prevalidation.test.ts,rbac-enforcement.test.ts,full.json,full.resolved.json, ande2e/rbac.spec.tsto use concrete roles and verify wildcard rejection.Verification
./dev.sh ross check:118test files,2136tests passed (plus compile and lint).npm run test:e2e -- e2e/rbac.spec.ts(inross/):52 passed.