OIDCClientStore#
- class gafaelfawr.storage.oidc.OIDCClientStore(session)#
Bases:
objectManage 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:
- Returns:
Results of the authentication.
- Return type:
- async delete(client_id)#
Delete a registered OpenID Connect client.
- 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
Noneif 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:
- async update(client_id, update)#
Update a registered OpenID Connect client.
- Parameters:
client_id (
str) – Identifier of client.update (
OIDCClientUpdate) – Changes to apply.
- Returns:
Updated OpenID Connect client metadata or
Noneif no such client was found.- Return type:
OIDCClient or None
- Raises:
NotFoundError – Raised if the client doesn’t exist.