Refactor/user and tests - #3
Merged
Merged
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.
This pull request refactors the user type used throughout the RBAC (Role-Based Access Control) system to use a new
UserLikeprotocol instead of the concreteUserclass. This improves flexibility by allowing any object with the required attributes (usernameandgroups) to be used as a user, and removes the dependency on theUserclass. The change is applied across the API, decorators, and documentation.User type refactoring:
Introduced the
UserLikeprotocol ine2x_hub_rbac/auth/rbac.py, requiringusernameandgroupsattributes, and refactored all RBAC-related APIs and decorators to useUserLikeinstead of theUserclass. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]Removed the
Userclass definition frome2x_hub_rbac/auth/user.py, eliminating the dependency on Pydantic for user modeling.Documentation updates:
README.mdto useUserLikeor a simple dataclass for users, instead of the oldUserclass. [1] [2] [3] [4]Bug fix:
course_idandterm_idin the context, ensuring correct validation.