maasserver.models.user

MAAS-specific helpers for User.

Functions

create_auth_token(user) Create new Token and Consumer (OAuth authorisation) for user.
create_user(sender, instance, created, **kwargs)
get_auth_tokens(user) Fetches all the user’s OAuth tokens.
get_creds_tuple(token) Return API credentials as tuple, as used in MAASOAuth.

Classes

Consumer(*args, **kwargs) Consumer(id, name, description, key, secret, status, user_id)
Token(*args, **kwargs) Token(id, key, secret, verifier, token_type, timestamp, is_approved, user_id, consumer_id, callback, callback_confirmed)
maasserver.models.user.create_auth_token(user)[source]

Create new Token and Consumer (OAuth authorisation) for user.

Parameters:user (User) – The user to create a token for.
Returns:The created Token.
Return type:piston.models.Token
maasserver.models.user.get_auth_tokens(user)[source]

Fetches all the user’s OAuth tokens.

Returns:A QuerySet of the tokens.
Return type:django.db.models.query.QuerySet
maasserver.models.user.get_creds_tuple(token)[source]

Return API credentials as tuple, as used in MAASOAuth.

Returns a tuple of (consumer key, resource token, resource secret). The consumer secret is hard-wired to the empty string.

MAAS logo

MAAS

Metal As A Service.



Related Topics

This Page