-
Notifications
You must be signed in to change notification settings - Fork 48
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
Conversation
356b449
to
99b6c3a
Compare
compute_auth = globus_sdk.AccessTokenAuthorizer(tokens[ComputeScopes.resource_server]['access_token']) | ||
openid_auth = globus_sdk.AccessTokenAuthorizer(tokens[AuthScopes.openid]['access_token']) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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."
compute_sdk/globus_compute_sdk/sdk/login_manager/authorizer_login_manager.py
Outdated
Show resolved
Hide resolved
compute_sdk/globus_compute_sdk/sdk/login_manager/authorizer_login_manager.py
Outdated
Show resolved
Hide resolved
compute_sdk/globus_compute_sdk/sdk/login_manager/authorizer_login_manager.py
Outdated
Show resolved
Hide resolved
compute_sdk/globus_compute_sdk/sdk/login_manager/authorizer_login_manager.py
Outdated
Show resolved
Hide resolved
compute_sdk/globus_compute_sdk/sdk/login_manager/authorizer_login_manager.py
Outdated
Show resolved
Hide resolved
Add a commonly requested class. Documented expected use, and with unit tests. [sc-24329]
[sc-24329]
fb316c7
to
9be13dd
Compare
There was a problem hiding this 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! 🥳
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