feat: Implement initial classes for authentication system and tests - #5
Merged
Conversation
Code Coverage OverviewLanguages: Python Python / code-coverage/pytestThe overall coverage in commit 460d4b8 in the Show a code coverage summary of the most impacted files.
Updated |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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 introduces a comprehensive authentication and authorization system to Pyrannic, including new core classes, configuration structures, and documentation. The main changes are the addition of guards, user providers, and authorization mechanisms (gates and policies), as well as updates to the documentation and public API.
Authentication System
BaseGuardandBearerGuardclasses to handle authentication logic and HTTP Bearer token authentication, respectively. [1] [2]GuardsConfigandUserProvidersConfigfor customizable authentication drivers and user providers. [1] [2]Authenticatablebase class for user entities.Authorization System
GateandAuthorizableclasses to provide flexible authorization checks using gates and policies, including support for defining abilities and policies, and model-based authorization. [1] [2]Responseclass to standardize authorization outcomes and exception handling.ForbiddenExceptionandUnauthorizedExceptionfor consistent error signaling.Public API and Integration
pyrannic/__init__.pyto expose new authentication and authorization classes as part of the public API.pyrannic/auth/__init__.pyto facilitate easier access to new classes.Documentation
mkdocs.ymlnavigation to include new security documentation sections.These changes lay the groundwork for robust, extensible authentication and authorization in Pyrannic, with clear documentation and configuration options for end users.