Skip to content

Commit c3cc0ed

Browse files
Jenkinsopenstack-gerrit
Jenkins
authored andcommitted
Merge "Add secure_proxy_ssl_header option" into stable/mitaka
2 parents abb20ed + fbe4049 commit c3cc0ed

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

manifests/api.pp

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@
136136
# (optional) Enable or not Nova API v3
137137
# Defaults to false
138138
#
139+
# [*secure_proxy_ssl_header*]
140+
# (optional) The HTTP Header that will be used to determine
141+
# what the original request protocol scheme was, even if
142+
# it was hidden by an SSL termination proxy.
143+
# Defaults to $::os_service_default
144+
#
139145
# [*default_floating_pool*]
140146
# (optional) Default pool for floating IPs
141147
# Defaults to 'nova'
@@ -206,6 +212,7 @@
206212
$instance_name_template = undef,
207213
$fping_path = '/usr/sbin/fping',
208214
$service_name = $::nova::params::api_service_name,
215+
$secure_proxy_ssl_header = $::os_service_default,
209216
# DEPRECATED PARAMETER
210217
$conductor_workers = undef,
211218
$ec2_listen_port = undef,
@@ -292,20 +299,21 @@
292299
}
293300

294301
nova_config {
295-
'DEFAULT/api_paste_config': value => $api_paste_config;
296-
'DEFAULT/enabled_apis': value => $enabled_apis_real;
297-
'DEFAULT/volume_api_class': value => $volume_api_class;
298-
'DEFAULT/osapi_compute_listen': value => $api_bind_address;
299-
'DEFAULT/metadata_listen': value => $metadata_listen;
300-
'DEFAULT/metadata_listen_port': value => $metadata_listen_port;
301-
'DEFAULT/osapi_compute_listen_port': value => $osapi_compute_listen_port;
302-
'DEFAULT/osapi_volume_listen': value => $api_bind_address;
303-
'DEFAULT/osapi_compute_workers': value => $osapi_compute_workers;
304-
'DEFAULT/metadata_workers': value => $metadata_workers;
305-
'DEFAULT/use_forwarded_for': value => $use_forwarded_for;
306-
'DEFAULT/default_floating_pool': value => $default_floating_pool;
307-
'DEFAULT/fping_path': value => $fping_path;
308-
'osapi_v3/enabled': value => $osapi_v3;
302+
'DEFAULT/api_paste_config': value => $api_paste_config;
303+
'DEFAULT/enabled_apis': value => $enabled_apis_real;
304+
'DEFAULT/volume_api_class': value => $volume_api_class;
305+
'DEFAULT/osapi_compute_listen': value => $api_bind_address;
306+
'DEFAULT/metadata_listen': value => $metadata_listen;
307+
'DEFAULT/metadata_listen_port': value => $metadata_listen_port;
308+
'DEFAULT/osapi_compute_listen_port': value => $osapi_compute_listen_port;
309+
'DEFAULT/osapi_volume_listen': value => $api_bind_address;
310+
'DEFAULT/osapi_compute_workers': value => $osapi_compute_workers;
311+
'DEFAULT/metadata_workers': value => $metadata_workers;
312+
'DEFAULT/use_forwarded_for': value => $use_forwarded_for;
313+
'DEFAULT/default_floating_pool': value => $default_floating_pool;
314+
'DEFAULT/fping_path': value => $fping_path;
315+
'osapi_v3/enabled': value => $osapi_v3;
316+
'oslo_middleware/secure_proxy_ssl_header': value => $secure_proxy_ssl_header;
309317
}
310318

311319
if ($neutron_metadata_proxy_shared_secret){

spec/classes/nova_api_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
is_expected.to contain_nova_config('DEFAULT/metadata_workers').with('value' => '5')
6767
is_expected.to contain_nova_config('DEFAULT/default_floating_pool').with('value' => 'nova')
6868
is_expected.to contain_nova_config('DEFAULT/fping_path').with('value' => '/usr/sbin/fping')
69+
is_expected.to contain_nova_config('oslo_middleware/secure_proxy_ssl_header').with('value' => '<SERVICE DEFAULT>')
6970
end
7071

7172
it 'do not configure v3 api' do
@@ -100,7 +101,8 @@
100101
:metadata_workers => 2,
101102
:default_floating_pool => 'public',
102103
:osapi_v3 => true,
103-
:pci_alias => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\",\"name\":\"graphic_card\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"name\":\"network_card\"}]"
104+
:pci_alias => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\",\"name\":\"graphic_card\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"name\":\"network_card\"}]",
105+
:secure_proxy_ssl_header => "HTTP-X-Forwarded-Proto"
104106
})
105107
end
106108

@@ -146,6 +148,7 @@
146148
is_expected.to contain_nova_config('DEFAULT/default_floating_pool').with('value' => 'public')
147149
is_expected.to contain_nova_config('neutron/service_metadata_proxy').with('value' => true)
148150
is_expected.to contain_nova_config('neutron/metadata_proxy_shared_secret').with('value' => 'secrete')
151+
is_expected.to contain_nova_config('oslo_middleware/secure_proxy_ssl_header').with('value' => 'HTTP-X-Forwarded-Proto')
149152
end
150153

151154
it 'configure nova api v3' do

0 commit comments

Comments
 (0)