websauna.system.user.utils module

User utilities.

websauna.system.user.utils.get_activation_model(registry)[source]

Get the class implementing IActivationModel.

Parameters

registry (Registry) – Pyramid registry.

Return type

Type[InterfaceClass]

Returns

Class implementing IActivationModel.

websauna.system.user.utils.get_authomatic(registry)[source]

Get active Authomatic instance from the registry.

This is registered in Initializer.configure_authomatic(). :type registry: Registry :param registry: Pyramid registry. :rtype: Authomatic :return: Instance of Authomatic.

websauna.system.user.utils.get_credential_activity_service(request)[source]

Get the credential activity service.

Parameters

request (Request) – Pyramid request.

Return type

InterfaceClass

Returns

Implementation of ICredentialActivityService.

websauna.system.user.utils.get_group_class(registry)[source]

Get the class implementing IGroupModel.

Parameters

registry (Registry) – Pyramid registry.

Return type

Type[InterfaceClass]

Returns

Class implementing IGroupModel.

websauna.system.user.utils.get_login_service(request)[source]

Get the login service.

Parameters

request (Request) – Pyramid request.

Return type

InterfaceClass

Returns

Implementation of ILoginService.

websauna.system.user.utils.get_oauth_login_service(request)[source]

Get the oauth login service.

Parameters

request (Request) – Pyramid request.

Return type

InterfaceClass

Returns

Implementation of IOAuthLoginService.

websauna.system.user.utils.get_registration_service(request)[source]

Get the registration service.

Parameters

request (Request) – Pyramid request.

Return type

InterfaceClass

Returns

Implementation of IRegistrationService.

websauna.system.user.utils.get_site_creator(registry)[source]

Get the class implementing ISiteCreator.

Parameters

registry (Registry) – Pyramid registry.

Return type

InterfaceClass

Returns

Class implementing ISiteCreator.

websauna.system.user.utils.get_social_login_mapper(registry, provider_id)[source]

Get a named social login mapper.

Example:

get_social_login_mapper(registry, "facebook")
Parameters
  • registry (Registry) – Pyramid registry.

  • provider_id (str) – Provider id of a social login mapper.

Return type

InterfaceClass

Returns

Implementation of ISocialLoginMapper.

websauna.system.user.utils.get_user_class(registry)[source]

Get the class implementing IUserModel.

Parameters

registry (Registry) – Pyramid registry.

Return type

Type[InterfaceClass]

Returns

Class implementing IUserModel.

websauna.system.user.utils.get_user_registry(request)[source]

Get the user registry..

Parameters

request (Request) – Pyramid request.

Return type

InterfaceClass

Returns

Implementation of IUserRegistry.