GafaelfawrStorage#

class mobu.storage.gafaelfawr.GafaelfawrStorage(config, gafaelfawr_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:

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:
  • user (User) – Metadata for the user. If uid or gid are set for the user, they will be stored with the token and override Gafaelfawr’s normal user metadata source.

  • scopes (list[str]) – Scopes the requested token should have.

Returns:

Authenticated user with their metadata, scopes, and token.

Return type:

AuthenticatedUser

Raises:

rubin.gafaelfawr.GafaelfawrError – Raised if the request to Gafaelfawr failed.