gws.base.auth.manager
¶
Authorization and session manager.
Source code: gws.base.auth.manager
Module Contents¶
- class gws.base.auth.manager.Config(*args, **kwargs)¶
Bases:
gws.Config
Authentication and authorization options
- methods: list[gws.ext.config.authMethod] | None¶
Authorization methods.
- mfa: list[gws.ext.config.authMultiFactorAdapter] | None¶
Authorization providers.
- providers: list[gws.ext.config.authProvider] | None¶
Authorization providers.
- session: gws.ext.config.authSessionManager | None¶
Session options.
- class gws.base.auth.manager.Object¶
Bases:
gws.AuthManager
Authorization manager.
- authenticate(method, credentials)¶
Authenticate a user.
- Parameters:
method – Authentication method.
credentials – Credentials object.
- Returns:
An authenticated User or
None
if authentication failed.
- configure()¶
Configuration hook.
- enter_middleware(req)¶
Begin middleware processing.
- Parameters:
req – Requester object.
- Returns:
A Responder object or
None
.
- exit_middleware(req, res)¶
Finish middleware processing.
- Parameters:
req – Requester object.
res – Current responder object.
- get_method(uid=None, ext_type=None)¶
Get an authentication Method by its uid.
- Parameters:
uid – Uid.
- Returns:
A Method or
None
.
- get_multi_factor_adapter(uid=None, ext_type=None)¶
Get a Multi-Factor Adapter by its uid.
- Parameters:
uid – Adapter uid.
- Returns:
A Multi-Factor Adapter or
None
if not found.
- get_provider(uid)¶
Get an authentication Provider by its uid.
- Parameters:
uid – Uid.
- Returns:
A Provider or
None
.
- get_user(user_uid)¶
Get a User by its global uid.
- Parameters:
user_uid – Global user uid.
- Returns:
A User or
None
.
- is_public_object(obj, *context)¶
Check if an object is public.
- serialize_user(user)¶
Return a string representation of a User.
- Parameters:
user – A User object.
- Returns:
A json string.
- unserialize_user(data)¶
Restore a User object from a serialized representation.
- Parameters:
ser – A json string.
- Returns:
A User object.