feat: add examples for RBAC combined with ABAC context rules#525
Open
AlabLan wants to merge 4 commits into
Open
feat: add examples for RBAC combined with ABAC context rules#525AlabLan wants to merge 4 commits into
AlabLan wants to merge 4 commits into
Conversation
Add model, policy and request example files demonstrating how context-based ABAC rules can be layered on top of RBAC roles in a single combined model.
Member
|
@AlabLan you should add go test |
Add coverage for examples/rbac_with_abac_rule_model.conf in AbacAPIUnitTest#testRBACWithABACRule, verifying that the combined RBAC + ABAC context rule model correctly enforces allow/deny based on request context (minor, network, RiskStatus) alongside role inheritance and wildcard actions.
Contributor
Author
|
@hsluoyz I have already added the corresponding test code. Later, I will add the test code for the Go repository. Here is the link to the online editor: https://editor.casbin.org/#EN25Q5ZZC |
Add coverage for examples/rbac_with_abac_rule_model.conf in AbacAPIUnitTest#testRBACWithABACRule, ported from casbin Go's rbac_with_abac_rule_test.go so the two suites stay assertion-compatible (13 enforce calls with matching sub/obj/act/ctx/res tuples, plus matching helper names: makeRBACABACCtx and testRBACWithABACRuleEnforce, the latter promoted to TestUtil alongside testEnforce / testEnforceWithContext). Also remove examples/rbac_with_abac_rule_request_example.csv from both repos. The file was unused (zero references in either codebase) and the only request_example of its kind, so it served no documentation or fixture role.
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.
Add model, policy and request example files demonstrating how context-based ABAC rules can be layered on top of RBAC roles in a single combined model.