Move app/auth.py to app/auth/__init__.py and add thematic submodule files: - app/auth/jwt.py - JWT encode/decode helpers - app/auth/passwords.py - bcrypt hash/verify - app/auth/totp.py - 2FA TOTP helpers - app/auth/store.py - user storage (_get_user, _save_user, etc.) - app/auth/schemas.py - Pydantic models - app/auth/deps.py - FastAPI dependencies (get_current_user, etc.) - app/auth/oauth.py - Google/GitHub/X/Telegram OAuth flows - app/auth/wallet.py - wallet signature auth (migrated from auth_wallet.py) The legacy app/auth.py and app/auth_wallet.py become re-export shims. Public API fully preserved across all 18+ importers. Routes unchanged (56). Phase 3B of AUDIT-2026-Q3.md.
64 lines
1.3 KiB
Python
64 lines
1.3 KiB
Python
"""Backward-compat shim — moved to app.auth package in P3B."""
|
|
from app.auth import * # noqa: F401,F403
|
|
from app.auth import ( # noqa: F401
|
|
PYOTP_AVAILABLE,
|
|
TOTP_DIGITS,
|
|
TOTP_INTERVAL,
|
|
TOTP_ISSUER,
|
|
TOTP_WINDOW,
|
|
EmailLoginRequest,
|
|
EmailRegisterRequest,
|
|
GoogleAuthResponse,
|
|
NonceResponse,
|
|
TelegramAuthRequest,
|
|
TwoFAEnableRequest,
|
|
TwoFALoginRequest,
|
|
TwoFASetupResponse,
|
|
TwoFAStatusResponse,
|
|
TwoFAVerifyRequest,
|
|
UserResponse,
|
|
WalletAuthResponse,
|
|
WalletNonceRequest,
|
|
WalletVerifyRequest,
|
|
_build_totp,
|
|
_create_jwt,
|
|
_delete_user,
|
|
_derive_user_id,
|
|
_generate_backup_codes,
|
|
_generate_qr_base64,
|
|
_generate_totp_secret,
|
|
_get_totp_uri,
|
|
_get_user,
|
|
_get_user_by_email,
|
|
_hash_backup_code,
|
|
_is_valid_email,
|
|
_save_user,
|
|
_verify_backup_code,
|
|
_verify_jwt,
|
|
_verify_totp,
|
|
generate_nonce,
|
|
get_current_user,
|
|
github_auth_url,
|
|
github_callback,
|
|
google_auth_url,
|
|
google_callback,
|
|
google_callback_post,
|
|
hash_password,
|
|
login_email,
|
|
register_email,
|
|
require_auth,
|
|
require_public_profile,
|
|
router,
|
|
telegram_auth,
|
|
twofa_disable,
|
|
twofa_enable,
|
|
twofa_login,
|
|
twofa_setup,
|
|
twofa_status,
|
|
twofa_verify,
|
|
verify_password,
|
|
wallet_nonce,
|
|
wallet_verify,
|
|
x_auth_url,
|
|
x_callback,
|
|
)
|