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

add AuthorizerFactory and implementations #985

Merged
merged 3 commits into from
May 30, 2024
Merged

Conversation

aaschaer
Copy link
Contributor

@aaschaer aaschaer commented May 17, 2024

Shortcut: https://app.shortcut.com/globus/story/30767/sdk-authorizerfactory

Change Summary (all in experimental):

  • adds AuthorizerFactory an interface for getting authorizers from a ValidatingTokenStorage
  • adds AccessTokenAuthorizerFactory, RefreshTokenAuthorizerFactory, and ClientCredentialsAuthorizerFactory which implement AuthorizerFactory and create AccessTokenAuthorizer RefreshTokenAuthorizer and ClientCredentialsAuthorizer respectively

📚 Documentation preview 📚: https://globus-sdk-python--985.org.readthedocs.build/en/985/

…orizerFactory, and ClientCredentialsAuthorizerFactory

return token_data

def store_token_response(self, token_res: OAuthTokenResponse) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the callers for this method?

I'm noticing that the renewing authorizers bypass it (presumably, so that they don't blow the cache), so I'm guessing this is used as part of login flows.

Can we distinguish the name from the token storage method, so that the two are not likely to be confused?

Copy link
Contributor Author

@aaschaer aaschaer May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably only be called by a GlobusApp after its had a user complete a login flow (or someone trying to do GlobusApp like things on their own)

store_token_response_and_clear_cache seems reasonable to me?

@aaschaer aaschaer merged commit 449a5a7 into main May 30, 2024
29 checks passed
@aaschaer aaschaer deleted the authorizer_factory branch May 30, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants