OIDCClientStore#

class gafaelfawr.storage.oidc.OIDCClientStore(session)#

Bases: object

Manage registered OpenID Connect clients.

Client secrets are stored hashed in the database and are only returned during initial creation. After creation, the secret can only be compared against a provided password.

Parameters:

session (AsyncSession) – The database session.

Methods Summary

authenticate(client_id, client_secret)

Check authentication for an OpenID Connect client.

delete(client_id)

Delete a registered OpenID Connect client.

get(client_id)

Retrieve a registered OpenID Connect client.

list()

List all registered OpenID Connect clients.

register(create)

Register a new OpenID Connect client.

update(client_id, update)

Update a registered OpenID Connect client.

Methods Documentation

async authenticate(client_id, client_secret)#

Check authentication for an OpenID Connect client.

Parameters:
  • client_id (str) – Provided client ID.

  • client_secret (str) – Provided client secret.

Returns:

Results of the authentication.

Return type:

OIDCAuthenticateStatus

async delete(client_id)#

Delete a registered OpenID Connect client.

Parameters:

client_id (str) – Identifier of client.

Returns:

True if the client was found and deleted, False otherwise.

Return type:

bool

async get(client_id)#

Retrieve a registered OpenID Connect client.

Parameters:

client_id (str) – Identifier of client.

Returns:

Corresponding metadata for the OpenID Connect client (without the hashed password), or None if the client was not found.

Return type:

OIDCClient or None

async list()#

List all registered OpenID Connect clients.

Returns:

List of registered clients.

Return type:

list of OIDCClient

async register(create)#

Register a new OpenID Connect client.

A secret will be generated and returned in the created client information and then stored hashed in the database. The secret is (hopefully) then no longer recoverable from the database and can only be compared against other hashed passwords.

Parameters:

create (OIDCClientCreate) – Parameters for the new client.

Returns:

Newly-registered client with its secret.

Return type:

OIDCClientWithSecret

async update(client_id, update)#

Update a registered OpenID Connect client.

Parameters:
Returns:

Updated OpenID Connect client metadata or None if no such client was found.

Return type:

OIDCClient or None

Raises:

NotFoundError – Raised if the client doesn’t exist.

This page was last modified on .