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

vdk-control-api-auth: vdk credentials cache refactoring #2606

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

antoniivanov
Copy link
Collaborator

This is refactoring the credentials cache storage system to make it more reusable . Particulary I want to reuse it to get corrected authenticated user in telemetry later.

  • We are providing explcit interface for credentials cache intead of using Union of classes
  • Implement SingletonInMemoryCredentials cache to enable different parts of the program to easily access and reuse the same credentials.
  • Added method read_cached_access_token_only and use it in get_authenticated_username() to make it easier to record user using vdk even if his token has expired.
  • Default credentials_cache to LocalFolderCredentialsCache which is more commonly used.
  • Deprecate cache_locally in favour of explicitly passing the credential cache instance, this is better design pattern.

This is refactoring the credentials cache storage system to make it more
reusable . Particulary I want to reuse it to get corrected authenticated
user in telemetry later.

- We are providing explcit interface for credentials cache intead of
using Union of classes
- Implement SingletonInMemoryCredentials cache to enable different parts
of the program to easily access and reuse the same credentials.
- Added method read_cached_access_token_only and use it in
get_authenticated_username() to make it easier to record user using vdk
even if his token has expired.
- Default credentials_cache to LocalFolderCredentialsCache which is more
commonly used.
- Deprecate cache_locally in favour of explicitly passing the credential
cache instance, this is better design pattern.
@antoniivanov antoniivanov force-pushed the person/aivanov/vdk-control-api-auth branch from 5650d18 to dbaeb8d Compare August 25, 2023 10:56
@antoniivanov antoniivanov merged commit c26c7cc into main Aug 25, 2023
@antoniivanov antoniivanov deleted the person/aivanov/vdk-control-api-auth branch August 25, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants