Merge "[tripleo-ui] Explicitly configure Nova CORS"

This commit is contained in:
Zuul 2018-05-21 17:35:08 +00:00 committed by Gerrit Code Review
commit 0e1336f9a2
2 changed files with 18 additions and 0 deletions

View File

@ -54,6 +54,7 @@ parameter_defaults:
# we do not want the nova-compute instance running on the undercloud for # we do not want the nova-compute instance running on the undercloud for
# Ironic to be disabled in the case of multiple deployment failures. # Ironic to be disabled in the case of multiple deployment failures.
NovaAutoDisabling: '0' NovaAutoDisabling: '0'
NovaCorsAllowedOrigin: '*'
NeutronDhcpAgentsPerNetwork: 2 NeutronDhcpAgentsPerNetwork: 2
HeatConvergenceEngine: true HeatConvergenceEngine: true
HeatCorsAllowedOrigin: '*' HeatCorsAllowedOrigin: '*'

View File

@ -39,6 +39,14 @@ parameters:
tag: openstack.tripleo.ui tag: openstack.tripleo.ui
# FIXME(mandre) # FIXME(mandre)
path: /var/log/tripleo/ui.log path: /var/log/tripleo/ui.log
NovaCorsAllowedOrigin:
type: string
default: ''
description: Indicate whether this resource may be shared with the domain received in the request
"origin" header.
conditions:
cors_allowed_origin_unset: {equals : [{get_param: NovaCorsAllowedOrigin}, '']}
resources: resources:
@ -64,6 +72,11 @@ outputs:
config_settings: config_settings:
map_merge: map_merge:
- get_attr: [ApacheServiceBase, role_data, config_settings] - get_attr: [ApacheServiceBase, role_data, config_settings]
-
if:
- cors_allowed_origin_unset
- {}
- nova::cors::allowed_origin: {get_param: NovaCorsAllowedOrigin}
- tripleo::ui::endpoint_proxy_zaqar: {get_param: [EndpointMap, ZaqarWebSocketInternal, uri_no_suffix]} - tripleo::ui::endpoint_proxy_zaqar: {get_param: [EndpointMap, ZaqarWebSocketInternal, uri_no_suffix]}
tripleo::ui::endpoint_proxy_keystone: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]} tripleo::ui::endpoint_proxy_keystone: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
tripleo::ui::endpoint_proxy_heat: {get_param: [EndpointMap, HeatInternal, uri_no_suffix]} tripleo::ui::endpoint_proxy_heat: {get_param: [EndpointMap, HeatInternal, uri_no_suffix]}
@ -80,6 +93,10 @@ outputs:
tripleo::ui::endpoint_config_mistral: {get_param: [EndpointMap, MistralUIConfig, uri]} tripleo::ui::endpoint_config_mistral: {get_param: [EndpointMap, MistralUIConfig, uri]}
tripleo::ui::endpoint_config_nova: {get_param: [EndpointMap, NovaUIConfig, uri]} tripleo::ui::endpoint_config_nova: {get_param: [EndpointMap, NovaUIConfig, uri]}
tripleo::ui::endpoint_config_swift: {get_param: [EndpointMap, SwiftUIConfig, uri]} tripleo::ui::endpoint_config_swift: {get_param: [EndpointMap, SwiftUIConfig, uri]}
nova::cors::max_age: 3600
nova::cors::allow_methods: 'GET,POST,PUT,DELETE,OPTIONS,PATCH'
nova::cors::allow_headers: 'Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma,X-Auth-Token'
nova::cors::expose_headers: 'Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma'
tripleo::ui::bind_host: tripleo::ui::bind_host:
str_replace: str_replace:
template: template: