mirror of
https://github.com/simple-login/app.git
synced 2026-04-07 19:27:34 +00:00
Move to config
This commit is contained in:
committed by
Adrià Casajús
parent
ecacc2968d
commit
7a92b60231
+1
-3
@@ -14,8 +14,6 @@ from app import config
|
||||
from app import models
|
||||
from app.models import AdminAuditLog, AuditLogActionEnum, Fido
|
||||
|
||||
_ADMIN_GAP = 43200 # 12 hours
|
||||
|
||||
|
||||
def _has_valid_admin_time() -> bool:
|
||||
if config.ADMIN_FIDO_REQUIRED == "none":
|
||||
@@ -23,7 +21,7 @@ def _has_valid_admin_time() -> bool:
|
||||
admin_time = session.get("admin_time")
|
||||
if not admin_time:
|
||||
return False
|
||||
if (time() - int(admin_time)) > _ADMIN_GAP:
|
||||
if (time() - int(admin_time)) > config.ADMIN_GRACE_PERIOD:
|
||||
return False
|
||||
if config.ADMIN_FIDO_REQUIRED == "hardware" and not session.get(
|
||||
"admin_hardware_auth"
|
||||
|
||||
@@ -720,5 +720,6 @@ PARTNER_SUPPORT_URL = os.environ.get("PARTNER_SUPPORT_URL", None)
|
||||
ADMIN_FIDO_REQUIRED = os.environ.get("ADMIN_FIDO_REQUIRED", "none")
|
||||
if ADMIN_FIDO_REQUIRED not in ("none", "any", "hardware"):
|
||||
raise ValueError("ADMIN_FIDO_REQUIRED is not a valid value")
|
||||
ADMIN_GRACE_PERIOD = int(os.environ.get("ADMIN_GRACE_PERIOD", 43200))
|
||||
|
||||
DROP_PGP_KEY_ATTACHMENTS_ON_REPLY = "DROP_PGP_KEY_ATTACHMENTS_ON_REPLY" in os.environ
|
||||
|
||||
Reference in New Issue
Block a user