-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentication Rewrite #70
Merged
Merged
Conversation
This file contains 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
- Refactors Authenticator and RequestBuilder class such that Authenticator utilizes the RequestBuilder class for HTTP requests. RequestBuilder also follows single responsibility principle better. - Now Authentication will now throw HTTPError instead will use the PSNAWPExceptions - Adds a few more custom exceptions and now ClientError subclass PSNAWPClientError - Reformats with Contributing Document - Makes the refresh token expiry more flexible. Now users can decide when it should trigger and what callback should be triggered.
- Fixes a circular import
- Removes the refresh token warn logic because of added complexity. It makes more sense for user to do it now that there are methods to get what the want. - Changes param name from default_headers to common_headers to be more clear - Removes create_logger function from __init__.py file in utils - Add logic in header to call methods that will fetch new refresh token whether from
- Fixes the OAuth Method and makes it closer to Android App version - Adds new params to Authorization method as well to bring it closer to how app behaves - Renames auth_properties to better name and add TypeDict to make it more robust
- Changes the check to is None Check for explicitness
Removes unnecessary variable
Remove "Content-Type" key from RequestBuilderHeaders dictionary in request_builder.py.
- FIxes a bug in authenticator where the Authorization wasn't added to kwargs if it didn't have header key - Some minor formatting
- Separates out licenses into several files to it is easier to see all licenses. - Also, github was having some issue with several licenses being in one file.
- Updates docstformat - Updates VSCode project settings for docstring
- Updates docstring to correct format - Adds docstring to missing methods
…object creation and builder class. - Splits the TrophyGroupSummary into TrophyGroupSummary and EarnedTrophyGroupSummary. - Improves the object creation. Instead of everything happening in private function the responsibility is split. - Fixed docstring and improvements in typing by using Generic typing
- Added a description for EarnedTrophyGroupSummary class.
- Refactored TrophySummary class to use dataclass instead of attrs - Updated method signature in TrophySummary class to accept Authenticator object for API requests - Fixes docstring
Removes redundant type hints in Pagination Iterator
Imported trophy-related models in the trophies package to the init file for easier access and organization.
- Added a new method to fetch the next page of trophy titles efficiently. - Updated constructor parameters for better clarity and flexibility. - Enhanced methods to retrieve trophy titles with pagination support.
- Added TYPE_CHECKING import for conditional type hinting - Moved types imports RequestBuilderHeaders and RequestOptions to TYPE_CHECKING
- Updated type import statements for better readability and maintainability.
- Added import for TrophySet in trophies/__init__.py - Updated import statements in trophy_group.py to include TYPE_CHECKING - Fixed TrophyGroupsSummaryBuilder typing issue
- Added `TYPE_CHECKING` condition for improved type hints. - Updated import statements in trophy_summary.py and trophy_titles.py to enhance code clarity.
Added a note in the docstring to specify responsibilities for implementing `fetch_next_page` method.
- Added docstrings to classes and methods for better documentation. - Renamed a class from TitleStatsListing to TitleStatsIterator. - Introduced TYPE_CHECKING for improved type hinting.
Removed total_items_count and rarest_trophies fields. Refactored TrophyTitles to TrophyTitleIterator for clarity and consistency in handling trophy data retrieval.
- Refactored the Trophy class to use dataclass - Added a new class TrophyWithProgress inheriting from Trophy - Implemented PaginationIterator for iterating over trophies with platform-specific handling
Updated the class name from EarnedTrophyGroupSummary to TrophyGroupSummaryWithProgress for clearer representation and functionality.
Changed the order of TrophyGroup imports to maintain consistency in the code structure.
- Refactors User class to use new Classes and Methods like from Trophy and Authentication. - Updated typing imports and method signatures in the User class to use TYPE_CHECKING and Self. - Refactored method parameters and return types for better consistency.
Changed workflow to trigger on push events to the master branch and when PRs are ready for review or closed.
Closed
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.
:raises:
properly.