Ver Fonte

HUE-6542 [core] Add configuration comment for Hue Account lock login_cooloff_time

Jenny Kim há 8 anos atrás
pai
commit
cc62a43

+ 3 - 2
desktop/conf.dist/hue.ini

@@ -336,8 +336,9 @@
     # After number of allowed login attempts are exceeded, do we lock out this IP and optionally user agent?
     ## login_lock_out_at_failure=false
 
-    # If set, defines period of inactivity in seconds after which failed logins will be forgotten
-    ## login_cooloff_time=60
+    # If set, defines period of inactivity in hours after which failed logins will be forgotten.
+    # A value of 0 or None will disable this check. Default: None
+    ## login_cooloff_time=None
 
     # If True, lock out based on an IP address AND a user agent.
     # This means requests from different user agents but from the same IP are treated differently.

+ 3 - 2
desktop/conf/pseudo-distributed.ini.tmpl

@@ -340,8 +340,9 @@
     # After number of allowed login attempts are exceeded, do we lock out this IP and optionally user agent?
     ## login_lock_out_at_failure=false
 
-    # If set, defines period of inactivity in seconds after which failed logins will be forgotten
-    ## login_cooloff_time=60
+    # If set, defines period of inactivity in hours after which failed logins will be forgotten.
+    # A value of 0 or None will disable this check. Default: None
+    ## login_cooloff_time=None
 
     # If True, lock out based on an IP address AND a user agent.
     # This means requests from different user agents but from the same IP are treated differently.

+ 2 - 1
desktop/core/src/desktop/conf.py

@@ -889,7 +889,8 @@ AUTH = ConfigSection(
     ),
     LOGIN_COOLOFF_TIME = Config(
       key="login_cooloff_time",
-      help=_("If set, defines period of inactivity in seconds after which failed logins will be forgotten"),
+      help=_("If set, defines period of inactivity in hours after which failed logins will be forgotten."
+             "A value of 0 or None will disable this check. Default: None."),
       type=coerce_timedelta,
       default=None,
     ),

+ 3 - 1
desktop/core/src/desktop/settings.py

@@ -403,7 +403,9 @@ else:
 # Axes
 AXES_LOGIN_FAILURE_LIMIT = desktop.conf.AUTH.LOGIN_FAILURE_LIMIT.get()
 AXES_LOCK_OUT_AT_FAILURE = desktop.conf.AUTH.LOGIN_LOCK_OUT_AT_FAILURE.get()
-AXES_COOLOFF_TIME = desktop.conf.AUTH.LOGIN_COOLOFF_TIME.get()
+AXES_COOLOFF_TIME = None
+if desktop.conf.AUTH.LOGIN_COOLOFF_TIME.get() and desktop.conf.AUTH.LOGIN_COOLOFF_TIME.get() != 0:
+  AXES_COOLOFF_TIME = desktop.conf.AUTH.LOGIN_COOLOFF_TIME.get()
 AXES_USE_USER_AGENT = desktop.conf.AUTH.LOGIN_LOCK_OUT_USE_USER_AGENT.get()
 AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP = desktop.conf.AUTH.LOGIN_LOCK_OUT_BY_COMBINATION_USER_AND_IP.get()
 AXES_BEHIND_REVERSE_PROXY = desktop.conf.AUTH.BEHIND_REVERSE_PROXY.get()