v3.45.0
Added
-
The scope builder for
SpecificFlowClient
is now available for direct access and use viaglobus_sdk.scopes.SpecificFlowScopeBuilder
. Callers can initialize this class with aflow_id
to get a scope builder for a specific flow, e.g.,SpecificFlowScopeBuilder(flow_id).user
.SpecificFlowClient
now uses this class internally. (#1030) -
TransferClient.add_app_data_access_scope
now accepts iterables of collection IDs as an alternative to individual collection IDs. (#1034)
Experimental
-
Added
login(...)
,logout(...)
, andlogin_required(...)
to the experimentalGlobusApp
construct. (#1041)-
login(...)
initiates a login flow if:- the current entity requires a login to satisfy local scope requirements or
auth_params
/force=True
is passed to the method.
-
logout(...)
remove and revokes the current entity's app-associated tokens. -
login_required(...)
returns a boolean indicating whether the app believes
a login is required to satisfy local scope requirements.
-
Removed
Experimental
-
Made
run_login_flow
private in the experimentalGlobusApp
construct. Usage sites should be replaced with eitherapp.login()
orapp.login(force=True)
. (#1041)-
Old Usage
app = UserApp("my-app", client_id="<my-client-id>") app.run_login_flow()
-
New Usage
app = UserApp("my-app", client_id="<my-client-id>") app.login(force=True)
-
Changed
-
The client for Globus Timers has been renamed to
TimersClient
. The prior name,TimerClient
, has been retained as an alias. (#1032)-
Similarly, the error and scopes classes have been renamed and aliased:
TimersAPIError
replacesTimerAPIError
andTimersScopes
replacesTimerScopes
. -
Internal module names have been changed to
timers
fromtimer
where possible. -
The
service_name
attribute is left astimer
for now, as it is integrated into URL and_testing
logic.
-
Experimental
-
The experimental
TokenStorageProvider
andLoginFlowManagerProvider
protocols have been updated to require keyword-only arguments for theirfor_globus_app
methods. This protects against potential ordering confusion for their arguments. (#1028) -
The
default_scope_requirements
forglobus_sdk.FlowsClient
has been updated to list the Flowsall
scope. (#1029) -
The
CommandLineLoginFlowManager
now exposesprint_authorize_url
andprompt_for_code
as methods, which replace thelogin_prompt
andcode_prompt
parameters. Users who wish to customize prompting behavior now have a greater degree of control, and can effect this by subclassing theCommandLineLoginFlowManager
. (#1039)Example usage, which uses the popular
click
library to handle the prompts:import click from globus_sdk.experimental.login_flow_manager import CommandLineLoginFlowManager class ClickLoginFlowManager(CommandLineLoginFlowManager): def print_authorize_url(self, authorize_url: str) -> None: click.echo(click.style("Login here for a code:", fg="yellow")) click.echo(authorize_url) def prompt_for_code(self) -> str: return click.prompt("Enter the code here:")
-
GlobusApp.token_storage
is now a public property, allowing users direct access to theValidatingTokenStorage
used by the app to build authorizers. (#1040) -
The experimental
GlobusApp
construct's scope exploration interface has changed fromapp.get_scope_requirements(resource_server: str) -> tuple[Scope]
toapp.scope_requirements
. The new property will return a deep copy of the internal requirements dictionary mapping resource server to a list of Scopes. (#1042)
Deprecated
TimerScopes
is now a deprecated name. UseTimersScopes
instead. (#1032)
Fixed
Experimental
- Container types in
GlobusApp
function argument annotations are now generally covariant collections likeMapping
rather than invariant types likedict
. (#1035)
Documentation
- The Globus Timers examples have been significantly enhanced and now leverage more modern usage patterns. (#1032)