GlobusApp Configuration¶
Reference¶
Data Model¶
- class globus_sdk.GlobusAppConfig[source]¶
An immutable dataclass used to control the behavior of a
GlobusApp
.- Variables:
request_refresh_tokens (bool) – Whether to request
refresh tokens
(expire after 6 months of no use) or use exclusivelyaccess tokens
(expire 2 hours after issuance). Default:False
.token_storage (str | TokenStorage | TokenStorageProvider) – A class responsible for storing and retrieving tokens. This may be either a well-known provider (one of
"json"
,"sqlite"
, or"memory"
) or a custom storage/provider. Default:"json"
.login_flow_manager (str | LoginFlowManager | LoginFlowManagerProvider) –
A class responsible for overseeing Globus Auth login flows. This may be either be a well-known provider (one of
"command-line"
or"local-server"
) or a custom manager/provider. Default:"command-line"
.Note
login_flow_manager may be ignored when using a
ClientApp
.login_redirect_uri (str | None) –
The destination for Globus Auth to send a user after once completed a login flow. Default:
None
.Note
login_redirect_url may be ignored when using a
NativeAppAuthClient
. Explicit values must be pre-registered on your client here.token_validation_error_handler (TokenValidationErrorHandler) – A handler invoked to resolve errors raised during token validation. Default:
resolve_by_login_flow
(runs a login flow, storing the resulting tokens).environment (str) – The Globus environment of services to interact with. This is mostly used for testing purposes. This may additionally be set with the environment variable GLOBUS_SDK_ENVIRONMENT. Default:
"production"
.
Providers¶
- class globus_sdk.globus_app.TokenStorageProvider[source]¶
A protocol for a factory which can create
TokenStorages
.SDK-provided Token Storages support this protocol.
- classmethod for_globus_app(*, app_name, config, client_id, namespace)[source]¶
Create a
TokenStorage
for use in a GlobusApp.- Parameters:
app_name (str) – The name supplied to the GlobusApp.
config (GlobusAppConfig) – The configuration supplied to the GlobusApp.
client_id (UUIDLike) – The client_id of to the GlobusApp.
namespace (str) – A namespace to use for instantiating a TokenStorage.
- Return type:
- class globus_sdk.globus_app.LoginFlowManagerProvider[source]¶
A protocol for a factory which can create
LoginFlowManagers
.SDK-provided Login Flow Managers support this protocol.
- classmethod for_globus_app(*, app_name, config, login_client)[source]¶
Create a
CommandLineLoginFlowManager
for use in a GlobusApp.- Parameters:
app_name (str) – The name supplied to the GlobusApp.
config (GlobusAppConfig) – The configuration supplied to the GlobusApp.
login_client (AuthLoginClient) – A login client to use for instantiating a LoginFlowManager.
- Return type:
- class globus_sdk.globus_app.TokenValidationErrorHandler[source]¶
A handler invoked when a
TokenValidationError
is raised during a service client call.If this call completes without raising an exception, the service client call will retry once more (subsequent errors will not call this handler).
- __call__(app, error)[source]¶
Resolve a token validation error.
- Parameters:
app (GlobusApp) – The GlobusApp instance which encountered an error.
error (TokenValidationError) – The error which was encountered.