GafaelfawrStorage#
- class mobu.storage.gafaelfawr.GafaelfawrStorage(http_client, logger)#
Bases:
object
Manage users and authentication tokens.
mobu uses bot users to run its tests. Those users may be pre-existing or manufactured on the fly by mobu. Either way, mobu creates new service tokens for the configured users, and then provides those usernames and tokens to monkeys to use for executing their business.
This class handles the call to Gafaelfawr to create the service token.
- Parameters:
http_client (
AsyncClient
) – Shared HTTP client.logger (
BoundLogger
) – Logger to use.
Methods Summary
create_service_token
(user, scopes)Create a service token for a user.
Methods Documentation
- async create_service_token(user, scopes)#
Create a service token for a user.
- Parameters:
- Returns:
Authenticated user with their metadata, scopes, and token.
- Return type:
- Raises:
GafaelfawrParseError – Raised if the input or output data for Gafaelfawr’s token call could not be parsed.
GafaelfawrWebError – Raised if an HTTP protocol error occurred talking to Gafaelfawr.