Releases: globus/globus-sdk-python
v3.51.0
Added
-
Most client classes now have their
__doc__attribute modified at runtime to provide betterhelp()and sphinx documentation. (#1131) -
Introduce
globus_sdk.IDTokenDecoder, which implementsid_tokendecoding. (#1136)-
For integration with
GlobusApp, a new builder protocol is defined,IDTokenDecoderProvider. This defines instantiation within the context of an app. -
When
OAuthTokenResponse.decode_id_tokenis called, it now internally instantiates anIDTokenDecoderand uses it to perform the decode. -
IDTokenDecoderobjects cache OpenID configuration data and JWKs after looking them up. If a decoder is used multiple times, it will reuse the cached data. -
Token storage constructs can now contain an
IDTokenDecoderin theirid_token_decoderattribute. The decoder is used preferentially when trying to read thesubfield from anid_tokento store. -
GlobusAppConfigcan now containid_token_decoder, anIDTokenDecoderorIDTokenDecoderProvider. The default isIDTokenDecoder. -
GlobusAppinitialization will now use the config'sid_token_decoderand attach theIDTokenDecoderto the token storage which is used.
-
-
ConnectorTablehas a new classmethod,extendwhich allows users to add new connectors to the mapping.ConnectorTable.extend()returns a new connector table subclass and does not modify the original. (#1021) -
Add
ComputeClientV3.register_function()method. (#1142)
Changed
- The SDK now defaults JWT leeway to 300 seconds when decoding
id_token\s; the previous leeway was 0.5 seconds. Users should find that they are much less prone to validation errors when working in VMs or other scenarios which can cause significant clock drift. (#1135)
v3.50.0
Added
- Subclasses of
BaseClientmay now specifybase_urlas class attribute. (#1125)
Fixed
-
Fixed an incorrect URL path in
ComputeClient.get_task_batch. (#1117) -
Fix a bug in
StorageGatewayDocumentwhich stored anyallowed_domainsargument under an"allow_domains"key instead of the correct key,"allowed_domains". (#1120)
Documentation
- Updated GlobusAppConfig docs to explain how to disable auto-login. (#1127)
v3.49.0
Added
-
Add
filter_entity_typekeyword argument onTransferClient.endpoint_search(). (#1109) -
Added the
ComputeClientV3.register_endpoint(),ComputeClientV3.update_endpoint(),ComputeClientV3.lock_endpoint(), andComputeClientV3.get_endpoint_allowlist()methods. (#1113) -
Added the
ComputeClientV2.get_version()andComputeClientV2.get_result_amqp_url()methods. (#1114)
v3.48.0
Fixed
- Fixed a bug that would cause
ClientApptoken refreshes to fail. (#1111)
Added
- Added the
ComputeClientV2.register_endpoint(),ComputeClientV2.get_endpoint()
ComputeClientV2.get_endpoint_status(),ComputeClientV2.get_endpoints(),
ComputeClientV2.delete_endpoint(), andComputeClientV2.lock_endpoint()
methods. (#1110)
Changed
- Removed identity ID consistency validation from
ClientApp. (#1111)
v3.47.0
Added
-
Add
TimersClient.add_app_transfer_data_access_scopeforTimersClient
instances which are integrated withGlobusApp. This method registers the
nested scope dependency for adata_accessrequirement for a transfer
timer. (#1074) -
SearchQueryV1is a new class for submitting complex queries replacing
the legacySearchQueryclass. A deprecation warning has been added to the
SearchQueryclass. (#1079) -
Created
ComputeClientV2andComputeClientV3classes to support Globus Compute
API versions 2 and 3, respectively. The canonicalComputeClientis now a subclass
ofComputeClientV2, preserving backward compatibility. (#1096) -
Added the
ComputeClientV3.submit(),ComputeClientV2.submit(),
ComputeClientV2.get_task(),ComputeClientV2.get_task_batch(),
andComputeClientV2.get_task_group()methods. (#1094)
Changed
- Improved error messaging around EOF errors when prompting for code during a command
line login flow (#1093)
Deprecated
- Deprecated the
ComputeFunctionDocumentandComputeFunctionMetadataclasses.
This change reflects an early design adjustment to better align with the existing
Globus Compute SDK. (#1092)
Development
v3.46.0
Python Support
- Support Python 3.13. (#1058)
Added
-
Added an initial Globus Compute client class,
globus_sdk.ComputeClient. (#1071)-
Application errors are raised as a
globus_sdk.ComputeAPIError. -
A single method,
ComputeClient.get_functionis included initially to get
information about a registered function. -
Compute scopes are defined at
globus_sdk.scopes.ComputeScopesor
globus_sdk.ComputeClient.scopes.
-
-
Added the
ComputeClient.register_function()andComputeClient.delete_function()methods. (#1085)ComputeClient.register_function()introduces new data model classes:
ComputeFunctionDocumentandComputeFunctionMetadata.
-
Added the
TransferClient.set_subscription_id()method. (#1073) -
Added a new error type,
globus_sdk.ValidationError, used in certain cases ofValueError\s caused by invalid content. (#1044)
Removed
- Removed the
skip_error_handlingoptional kwarg from theGlobusApp.get_authorizer(...)method interface. (#1060)
Changed
-
All previously experimental modules have been moved into main module namespaces and are no longer experimental. Aliases will remain in the experimental namespaces with a deprecation warning until SDKv4.
-
Globus Auth Requirement Errors (GAREs) have been moved from
globus_sdk.experimental.auth_requirements_errortoglobus_sdk.gare. (#1048)-
The primary document type has been renamed from
GlobusAuthRequirementsErrortoGARE. -
The functions provided by this interface have been renamed to use
garein their naming:to_gare,is_gare,has_gares, andto_gares.
-
-
GlobusApps have been moved from
globus_sdk.experimental.globus_apptoglobus_sdkandglobus_sdk.globus_app. (#1085) -
LoginFlowManagers have been moved from
globus_sdk.experimental.login_flow_managerstoglobus_sdk.login_flows. (#1057) -
TokenStorages have been moved from
globus_sdk.experimental.tokenstoragetoglobus_sdk.tokenstorage. (#1065) -
Consents have been moved from
globus_sdk.experimental.consentstoglobus_sdk.scopes.consents. (#1047)
-
-
The response classes for OAuth2 token grants now vary by the grant type. For example, a
refresh_token-type grant now produces aglobus_sdk.OAuthRefreshTokenResponse. This allows code handling responses to more easily identify which grant type produced a response. (#1051)-
The following new classes have been introduced:
globus_sdk.OAuthRefreshTokenResponse,globus_sdk.OAuthAuthorizationCodeResponse, andglobus_sdk.OAuthClientCredentialsResponse. -
The
RenewingAuthorizerclass is now a generic over the response type which it handles, and the subtypes of authorizers are specialized for their types of responses. e.g.,class RefreshTokenAuthorizer(RenewingAuthorizer[OAuthRefreshTokenResponse]).
-
-
The mechanisms of token data validation inside of
GlobusAppare now more modular and extensible. TheValidatingTokenStorageclass does not define built-in validation behaviors, but instead contains a list of validator objects, which can be extended and otherwise altered. (#1061)- These changes allow more validation criteria around token data to be handled within the
ValidatingTokenStorage. This changes error behaviors to avoid situations in which multiple errors are raised serially by different layers of GlobusApp.
- These changes allow more validation criteria around token data to be handled within the
-
LoginFlowManagers built withGlobusAppnow generate a more appropriate value forprefill_named_grant, using the current hostname if possible. (#1075) -
Imports of
globus_sdk.excnow defer importingrequestsso as to reduce import-time performance impact the library is not needed. (#1044)The following error classes are now lazily loaded even when
globus_sdk.excis imported:GlobusConnectionError,GlobusConnectionTimeoutError,GlobusTimeoutError, andNetworkError.
Fixed
-
Fixed the typing-time attributes of
globus_sdkso thatmypyand other type checkers won't erroneously suppress errors about missing attributes. (#1052) -
Fixed the handling of Dependent Token and Refresh Token responses in
TokenStorageandValidatingTokenStoragesuch thatid_tokenis only parsed when appropriate. (#1055) -
Fixed a bug where upgrading from access token to refresh token mode in a
GlobusAppcould result in multiple login prompts. (#1060)
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)