registry.services.datastore package

Database integration for persisting API client information.

exception registry.services.datastore.NoSuchAuthCode[source]

Bases: RuntimeError

A non-existant domain.AuthorizationCode was requested.

exception registry.services.datastore.NoSuchAuthorization[source]

Bases: RuntimeError

A non-existant domain.ClientAuthorization was requested.

exception registry.services.datastore.NoSuchClient[source]

Bases: RuntimeError

A client was requested that does not exist.

exception registry.services.datastore.NoSuchGrantType[source]

Bases: RuntimeError

A non-existant domain.ClientGrantType was requested.

registry.services.datastore.delete_auth_code(code, client_id)[source]

Delete an auth code from the database.

Return type:None
registry.services.datastore.load_auth_code(code, client_id)[source]

Load an authorization code for an API client.

Return type:AuthorizationCode
registry.services.datastore.load_auth_code_by_user(code, user_id)[source]

Load an authorization code for an API client.

Return type:AuthorizationCode
registry.services.datastore.load_client(client_id)[source]

Load a Client from the datastore.

Return type:Tuple[Client, Optional[ClientCredential], List[ClientAuthorization], List[ClientGrantType]]
registry.services.datastore.save_auth_code(code)[source]

Save a new authorization code.

Return type:None
registry.services.datastore.save_client(client, cred=None, auths=None, grant_types=None)[source]

Persist a domain.Client and (optionally) related data.

Parameters:
  • client (domain.Client) –
  • cred (domain.ClientCredential or None) –
  • auths (list or None) – Items are domain.ClientAuthorization instances.
  • grant_types (list or None) – Items are domain.ClientGrantType instances.
Return type:

str

registry.services.datastore.set_credential(cred, client_id=None, db_client=None, commit=True)[source]
Return type:None
registry.services.datastore.update_authorizations(auths, client_id=None, db_client=None, commit=True)[source]
Return type:None
registry.services.datastore.update_grant_types(grant_types, client_id=None, db_client=None, commit=True)[source]
Return type:None