:tocdepth: 3 :py:mod:`gws.plugin.account.helper` =================================== .. py:module:: gws.plugin.account.helper **Source code:** :source:`gws.plugin.account.helper` Module Contents --------------- .. py:class:: Config(*args, **kwargs) Bases: :py:obj:`gws.Config` Account helper. (added in 8.1) .. py:attribute:: adminModel :type: gws.ext.config.model Edit model for account administration. .. py:attribute:: mfa :type: Optional[list[MfaConfig]] Multi-factor authentication methods the user can choose from. .. py:attribute:: mfaIssuer :type: str :value: '' Issuer name for Multi-factor key uris (qr codes). .. py:attribute:: onboardingCompletionUrl :type: str :value: '' URL to redirect after onboarding. .. py:attribute:: onboardingUrl :type: str URL for email onboarding. .. py:attribute:: passwordCreateSql :type: Optional[str] SQL expression for computing password hashes. .. py:attribute:: passwordVerifySql :type: Optional[str] SQL expression for verifying password hashes. .. py:attribute:: tcLifeTime :type: gws.Duration :value: '3600' Life time for temporary codes. .. py:attribute:: templates :type: list[gws.ext.config.template] Templates .. py:attribute:: userModel :type: Optional[gws.ext.config.model] Edit model for end-users accounts. .. py:attribute:: usernameColumn :type: str :value: 'email' Column used as 'login'. .. py:exception:: Error Bases: :py:obj:`gws.Error` Account-related error. .. py:class:: MfaConfig Multi-factor authentication configuration. .. py:attribute:: mfaUid :type: str UID of the multi-factor authentication adapter. .. py:attribute:: title :type: str Title of the multi-factor authentication method. .. py:class:: MfaOption(*args, **kwargs) Bases: :py:obj:`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. .. py:attribute:: adapter :type: Optional[gws.AuthMultiFactorAdapter] .. py:attribute:: index :type: int .. py:attribute:: title :type: str .. py:class:: Object Bases: :py:obj:`gws.base.edit.helper.Object` .. py:attribute:: adminModel :type: gws.DatabaseModel .. py:attribute:: mfaIssuer :type: str .. py:attribute:: mfaOptions :type: list[MfaOption] .. py:attribute:: onboardingCompletionUrl :type: str .. py:attribute:: onboardingUrl :type: str .. py:attribute:: passwordCreateSql :type: str .. py:attribute:: passwordVerifySql :type: str .. py:attribute:: tcLifeTime :type: int .. py:attribute:: templates :type: list[gws.Template] .. py:attribute:: userModel :type: gws.DatabaseModel .. py:attribute:: usernameColumn :type: str .. py:method:: clear_tc(account: dict) .. py:method:: configure() .. py:method:: configure_templates() .. py:method:: generate_mfa_secret(account: dict) -> str .. py:method:: generate_tc(account: dict, category: str) -> str .. py:method:: get_account_by_credentials(credentials: gws.Data, expected_status: Optional[gws.plugin.account.core.Status] = None) -> Optional[dict] .. py:method:: get_account_by_id(uid: str) -> Optional[dict] .. py:method:: get_account_by_tc(tc: str, category: str, expected_status: Optional[gws.plugin.account.core.Status] = None) -> Optional[dict] .. py:method:: get_models(req, p) .. py:method:: get_uid(account: dict) -> str .. py:method:: invalidate_tc(tc: str) .. py:method:: make_tc() .. py:method:: mfa_options(account: dict) -> list[MfaOption] .. py:method:: post_configure() .. py:method:: qr_code_for_mfa(account: dict, mo: MfaOption, secret: str) -> str .. py:method:: render_template(subject, args, mime=None) .. py:method:: reset(account: dict) .. py:method:: send_mail(account: dict, category: str, args: Optional[dict] = None) .. py:method:: send_onboarding_email(account: dict) .. py:method:: set_mfa(account: dict, mfa_option_index: int) .. py:method:: set_password(account: dict, password) .. py:method:: set_status(account: dict, status: gws.plugin.account.core.Status) .. py:method:: validate_password(password: str) -> bool .. py:method:: write_feature(req, p)