gws.plugin.account.helper
¶
Source code: gws.plugin.account.helper
Module Contents¶
- class gws.plugin.account.helper.Config(*args, **kwargs)¶
Bases:
gws.Config
Account helper. (added in 8.1)
- adminModel: gws.ext.config.model¶
Edit model for account administration.
- mfaIssuer: str = ''¶
Issuer name for Multi-factor key uris (qr codes).
- onboardingCompletionUrl: str = ''¶
URL to redirect after onboarding.
- onboardingUrl: str¶
URL for email onboarding.
- passwordCreateSql: str | None¶
SQL expression for computing password hashes.
- passwordVerifySql: str | None¶
SQL expression for verifying password hashes.
- tcLifeTime: gws.Duration = 3600¶
Life time for temporary codes.
- templates: list[gws.ext.config.template]¶
Templates
- userModel: gws.ext.config.model | None¶
Edit model for end-users accounts.
- usernameColumn: str = 'email'¶
Column used as ‘login’.
- class gws.plugin.account.helper.MfaOption(*args, **kwargs)¶
Bases:
gws.Data
Basic data object.
This object can be instantiated by passing one or or
dict
arguments and/or keyword args. All dicts keys and keywords become attributes of the object.Accessing an undefined attribute returns
None
and no error is raised, unless the attribute name starts with an underscore.- adapter: gws.AuthMultiFactorAdapter | None¶
- index: int¶
- title: str¶
- class gws.plugin.account.helper.Object¶
Bases:
gws.base.edit.helper.Object
- adminModel: gws.DatabaseModel¶
- mfaIssuer: str¶
- onboardingCompletionUrl: str¶
- onboardingUrl: str¶
- passwordCreateSql: str¶
- passwordVerifySql: str¶
- tcLifeTime: int¶
- templates: list[gws.Template]¶
- userModel: gws.DatabaseModel¶
- usernameColumn: str¶
- clear_tc(account: dict)¶
- configure()¶
- configure_templates()¶
- generate_mfa_secret(account: dict) str ¶
- generate_tc(account: dict, category: str) str ¶
- get_account_by_credentials(credentials: gws.Data, expected_status: gws.plugin.account.core.Status | None = None) dict | None ¶
- get_account_by_id(uid: str) dict | None ¶
- get_account_by_tc(tc: str, category: str, expected_status: gws.plugin.account.core.Status | None = None) dict | None ¶
- get_models(req, p)¶
- get_uid(account: dict) str ¶
- invalidate_tc(tc: str)¶
- make_tc()¶
- post_configure()¶
- render_template(subject, args, mime=None)¶
- reset(account: dict)¶
- send_mail(account: dict, category: str, args: dict | None = None)¶
- send_onboarding_email(account: dict)¶
- set_mfa(account: dict, mfa_option_index: int)¶
- set_password(account: dict, password)¶
- set_status(account: dict, status: gws.plugin.account.core.Status)¶
- validate_password(password: str) bool ¶
- write_feature(req, p)¶