Add extra headers for Keystone
This patch allows deployers to add arbitrary headers to Keystone responses. This can be handy for CORS or for passing certain headers through nginx to the requester. Closes-Bug: 1695827 Change-Id: I8f838ecce118cb36081b98f483ddef465ddbae3f
This commit is contained in:
parent
e4a2f0e4a7
commit
08f879649b
@ -488,3 +488,17 @@ keystone_required_secrets:
|
|||||||
- keystone_service_password
|
- keystone_service_password
|
||||||
|
|
||||||
keystone_uwsgi_init_overrides: {}
|
keystone_uwsgi_init_overrides: {}
|
||||||
|
|
||||||
|
## Extra HTTP headers for Keystone
|
||||||
|
# Add any additional headers here that Keystone should return.
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
#
|
||||||
|
# keystone_extra_headers:
|
||||||
|
# - parameter: "Access-Control-Expose-Headers"
|
||||||
|
# value: "X-Subject-Token"
|
||||||
|
# - parameter: "Access-Control-Allow-Headers"
|
||||||
|
# value: "Content-Type, X-Auth-Token"
|
||||||
|
# - parameter: "Access-Control-Allow-Origin"
|
||||||
|
# value: "*"
|
||||||
|
keystone_extra_headers: []
|
||||||
|
15
releasenotes/notes/extra-headers-e54a672d3a78dd89.yaml
Normal file
15
releasenotes/notes/extra-headers-e54a672d3a78dd89.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Extra headers can be added to Keystone responses by adding items to
|
||||||
|
``keystone_extra_headers``. Example:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
keystone_extra_headers:
|
||||||
|
- parameter: "Access-Control-Expose-Headers"
|
||||||
|
value: "X-Subject-Token"
|
||||||
|
- parameter: "Access-Control-Allow-Headers"
|
||||||
|
value: "Content-Type, X-Auth-Token"
|
||||||
|
- parameter: "Access-Control-Allow-Origin"
|
||||||
|
value: "*"
|
@ -30,5 +30,8 @@ server {
|
|||||||
include uwsgi_params;
|
include uwsgi_params;
|
||||||
uwsgi_pass 127.0.0.1:{{ keystone_uwsgi_ports[item]['socket'] }};
|
uwsgi_pass 127.0.0.1:{{ keystone_uwsgi_ports[item]['socket'] }};
|
||||||
uwsgi_param SCRIPT_NAME '';
|
uwsgi_param SCRIPT_NAME '';
|
||||||
|
{% for header in keystone_extra_headers %}
|
||||||
|
add_header "{{ header['parameter'] }}" "{{ header['value'] }}";
|
||||||
|
{% endfor %}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user