Authorizer

exception puddle.client.auth.authorizer.AuthError

Bases: Exception

Authentication error.

class puddle.client.auth.authorizer.Authorizer(server_address, request_hook=None, response_hook=None, api_key_id=None, api_secret_key=None)

Bases: object

PUDDLE_API_KEY_ID_ENV_VAR_NAME = 'PUDDLE_API_KEY_ID'

Environment variable from which the api key id is read.

PUDDLE_API_SECRET_KEY_ENV_VAR_NAME = 'PUDDLE_API_SECRET_KEY'

Environment variable from which the api secret key is read.

login()

Executes the login to Puddle.

Return type

LoginResponse

Returns

LoginResponse from backend.

logout()

Logs out from Puddle.

property server_address
Return type

str

Returns

Backend server address used by this Authorizer.

property token
Return type

Optional[str]

Returns

Puddle auth token, might be None.

property user
Return type

Optional[LoginUser]

Returns

Currently logged in user, might be None.