diff --git a/manifests/init.pp b/manifests/init.pp index b65ed22c..dfcc1363 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -349,12 +349,18 @@ # Defaults to undef # # [*session_timeout*] -# (optional) The session timeout for horizon in seconds. After this many seconds of inactivity -# the user is logged out. +# (optional) The session timeout for horizon in seconds. After this many +# seconds of inactivity the user is logged out. # Defaults to 3600. # +# [*simultaneous_sessions*] +# (optional) Controls whether a user can have multiple simultaneous +# sessions. +# Defaults to undef +# # [*token_timeout_margin*] -# (optional) A time margin in seconds to subtract from the real token's validity. +# (optional) A time margin in seconds to subtract from the real token's +# validity. # Defaults to 0. # # [*timezone*] @@ -622,6 +628,7 @@ class horizon( $access_log_format = undef, $session_timeout = 3600, $token_timeout_margin = 0, + $simultaneous_sessions = undef, $timezone = 'UTC', Boolean $secure_cookies = false, $django_session_engine = undef, diff --git a/releasenotes/notes/simultaneous_sessions-c503feb527139590.yaml b/releasenotes/notes/simultaneous_sessions-c503feb527139590.yaml new file mode 100644 index 00000000..343e698b --- /dev/null +++ b/releasenotes/notes/simultaneous_sessions-c503feb527139590.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``horizon::simultaneous_sessions`` parameter has been added. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index cf566a46..2ca88857 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -129,6 +129,7 @@ describe 'horizon' do :keystone_default_domain => 'domain.tld', :overview_days_range => 1, :session_timeout => 1800, + :simultaneous_sessions => 'allow', :token_timeout_margin => 60, :timezone => 'Asia/Shanghai', :available_themes => [ @@ -218,6 +219,7 @@ describe 'horizon' do " 'level': 'DEBUG',", " 'handlers': ['console', 'syslog'],", 'SESSION_TIMEOUT = 1800', + "SIMULTANEOUS_SESSIONS = 'allow'", 'TOKEN_TIMEOUT_MARGIN = 60', 'COMPRESS_ENABLED = False', 'COMPRESS_OFFLINE = False', diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index 22675e5a..fa914bf4 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -1048,6 +1048,11 @@ SECURITY_GROUP_RULES = { } SESSION_TIMEOUT = <%= @session_timeout %> +<% if ! @simultaneous_sessions.nil? -%> +# Control whether a same user can have multiple action sessions. +#SIMULTANEOUS_SESSIONS = 'allow' +SIMULTANEOUS_SESSIONS = '<%= @simultaneous_sessions %>' +<% end -%> TOKEN_TIMEOUT_MARGIN = <%= @token_timeout_margin %>