Skip to content

proxystore.globus.scopes

Build Globus Auth scopes.

ProxyStoreRelayScopes module-attribute

ProxyStoreRelayScopes = ScopeBuilder(
    "ebd5bbed-95e2-47cf-9c80-39e2064274bd",
    known_url_scopes=["relay_all"],
)

ProxyStore Relay Server scopes.

Supported Scopes:

  • relay_all

get_all_scopes_by_resource_server

get_all_scopes_by_resource_server(
    collections: Iterable[str] = (),
) -> dict[str, list[str]]

Get all scopes needed by the ProxyStore library by resource server.

This returns scopes for three resource servers: Globus Auth, Globus Transfer, and the ProxyStore Relay Server.

Parameters:

Source code in proxystore/globus/scopes.py
def get_all_scopes_by_resource_server(
    collections: Iterable[str] = (),
) -> dict[str, list[str]]:
    """Get all scopes needed by the ProxyStore library by resource server.

    This returns scopes for three resource servers: Globus Auth, Globus
    Transfer, and the ProxyStore Relay Server.

    Args:
        collections: Iterable of collection UUIDs to request consent for.
            Passed to
            [`get_transfer_scopes_by_resource_server`][proxystore.globus.scopes.get_transfer_scopes_by_resource_server].
    """
    return {
        **get_auth_scopes_by_resource_server(),
        **get_relay_scopes_by_resource_server(),
        **get_transfer_scopes_by_resource_server(collections),
    }

get_auth_scopes_by_resource_server

get_auth_scopes_by_resource_server() -> (
    dict[str, list[str]]
)

Get basic scopes for the auth API resource server.

Source code in proxystore/globus/scopes.py
def get_auth_scopes_by_resource_server() -> dict[str, list[str]]:
    """Get basic scopes for the auth API resource server."""
    return {AuthScopes.resource_server: [AuthScopes.openid, AuthScopes.email]}

get_relay_scopes_by_resource_server

get_relay_scopes_by_resource_server() -> (
    dict[str, list[str]]
)

Get all scopes for the relay server by resource server.

Source code in proxystore/globus/scopes.py
def get_relay_scopes_by_resource_server() -> dict[str, list[str]]:
    """Get all scopes for the relay server by resource server."""
    return {
        ProxyStoreRelayScopes.resource_server: [
            ProxyStoreRelayScopes.relay_all,
        ],
    }

get_transfer_scopes_by_resource_server

get_transfer_scopes_by_resource_server(
    collections: Iterable[str] = (),
) -> dict[str, list[str]]

Get scopes for the transfer API resource server.

Parameters:

  • collections (Iterable[str], default: () ) –

    Iterable of collection UUIDs to request consent for.

Source code in proxystore/globus/scopes.py
def get_transfer_scopes_by_resource_server(
    collections: Iterable[str] = (),
) -> dict[str, list[str]]:
    """Get scopes for the transfer API resource server.

    Args:
        collections: Iterable of collection UUIDs to request consent for.
    """
    transfer_scope = TransferScopes.make_mutable('all')

    for collection in collections:
        data_access_scope = GCSCollectionScopeBuilder(collection).make_mutable(
            'data_access',
        )
        transfer_scope.add_dependency(data_access_scope)

    return {TransferScopes.resource_server: [str(transfer_scope)]}