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 AuthorizerLoginManager #1287

Merged
merged 2 commits into from
Oct 27, 2023
Merged

Add AuthorizerLoginManager #1287

merged 2 commits into from
Oct 27, 2023

Conversation

ryanchard
Copy link
Collaborator

@ryanchard ryanchard commented Sep 1, 2023

Description

This PR introduces an AuthorizerLoginManager to create clients from existing tokens.

Previously, if one wanted to create a client from existing tokens they had to implement a custom login manager to serve authorizers as needed.

Type of change

  • New feature (non-breaking change that adds functionality)

Comment on lines +246 to +247
compute_auth = globus_sdk.AccessTokenAuthorizer(tokens[ComputeScopes.resource_server]['access_token'])
openid_auth = globus_sdk.AccessTokenAuthorizer(tokens[AuthScopes.openid]['access_token'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did tokens come from? Is this provided by the user somehow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I originally decided getting tokens was out of scope, but I think it'd be useful to have more examples of things like this, so I'll add it.

Copy link
Contributor

Choose a reason for hiding this comment

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

After our talk, I'm clearer now on the intended use-case for this class; what might helpful is an example or two of where the tokens object may have come, and perhaps a little surrounding context for where this might be utilized. In particular, the "aha!" moment for me was when I finally understood this is intended for 3rd-party use of a token, so you might describe one or two example setups that motivate the need for/use of this class. At which point, the tokens might be renamed to token_from_client or user_auth_tokens_from_request, or "something better than what I just blurted out."

ryanchard and others added 2 commits October 26, 2023 16:58
Add a commonly requested class.  Documented expected use, and with unit tests.

[sc-24329]
@khk-globus khk-globus force-pushed the add_token_login_manager branch from fb316c7 to 9be13dd Compare October 26, 2023 20:59
Copy link
Contributor

@khk-globus khk-globus left a comment

Choose a reason for hiding this comment

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

It's been a long road ... but we got there! 🥳

@ryanchard ryanchard merged commit 8f5b590 into main Oct 27, 2023
31 checks passed
@ryanchard ryanchard deleted the add_token_login_manager branch October 27, 2023 00:09
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