benchling_sdk.auth.bearer_token_auth module¶

class BearerTokenAuth¶

Bases: benchling_api_client.v2.benchling_client.AuthorizationMethod

Bearer Token Authorization.

Use in combination with the Benchling() client constructor to be authorized with Bearer Token Authorization

__init__(token_function: BearerTokenProvider) → None¶

Init BearerTokenAuth with a callable BearerTokenProvider for providing bearer tokens.

classmethod from_token(bearer_token: str) → BearerTokenAuth¶

Create a BearerTokenAuth that always uses a static bearer token string.

get_authorization_header(base_url: str) → str¶

Get content for a HTTP Authorization header.

class BearerTokenProvider¶

Bases: Protocol

A callable function for providing a bearer token.

__init__(*args, **kwargs)¶