Repository navigation
fix: generate authorization cases using provider role IDs - #129
Merged
n-papaioannou merged 2 commits intoOct 1, 2026
Merged
Conversation
rudycelekli
requested review from
Sebabaian,
dimneo,
n-papaioannou and
stefyi-4355
as code owners
September 28, 2026 03:29
n-papaioannou
approved these changes
Oct 1, 2026
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
generate_test_cases()looked up permissions only byRole.name, then emitted the display name asuser_role. A provider can use a stableRole.role_idin its permission matrix while showing a different name to users. In that case an authorized tool is generated as a B08 deny case instead of a B01 allow case, and the case carries a role key the provider may not recognize. This misstates the audit fixture's access policy.Prefer
role_idwhen the permission matrix contains it; retain display-name fallback for fixtures keyed by name. Use the matched key in generateduser_rolewhile keeping the readable name in the scenario.Reproduction and test plan
Role(name="Administrator", role_id="admin")andPermission(role="admin", tools=["delete_record"])failed on main: it produced B08/deny. It now produces B01/allow withuser_role="admin".python -m pytest ifixai/tests/core/test_discovery_role_permissions.py -q— 2 passed.uvx ruff check ifixai— passed.uvx bandit -r ifixai -ll -q— passed.uv run --python 3.11 ifixai validateand validation of every example fixture — passed (60 inspections).No live provider or scorecard was run; the regression demonstrates the corrected generated case classification.