runzero.client._http.auth

auth provides authentication helper classes to support bearer and OAuth token usage

Module Contents

Classes

BearerToken

Implements bearer token authentication scheme

OAuthToken

Handles OAuth tokens for the runZero platform

RegisteredAPIClient

Handles the runZero API client registration to retrieve a bearer token

class runzero.client._http.auth.BearerToken(token: str)[source]

Bases: requests.auth.AuthBase

Implements bearer token authentication scheme

class runzero.client._http.auth.OAuthToken[source]

Bases: pydantic.BaseModel

Handles OAuth tokens for the runZero platform

is_expired() bool[source]

Determines if the oauth token is expired or will expire within a minute

Returns:

Returns a bool of whether the token is expired or about to

Return type:

bool

class runzero.client._http.auth.RegisteredAPIClient(client_id: str, client_secret: str)[source]

Bases: requests.auth.AuthBase

Handles the runZero API client registration to retrieve a bearer token

register() Dict[str, str][source]

Uses the provided OAuth credentials to construct the url for requesting the OAuth bearer token.

Returns:

dict containing the required components to be urlencoded for OAuth authentication

Return type:

Dict[str, str]