thunderbird_accounts.authentication.utils

Functions

create_aia_url(action)

Create a url for a user to start a keycloak flow.

delete_user_data(user)

Delete a user from Keycloak, Stalwart, and the local DB.

is_email_in_allow_list(email)

If USE_ALLOW_LIST is enabled check the email for an existing User or an AllowListEntry.

is_email_reserved(email)

Classes

KeycloakRequiredAction(*values)

Required actions, they're defined in the server's provider info.

class thunderbird_accounts.authentication.utils.KeycloakRequiredAction(*values)[source]

Bases: StrEnum

Required actions, they’re defined in the server’s provider info.

Yes these are case sensitive… CONFIGURE_TOTP webauthn-register-passwordless UPDATE_PASSWORD TERMS_AND_CONDITIONS update_user_locale idp_link VERIFY_EMAIL delete_account webauthn-register VERIFY_PROFILE delete_credential CONFIGURE_RECOVERY_AUTHN_CODES UPDATE_PROFILE

thunderbird_accounts.authentication.utils.is_email_in_allow_list(email: str)[source]

If USE_ALLOW_LIST is enabled check the email for an existing User or an AllowListEntry.

thunderbird_accounts.authentication.utils.create_aia_url(action: KeycloakRequiredAction)[source]

Create a url for a user to start a keycloak flow. These flows are defined as actions in KeycloakRequiredAction.

thunderbird_accounts.authentication.utils.delete_user_data(user) list[str][source]

Delete a user from Keycloak, Stalwart, and the local DB.

Returns a list of error messages (empty on full success). Errors from external services are captured but do not prevent the local DB deletion from proceeding.