fix: enforce the table allow-list on request-group query members - #1098
Merged
Merged
Conversation
DefaultRequestGroupService.validatePermission checked a QUERY member's capability and denied columns but never allowed_schemas/allowed_tables, so a group member could reference a table outside the submitter's allow-list. Check it through core.api.AllowedTables with DatasourcePermissionChecker.rejectedTables semantics, on the break-glass path too (standalone break-glass enforces it).
…954dd # Conflicts: # backend/src/main/java/com/bablsoft/accessflow/requestgroups/internal/DefaultRequestGroupService.java
Contributor
Contributor
Backend Code Coverage
|
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.
What
DefaultRequestGroupService.validatePermissionchecked aQUERYmember's capability and its denied columns (#935). It never checked the permission'sallowed_schemas/allowed_tables. Standard submission (DatasourcePermissionVerifier) and standalone break-glass (DefaultBreakGlassService.verifyBreakGlassPermission) both check them. As a result, a request-group member could reference a table outside the submitter's allow-list.Change
verifyDeniedColumnsis replaced byverifyTableAndColumnScope. It checks every referenced table against the allow-list usingcore.api.AllowedTables(normalize+coveringEntry), then runs the existing denied-column check. The rules matchDatasourcePermissionChecker.rejectedTables:RequestGroupPermissionException, which the web layer returns as a localized 403. The group staysDRAFT.QUERY_ADMINpath is unchanged. It still skips the per-datasource gate, as on standard submission.Tests
Six new cases in
DefaultRequestGroupServiceCrudTest:ordersbut notpublic.orders;DefaultRequestGroupService*Testpasses locally (27 tests). The fullmvn verifyhas not been run.Docs
docs/05-backend.md, request-groups "Build-time permission validation": the table-scope rules.docs/07-security.md, permission flow: the allow-list step also binds request-group members.Reviewer notes
verifyTableAndColumnScope.expiresAtitself. I didn't check whetherfindForalready filters out expired grants.