gws.plugin.auth_provider.file

Provider for the file-based authorization

Source code: gws.plugin.auth_provider.file

Package Contents

class gws.plugin.auth_provider.file.Config(*args, **kwargs)

Bases: gws.base.auth.provider.Config

File-based authorization provider

path: gws.FilePath

path to the users json file

class gws.plugin.auth_provider.file.Object

Bases: gws.base.auth.provider.Object

Authentication Provider.

path: str
db: list[dict]
configure()

Configuration hook.

authenticate(method, credentials)

Authenticate a user.

Parameters:
  • method – Authentication method.

  • credentials – Credentials object.

Returns:

An authenticated User or None if authentication failed.

get_user(local_uid)

Get a User from its local uid.

Parameters:

local_uid – User local uid.

Returns:

A User or None.

passwd(p: gws.EmptyRequest)

Encode a password for the authorization file