| 1 |
""" |
| 2 |
flask_security |
| 3 |
~~~~~~~~~~~~~~ |
| 4 |
|
| 5 |
Flask-Security is a Flask extension that aims to add comprehensive security |
| 6 |
to Flask applications. |
| 7 |
|
| 8 |
:copyright: (c) 2012-2019 by Matt Wright. |
| 9 |
:copyright: (c) 2019-2026 by J. Christopher Wagner. |
| 10 |
:license: MIT, see LICENSE for more details. |
| 11 |
""" |
| 12 |
|
| 13 |
# flake8: noqa: F401 |
| 14 |
from .changeable import admin_change_password |
| 15 |
from .change_email import ChangeEmailForm |
| 16 |
from .change_username import ChangeUsernameForm |
| 17 |
from .core import ( |
| 18 |
Security, |
| 19 |
RoleMixin, |
| 20 |
UserMixin, |
| 21 |
WebAuthnMixin, |
| 22 |
FormInfo, |
| 23 |
current_user, |
| 24 |
) |
| 25 |
from .datastore import ( |
| 26 |
FSQLALiteUserDatastore, |
| 27 |
UserDatastore, |
| 28 |
SQLAlchemyUserDatastore, |
| 29 |
AsaList, |
| 30 |
MongoEngineUserDatastore, |
| 31 |
PeeweeUserDatastore, |
| 32 |
PonyUserDatastore, |
| 33 |
SQLAlchemySessionUserDatastore, |
| 34 |
) |
| 35 |
from .decorators import ( |
| 36 |
auth_token_required, |
| 37 |
anonymous_user_required, |
| 38 |
handle_csrf, |
| 39 |
http_auth_required, |
| 40 |
login_required, |
| 41 |
roles_accepted, |
| 42 |
roles_required, |
| 43 |
auth_required, |
| 44 |
permissions_accepted, |
| 45 |
permissions_required, |
| 46 |
unauth_csrf, |
| 47 |
) |
| 48 |
from .forms import ( |
| 49 |
ChangePasswordForm, |
| 50 |
ConfirmRegisterForm, |
| 51 |
Form, |
| 52 |
ForgotPasswordForm, |
| 53 |
LoginForm, |
| 54 |
PasswordlessLoginForm, |
| 55 |
RegisterForm, |
| 56 |
RegisterFormV2, |
| 57 |
ResetPasswordForm, |
| 58 |
SendConfirmationForm, |
| 59 |
TwoFactorRescueForm, |
| 60 |
TwoFactorSetupForm, |
| 61 |
TwoFactorVerifyCodeForm, |
| 62 |
unique_identity_attribute, |
| 63 |
UsernameRecoveryForm, |
| 64 |
VerifyForm, |
| 65 |
) |
| 66 |
from .mail_util import MailUtil, EmailValidateException |
| 67 |
from .oauth_glue import OAuthGlue |
| 68 |
from .oauth_provider import FsOAuthProvider |
| 69 |
from .password_util import PasswordUtil |
| 70 |
from .phone_util import PhoneUtil |
| 71 |
from .recovery_codes import ( |
| 72 |
MfRecoveryCodesUtil, |
| 73 |
MfRecoveryForm, |
| 74 |
MfRecoveryCodesForm, |
| 75 |
) |
| 76 |
from .signals import ( |
| 77 |
change_email_confirmed, |
| 78 |
change_email_instructions_sent, |
| 79 |
confirm_instructions_sent, |
| 80 |
login_instructions_sent, |
| 81 |
password_changed, |
| 82 |
password_reset, |
| 83 |
reset_password_instructions_sent, |
| 84 |
tf_code_confirmed, |
| 85 |
tf_profile_changed, |
| 86 |
tf_security_token_sent, |
| 87 |
tf_disabled, |
| 88 |
user_authenticated, |
| 89 |
user_failed_authn, |
| 90 |
user_unauthenticated, |
| 91 |
user_confirmed, |
| 92 |
user_registered, |
| 93 |
user_not_registered, |
| 94 |
username_recovery_email_sent, |
| 95 |
username_changed, |
| 96 |
us_security_token_sent, |
| 97 |
us_profile_changed, |
| 98 |
wan_deleted, |
| 99 |
wan_registered, |
| 100 |
) |
| 101 |
from .totp import Totp |
| 102 |
from .twofactor import tf_send_security_token |
| 103 |
from .tf_plugin import TwoFactorSelectForm |
| 104 |
from .unified_signin import ( |
| 105 |
UnifiedSigninForm, |
| 106 |
UnifiedSigninSetupForm, |
| 107 |
UnifiedSigninSetupValidateForm, |
| 108 |
UnifiedVerifyForm, |
| 109 |
us_send_security_token, |
| 110 |
) |
| 111 |
from .username_util import UsernameUtil |
| 112 |
from .utils import ( |
| 113 |
SmsSenderBaseClass, |
| 114 |
SmsSenderFactory, |
| 115 |
check_and_get_token_status, |
| 116 |
get_hmac, |
| 117 |
get_request_attr, |
| 118 |
get_url, |
| 119 |
hash_password, |
| 120 |
check_and_update_authn_fresh, |
| 121 |
login_user, |
| 122 |
logout_user, |
| 123 |
lookup_identity, |
| 124 |
naive_utcnow, |
| 125 |
password_breached_validator, |
| 126 |
password_complexity_validator, |
| 127 |
password_length_validator, |
| 128 |
pwned, |
| 129 |
send_mail, |
| 130 |
transform_url, |
| 131 |
uia_phone_mapper, |
| 132 |
uia_email_mapper, |
| 133 |
uia_username_mapper, |
| 134 |
url_for_security, |
| 135 |
verify_password, |
| 136 |
verify_and_update_password, |
| 137 |
) |
| 138 |
from .webauthn import ( |
| 139 |
WebAuthnRegisterForm, |
| 140 |
WebAuthnRegisterResponseForm, |
| 141 |
WebAuthnSigninForm, |
| 142 |
WebAuthnSigninResponseForm, |
| 143 |
WebAuthnDeleteForm, |
| 144 |
WebAuthnVerifyForm, |
| 145 |
) |
| 146 |
from .webauthn_util import WebauthnUtil |
| 147 |
|
| 148 |
__version__ = "5.8.2" |