Add OAuth2 refactoring and refresh token #7
Merged
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.
Features and Improvements
Integration of OAuth2 Token Validation and Refresh Logic:
ApiClientstruct.validate_and_refresh_oauth2_tokenchecks the current time against the token's expiration time and refreshes the token usingoauth2_refresh_tokenif necessary.Enhanced
get_oauth2_tokenMethod:validate_and_refresh_oauth2_tokento ensure that a valid token is always returned to the caller.Centralized OAuth2 Client Creation:
create_oauth2_clientwithinAuthto return a properly configured OAuth2 client.Structured Token Management:
OAuth2Tokenstruct to encapsulate access token information, including the access token, refresh token, and expiration time.New Scopes Management:
OAuth2Scopesstruct to manage and return all necessary OAuth2 scopes in a structured manner, allowing for cleaner additions and modifications to required scopes.Bug Fixes
Error Handling and Reporting:
Fixed Refresh Token Management:
Additional Changes
Updated Testing Logic:
Code Refactoring:
ApiClientandAuthmodules, improving readability and maintainability.Development Environment
launch.jsonconfiguration file for the VS Code environment to facilitate easier debugging of the application, specifically for the use of the LLDB debugger.