Skip to content

Boto3

obstore.auth.boto3.Boto3CredentialProvider

A CredentialProvider for S3Store that uses boto3.session.Session.

If the provided session has a region_name set, that will be passed down to the store.

__init__

__init__(
    session: Session | Session | None = None,
    *,
    ttl: timedelta = timedelta(minutes=30),
) -> None

Create a new Boto3CredentialProvider.

This will call session.get_credentials to get a botocore.credentials.Credentials object. Each token refresh will call credentials.get_frozen_credentials.

Parameters:

  • session (Session | Session | None, default: None ) –

    A boto3 session to use for providing credentials. Defaults to None, in which case a new boto3.Session will be used.

Other Parameters:

  • ttl (timedelta) –

    The length of time each result from get_frozen_credentials should live. Defaults to timedelta(minutes=30).

__call__

__call__() -> S3Credential

Fetch credentials.

obstore.auth.boto3.StsCredentialProvider

A CredentialProvider for S3Store that uses STS.Client.assume_role.

If the provided session has a region_name set, that will be passed down to the store.

__init__

__init__(
    session: Session | None = None,
    **kwargs: Unpack[AssumeRoleRequestRequestTypeDef],
) -> None

Create a new StsCredentialProvider.

Parameters:

  • session (Session | None, default: None ) –

    A boto3 session to use for providing credentials. Defaults to None, in which case a new boto3.Session will be used.

Other Parameters:

__call__

__call__() -> S3Credential

Fetch credentials.