Open
Conversation
Fix 3 pre-existing pyright type errors in the RBAC subsystem: - registry.py: `visited: Set[str] = None` → `Optional[Set[str]]` - jwt_parser.py: `original_roles: List[str] = None` → `Optional[List[str]]` - decorators.py: 8 call sites passing `request.endpoint` (Optional[str]) to `log_permission_check(endpoint: str)` — use fallback `or '<unknown>'` Add 46 unit tests across 5 new test files covering: - RBACRegistry: permission resolution, inheritance, wildcards, config validation (circular/empty/undefined), filter_valid_roles, properties - Permissions: has_permission, is_admin, is_expert with explicit roles - Audit: log_authentication_event, log_permission_check, log_role_assignment levels and structured output - JWT Parser: extract_roles_from_token (resource_access, fallback, edge cases), get_user_roles with default fallback - Decorators: require_permission, require_any_permission, check_sso_required via Flask test client Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
swinney
pushed a commit
to fasrc/archi
that referenced
this pull request
Apr 14, 2026
Fix 3 pre-existing pyright type errors and add 46 unit tests for the RBAC subsystem. See archi-physics#552, archi-physics#553. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Fixes #552
registry.py,jwt_parser.py, anddecorators.pysrc/utils/rbac/andtests/unit/test_rbac_*— no functional behavior changesChanges
Type Fixes (3 files, 10 line changes)
registry.py:148_resolve_permissionsSet[str] = None→Optional[Set[str]] = Nonejwt_parser.py:158assign_default_roleList[str] = None→Optional[List[str]] = Nonedecorators.pyrequest.endpoint→request.endpoint or '<unknown>'New Tests (5 files, 655 lines, 46 tests)
test_rbac_registry.pytest_rbac_permissions.pyhas_permission,is_admin,is_expertwith explicit rolestest_rbac_audit.pytest_rbac_jwt_parser.pyextract_roles_from_token(4 scenarios),get_user_rolesdefault fallbacktest_rbac_decorators.pyrequire_permission,require_any_permission,check_sso_requiredvia Flask test clientTest plan
pyrightreports 0 errors on all 3 modified source filespytest tests/unit/test_rbac_*.py)🤖 Generated with Claude Code