You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes it so that if you print() a OAuthTokenResponse instance, it shows you something different than if you actually tried to access members of the object.
E.g., it shows that there is a top-level transfer.api.globus.org key but in reality this is under other_tokens.
The text was updated successfully, but these errors were encountered:
I tend to agree that it could be confusing. The __str__ here is meant to be informational and extract useful detail from the response, but it drops other fields and the classname.
I still prefer that __str__ shows by_resource_server rather than the other_tokens array. by_resource_server reshapes the data to fit the application model better and converts expires_in to expires_at_seconds (which is subtle but important, as you may want to store response data and reference it later).
I'm going to run an updated variant of this past our team and see what people think.
This makes the str() of an oauth response object more verbose,
clarifying that `by_resource_server` is a field (not the set of
top-level keys) and including mention of `id_token`. The output is
also now more YAML-like, and not just an undecorated JSON dump.
In practice, the `id_token` can be very long, so this implementation
truncates it to the first 10 chars and notes it as `... (truncated)`.
No other fields are added to the stringifier as of yet.
resolvesglobus#639
globus-sdk-python/src/globus_sdk/services/auth/response/oauth.py
Lines 227 to 230 in 836bf59
This makes it so that if you
print()
aOAuthTokenResponse
instance, it shows you something different than if you actually tried to access members of the object.E.g., it shows that there is a top-level
transfer.api.globus.org
key but in reality this is underother_tokens
.The text was updated successfully, but these errors were encountered: