Releases: globus/globus-sdk-python
Release list
v3.45.0
Added
-
The scope builder for
SpecificFlowClientis now available for direct access and use viaglobus_sdk.scopes.SpecificFlowScopeBuilder. Callers can initialize this class with aflow_idto get a scope builder for a specific flow, e.g.,SpecificFlowScopeBuilder(flow_id).user.SpecificFlowClientnow uses this class internally. (#1030) -
TransferClient.add_app_data_access_scopenow accepts iterables of collection IDs as an alternative to individual collection IDs. (#1034)
Experimental
-
Added
login(...),logout(...), andlogin_required(...)to the experimentalGlobusAppconstruct. (#1041)-
login(...)initiates a login flow if:- the current entity requires a login to satisfy local scope requirements or
auth_params/force=Trueis 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_flowprivate in the experimentalGlobusAppconstruct. 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:
TimersAPIErrorreplacesTimerAPIErrorandTimersScopesreplacesTimerScopes. -
Internal module names have been changed to
timersfromtimerwhere possible. -
The
service_nameattribute is left astimerfor now, as it is integrated into URL and_testinglogic.
-
Experimental
-
The experimental
TokenStorageProviderandLoginFlowManagerProviderprotocols have been updated to require keyword-only arguments for theirfor_globus_appmethods. This protects against potential ordering confusion for their arguments. (#1028) -
The
default_scope_requirementsforglobus_sdk.FlowsClienthas been updated to list the Flowsallscope. (#1029) -
The
CommandLineLoginFlowManagernow exposesprint_authorize_urlandprompt_for_codeas methods, which replace thelogin_promptandcode_promptparameters. 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
clicklibrary 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_storageis now a public property, allowing users direct access to theValidatingTokenStorageused by the app to build authorizers. (#1040) -
The experimental
GlobusAppconstruct'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
TimerScopesis now a deprecated name. UseTimersScopesinstead. (#1032)
Fixed
Experimental
- Container types in
GlobusAppfunction argument annotations are now generally covariant collections likeMappingrather than invariant types likedict. (#1035)
Documentation
- The Globus Timers examples have been significantly enhanced and now leverage more modern usage patterns. (#1032)
v3.44.0
Added
- Added a reference to the new Flows all scope under
globus_sdk.scopes.FlowsScopes.all. (#1016)
Experimental
- Added support for
ScopeCollectionTypeto GlobusApp's__init__and
add_scope_requirementsmethods. (#1020)
Changed
-
Updated
ScopeCollectionTypeto be defined recursively. (#1020) -
TransferClient.add_app_data_access_scopenow raises an error if it is
given an invalid collection ID. (#1022)
Experimental
-
Changed the experimental
GlobusAppclass in the following way (#1017):-
app_nameis no longer required (defaults to "Unnamed Globus App") -
Token storage now defaults to including the client id in the path.
-
Old (unix) :
~/.globus/app/{app_name}/tokens.json -
New (unix):
~/.globus/app/{client_id}/{app_name}/tokens.json -
Old (win):
~\AppData\Local\globus\app\{app_name}\tokens.json -
New (win):
~\AppData\Local\globus\app\{client_id}\{app_name}\tokens.json
-
-
GlobusAppConfig.token_storagenow accepts shorthand string references:
"json"to use aJSONTokenStorage,"sqlite"to use a
SQLiteTokenStorageand"memory"to use aMemoryTokenStorage. -
GlobusAppConfig.token_storagealso now accepts aTokenStorageProvider,
a class with afor_globus_app(...) -> TokenStorageclass method. -
Renamed the experimental
FileTokenStorageattribute.filenameto
.filepath.
-
-
Changed the experimental
GlobusAppclass in the following ways (#1018):-
LoginFlowManagersnow insertGlobusApp.app_nameinto any native
client login flows as theprefill_named_grant. -
GlobusAppConfignow accepts alogin_redirect_uriparameter to specify
the redirect URI for a login flow.-
Invalid when used with a
LocalServerLoginFlowManager. -
Defaults to
"https://auth.globus.org/v2/web/auth-code"for native
client flows. Raises an error if not set for confidential ones.
-
-
UserAppnow allows for the use of confidential client flows with the use of
either aLocalServerLoginFlowManageror a configuredlogin_redirect_uri. -
GlobusAppConfig.login_flow_managernow accepts shorthand string references
"command-line"to use aCommandLineLoginFlowManagerand
"local-server"to use aLocalServerLoginFlowManager. -
GlobusAppConfig.login_flow_manageralso now accepts a
LoginFlowManagerProvider, a class with a
for_globus_app(...) -> LoginFlowManagerclass method.
-
Development
- Added a scope normalization function
globus_sdk.scopes.scopes_to_scope_listto
translate fromScopeCollectionTypeto a list ofScopeobjects.
(#1020)
v3.43.0
Added
- The
TransferClient.task_listmethod now supportsorderbyas a
parameter. (#1011)
Changed
-
The
SQLiteTokenStoragecomponent inglobus_sdk.experimentalhas been
changed in several ways to improve its interface. (#1004)-
:memory:is no longer accepted as a database name. Attempts to use it
will trigger errors directing users to useMemoryTokenStorageinstead. -
Parent directories for a target file are automatically created, and this
behavior is inherited from theFileTokenStoragebase class. (This was
previously a feature only of theJSONTokenStorage.) -
The
config_storagetable has been removed from the generated database
schema, the schema version number has been incremented to2, and
methods and parameters related to manipulation ofconfig_storagehave
been removed.
-
Documentation
-
Added a new experimental "Updated Examples" section which rewrites and reorders
many examples to aid in discovery. (#1008) -
GlobusApp,UserApp, andClientAppclass reference docs. (#1013) -
Added a narrative example titled
Using a GlobusAppdetailing the basics of
constructing and using a GlobusApp. (#1013) -
Remove unwritten example updates from toctree. (#1014)
v3.42.0
Python Support
- Remove support for Python 3.7. (#997)
Added
-
Add
globus_sdk.ConnectorTablewhich provides information on supported Globus Connect Server connectors. This object maps names to IDs and vice versa. (#955) -
Support adding query parameters to
ConfidentialAppAuthClient.oauth2_token_introspectvia aquery_paramsargument. (#984) -
Add
get_gcs_infoas a helper method toGCSClientfor getting information from a Globus Connect Server'sinfoAPI route. -
Add
endpoint_client_idas a property toGCSClient. -
Clients will now emit a
X-Globus-Client-Infoheader which reports the version of theglobus-sdkwhich was used to send a request. Users may customize this header further by modifying theglobus_client_infoobject attached to the transport object. (#990)
Experimental
-
Add a new abstract class,
TokenStorage, toexperimental.TokenStorageexpands the functionality ofStorageAdapterbut is not fully backwards compatible. (#980)FileTokenStorage,JSONTokenStorage,MemoryTokenStorageandSQLiteTokenStorageare new concrete implementations ofTokenStorage.
-
Add
ValidatingStorageAdaptertoexperimental, which validates that identity is maintained and scope requirements are met on token storage/retrieval. (#978, #980) -
Add a new abstract class,
AuthorizerFactorytoexperimental.AuthorizerFactoryprovides an interface for getting aGlobusAuthorizerfrom aValidatingTokenStorage. (#985)AccessTokenAuthorizerFactory,RefreshTokenAuthorizerFactory, andClientCredentialsAuthorizerFactoryare new concrete implementations ofAuthorizerFactory.
-
Add a new abstract class,
GlobusApptoexperimental. AGlobusAppis an abstraction which allows users to define their authorization requirements implicitly and explicitly, attach that state to their various clients, and drive login flows. (#986)-
UserAppandClientAppare new implementations ofGlobusAppwhich handle authentications for user-login and client-credentials. -
GlobusAppConfigis an object which can be used to controlGlobusAppbehaviors.
-
-
Add
appas an optional argument toBaseClientwhich will accept aGlobusAppto handle authentication, token validation, and token storage when using the client. -
Add
default_scope_requirementsas a property toBaseClientfor subclasses to define scopes to automatically be used with aGlobusApp. The default implementation raises aNotImplementedError. -
Add
add_app_scopetoBaseClientas an interface for adding additional scope requirements to itsapp. -
AuthClient,FlowsClient,GCSClient,GroupsClient,SearchClient,TimerClient, andTransferClientall addappas an optional argument and definedefault_scope_requirementsso that they can be used with aGlobusApp. -
Add
add_app_data_access_scopetoTransferClientas an interface for adding a dependent data access scope requirements needed for interacting with standard Globus Connect Server mapped collections to itsapp. -
Auto-login (overridable in config) GlobusApp login retry on token validation error. (#994)
-
Added the configuration parameter
GlobusAppConfig.environment. (#1001)
Changed
-
GCSClientinstances now have a non-Noneresource_serverproperty. -
GlobusAuthorizationParametersno longer enforces that at least one field is set. (#989) -
Improved the validation and checking used inside of
globus_sdk.tokenstorage.SimpleJSONFileAdapterandglobus_sdk.experimental.tokenstorage.JSONTokenStorage. (#997)
Deprecated
GCSClient.connector_id_to_namehas been deprecated. UseConnectorTable.lookupinstead. (#955)
Fixed
Experimental
-
When a
JSONTokenStorageis used, the containing directory will be automatically be created if it doesn't exist. (#998) -
GlobusApp.add_scope_requirementsnow has the side effect of clearing the authorizer cache for any referenced resource servers. (#1000) -
GlobusAuthorizer.scope_requirementswas made private and a new method for accessing scope requirements was added atGlobusAuthorizer.get_scope_requirements. (#1000) -
A
GlobusAppwill now auto-create an Auth consent client for dependent scope evaluation against consents as a part of instantiation. (#1000) -
Fixed a bug where specifying dependent tokens in a new
GlobusAppwould cause the app to infinitely prompt for log in. (#1002) -
Fixed a
GlobusAppbug which would cause LocalServerLoginFlowManager to error on MacOS when versions earlier than Python 3.11. (#1003)
Documentation
- Document how to manage Globus SDK warnings. (#988)
v3.41.0
Added
-
Added a new AuthClient method
get_consentsand supporting local data objects.
These allows a client to poll and interact with the current Globus Auth consent state
of a particular identity rooted at their client. (#971) -
Added
LoginFlowManagerandCommandLineLoginFLowManagerto experimental (#972) -
Added
LocalServerLoginFlowManagerto experimental (#977) -
Added support to
FlowsClientfor thevalidate_flowoperation of the
Globus Flows service. (#979)
v3.40.0
Added
-
Add
globus_sdk.tokenstorage.MemoryAdapterfor the simplest possible in-memory token storage mechanism. (#964) -
ConfidentialAppAuthClient.oauth2_get_dependent_tokensnow supports thescopeparameter as a string or iterable of strings. (#965) -
Moved scope parsing out of experimental. The
Scopeconstruct is now importable from the top levelglobus_sdkmodule. (#966) -
Support updating subscriptions assigned to flows in the Flows service. (#974)
Development
- Fix concurrency problems in the test suite caused by isort's
.isortedtemporary files. (#973)
v3.39.0
v3.38.0
Added
-
IterableGCSResponseandUnpackingGCSResponseare now available as top-level exported names. (#956) -
Add
GroupsClient.get_group_by_subscription_idfor resolving subscriptions to groups. This also expands the_testingdata forget_groupto include a subscription group case. (#957) -
Added
promptto the recognized Globus Authorization Requirements Errorauthorization_parametersfields. (#958)
v3.37.0
Added
- All of the basic HTTP methods of
BaseClientand its derived classes which accept adataparameter for a request body, e.g.TransferClient.postorGroupsClient.put, now allow thedatato be passed in the form of already encodedbytes. (#951)
Fixed
- Update
ensure_datatypeto work with documents that setDATA_TYPEtoMISSINGinstead of omitting it (#952)
v3.36.0
Added
-
Added support for GCS endpoint get & update operations. (#933)
gcs_client.get_endpoint()gcs_client.update_endpoint(EndpointDocument(...))
-
TransferClient.endpoint_manager_task_list()now supportsfilter_endpoint_useas a parameter. (#948) -
FlowsClient.create_flownow supportssubscription_idas a parameter. (#949)