Skip to content
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 43 commits into from
Jun 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c9b0a83
Refactors the Authenticator, and RequestBuilder class
isFakeAccount May 27, 2024
7f2d012
Fixes a circular import
isFakeAccount May 27, 2024
40b7133
Removes the refresh token warn logic because of added complexity
isFakeAccount May 28, 2024
054987f
Fixes the OAuth Method in Authentication
isFakeAccount May 28, 2024
99622a1
Changes the check to is None Check for explicitness
isFakeAccount May 28, 2024
f07907b
Removes unnecessary variable
isFakeAccount May 28, 2024
829ce61
Refactor header keys in RequestBuilderHeaders
isFakeAccount May 28, 2024
a548918
Fixes a bug in authenticator
isFakeAccount Jun 2, 2024
e15d320
Separates out licenses into several files
isFakeAccount Jun 2, 2024
87883d5
Updates docstformat
isFakeAccount Jun 2, 2024
d25e909
Updates docstring to correct format
isFakeAccount Jun 2, 2024
93d54c6
Refactor trophy group model and summary classes, add new methods for …
isFakeAccount Jun 2, 2024
a952858
Added a description for EarnedTrophyGroupSummary class.
isFakeAccount Jun 2, 2024
12fc462
Refactor TrophySummary to use dataclass & Authenticator for API requests
isFakeAccount Jun 2, 2024
174f646
Removes redundant type hints in Pagination Iterator
isFakeAccount Jun 3, 2024
3c20607
Add trophy-related model imports to init file
isFakeAccount Jun 3, 2024
67ffa4a
Refactors TrophyTitles for improved pagination handling
isFakeAccount Jun 3, 2024
a49b804
Update type imports in authenticator.py
isFakeAccount Jun 3, 2024
6864f1a
Update type imports in pagination_iterator.py
isFakeAccount Jun 3, 2024
9661a76
Updates imports and fixed and type bug
isFakeAccount Jun 3, 2024
9afbac2
Refactor imports for better type hinting and readability.
isFakeAccount Jun 3, 2024
58ec389
Documents an invariant of class in docstring
isFakeAccount Jun 8, 2024
47ea7d4
Adds Docstring, changes class name, and adds TYPE_CHECKING
isFakeAccount Jun 9, 2024
7c37c5c
Updates imports and __all__ list
isFakeAccount Jun 9, 2024
d9e431f
Removes unused fields from TrophyTitle
isFakeAccount Jun 9, 2024
bd43b95
Rewrites Trophy Class and uses PaginationIterator for Iterating
isFakeAccount Jun 9, 2024
c95adf8
Changes class name EarnedTrophySummary to TrophyGroupSummaryWithProgress
isFakeAccount Jun 9, 2024
148edc1
Reorder TrophyGroup imports for consistency
isFakeAccount Jun 9, 2024
b5e3aa0
Refactors User class to use new Classes and Methods
isFakeAccount Jun 9, 2024
f427fdf
Refactors User and Client to use the the Trophy and Authentication Class
isFakeAccount Jun 9, 2024
d324e3b
Updates doc string and organizes imports
isFakeAccount Jun 9, 2024
5aa9cc7
Refactor game title model for improved trophy handling & authentication.
isFakeAccount Jun 9, 2024
ecb4920
Update Authenticator parameter description in User class methods
isFakeAccount Jun 9, 2024
5439815
Adds patch and delete methods
isFakeAccount Jun 9, 2024
44486ce
Refactors Group class for type hints and method structure
isFakeAccount Jun 9, 2024
5411261
Refectored PSNAWP to use Authenticator instead of RequestBuilder
isFakeAccount Jun 9, 2024
1c520ec
FIxes issues discovered during testing
isFakeAccount Jun 15, 2024
002c778
Restructures all the Tests
isFakeAccount Jun 15, 2024
6742a9c
Implements GraphQL endpoint for the Search Class
isFakeAccount Jun 16, 2024
dcafa9d
Update filter_headers and filter_query_parameters in integration tests.
isFakeAccount Jun 16, 2024
bc98ea1
Updates pytest workflow to run pytest with pre_push
isFakeAccount Jun 16, 2024
4e4450e
Switches VCRPy Serializer from yaml to json
isFakeAccount Jun 16, 2024
8a11855
Updates code_coverage workflow to run on push to master and PR approval
isFakeAccount Jun 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update type imports in authenticator.py
- Added TYPE_CHECKING import for conditional type hinting
- Moved types imports RequestBuilderHeaders and RequestOptions to TYPE_CHECKING
  • Loading branch information
isFakeAccount committed Jun 3, 2024
commit a49b804dd249f2d7cca03d08906c7b34bd6acef4
7 changes: 5 additions & 2 deletions src/psnawp_api/core/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
import uuid
from functools import wraps
from logging import getLogger
from typing import Callable, NotRequired, Optional, TypedDict, TypeVar, cast
from typing import TYPE_CHECKING, Callable, NotRequired, Optional, TypedDict, TypeVar, cast
from urllib.parse import parse_qs, urlparse

from requests import Response
from typing_extensions import ParamSpec, Unpack

from psnawp_api.core.psnawp_exceptions import PSNAWPAuthenticationError
from psnawp_api.core.request_builder import RequestBuilder, RequestBuilderHeaders, RequestOptions
from psnawp_api.core.request_builder import RequestBuilder
from psnawp_api.utils import API_PATH, BASE_PATH

if TYPE_CHECKING:
from psnawp_api.core.request_builder import RequestBuilderHeaders, RequestOptions

PT = ParamSpec("PT")
RT = TypeVar("RT")

Expand Down