Merge "Fix how disallow_iframe_embed is defined"

This commit is contained in:
Zuul 2021-09-20 08:38:29 +00:00 committed by Gerrit Code Review
commit d34ea08640
3 changed files with 9 additions and 6 deletions

@ -0,0 +1,4 @@
---
fixes:
- |
Fixed wrong usage of the ``DISALLOW_IFRAME_EMBED`` option.

@ -206,6 +206,7 @@ describe 'horizon' do
'COMPRESS_OFFLINE = False', 'COMPRESS_OFFLINE = False',
"FILE_UPLOAD_TEMP_DIR = '/var/spool/horizon'", "FILE_UPLOAD_TEMP_DIR = '/var/spool/horizon'",
"OVERVIEW_DAYS_RANGE = 1", "OVERVIEW_DAYS_RANGE = 1",
'DISALLOW_IFRAME_EMBED = True',
]) ])
end end
@ -557,16 +558,16 @@ describe 'horizon' do
end end
end end
context 'with disallow iframe embed enabled' do context 'with disallow iframe embed disabled' do
before do before do
params.merge!({ params.merge!({
:disallow_iframe_embed => true :disallow_iframe_embed => false
}) })
end end
it 'disallow_iframe_embed is configured' do it 'disallow_iframe_embed is configured' do
verify_concat_fragment_contents(catalogue, 'local_settings.py', [ verify_concat_fragment_contents(catalogue, 'local_settings.py', [
'HORIZON_CONFIG["disallow_iframe_embed"] = True', 'DISALLOW_IFRAME_EMBED = False',
]) ])
end end
end end

@ -1036,9 +1036,7 @@ REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES',
# For more information see: # For more information see:
# http://tinyurl.com/anticlickjack # http://tinyurl.com/anticlickjack
#DISALLOW_IFRAME_EMBED = True #DISALLOW_IFRAME_EMBED = True
<% if @disallow_iframe_embed == true %> DISALLOW_IFRAME_EMBED = <%= @disallow_iframe_embed.to_s.capitalize %>
HORIZON_CONFIG["disallow_iframe_embed"] = True
<% end %>
<% if @horizon_upload_mode %> <% if @horizon_upload_mode %>
HORIZON_IMAGES_UPLOAD_MODE = <%= @horizon_upload_mode %> HORIZON_IMAGES_UPLOAD_MODE = <%= @horizon_upload_mode %>