diff --git a/ModuleFile b/ModuleFile
index 623a1da..eceefd0 100644
--- a/ModuleFile
+++ b/ModuleFile
@@ -1,5 +1,5 @@
name 'citops-repose'
-version '2.11.0'
+version '2.12.0'
description "Repose is an api middleware that provides authentication,
filtering, ratelimitting and several other features, this deploys it."
project_page 'https://github.com/rackerlabs/puppet-repose'
diff --git a/manifests/filter/system_model.pp b/manifests/filter/system_model.pp
index f0192ff..f6c90e3 100644
--- a/manifests/filter/system_model.pp
+++ b/manifests/filter/system_model.pp
@@ -82,6 +82,9 @@
# system-model config.
# Defaults to false False
#
+# [*encoded_headers*]
+# Array of header names that need to be encoded before being sent to the origin service.
+#
# === Examples
#
# $app_name = 'repose'
@@ -137,6 +140,7 @@
$rewrite_host_header = undef,
$service_cluster = undef,
$tracing_header = {},
+ $encoded_headers = [],
) {
### Validate parameters
diff --git a/puppet-module-repose.spec b/puppet-module-repose.spec
index f7b1489..f2852e3 100644
--- a/puppet-module-repose.spec
+++ b/puppet-module-repose.spec
@@ -2,7 +2,7 @@
%define base_name repose
Name: puppet-module-%{user}-%{base_name}
-Version: 2.11.0
+Version: 2.12.0
Release: 1
BuildArch: noarch
Summary: Puppet module to configure %{base_name}
@@ -30,6 +30,8 @@ cp -pr * %{buildroot}%{module_dir}/
%{module_dir}
%changelog
+* Tue Oct 22 2019 Senthil Natarajan 2.12.0-1
+- Added support for url encoded header
* Thu Aug 21 2019 Josh Bell 2.11.0-1
- Add basic support for Repose 9 in system model and other filters
- Add support for installing identity filter bundle
diff --git a/spec/defines/filter/system_model_spec.rb b/spec/defines/filter/system_model_spec.rb
index f577a9c..24d0fdf 100644
--- a/spec/defines/filter/system_model_spec.rb
+++ b/spec/defines/filter/system_model_spec.rb
@@ -356,5 +356,43 @@
without_content(/services/)
}
end
+
+ context 'defaults plus setting repose9 param with encoded headers' do
+ let :pre_condition do
+ "class { 'repose': cfg_new_namespace => true }"
+ end
+
+ let(:title) { 'default' }
+ let(:params) { {
+ :ensure => 'present',
+ :repose9 => 'true',
+ :filename => 'system-model.cfg.xml',
+ :app_name => 'repose',
+ :nodes => ['app1', 'app2' ],
+ :filters => {
+ 10 => { 'name' => 'ip-identity' },
+ },
+ :endpoints => [
+ {
+ 'id' => 'localhost',
+ 'protocol' => 'http',
+ 'hostname' => 'localhost',
+ 'root-path' => '',
+ 'port' => '80',
+ 'default' => 'true'
+ },
+ ],
+ :encoded_headers => ['x-user-name', 'x-rax-roles'],
+
+ } }
+ it {
+ should contain_file('/etc/repose/system-model.cfg.xml').
+ without_content(/tracing-header/).
+ without_content(/rewrite-host-header/).
+ without_content(/repose-cluster/).
+ without_content(/services/).
+ with_content(/url-encode-headers="x-user-name,x-rax-roles"/)
+ }
+ end
end
end
diff --git a/templates/system-model.cfg.xml.erb b/templates/system-model.cfg.xml.erb
index ea90cf7..e4deba4 100644
--- a/templates/system-model.cfg.xml.erb
+++ b/templates/system-model.cfg.xml.erb
@@ -27,7 +27,7 @@
<%- end -%>
<%- end -%>
-
+ url-encode-headers="<%= @encoded_headers.join(",")%>" <%- end -%> >
<%- @endpoints.each do |endpoint| -%>
<%= param %>="<%= value %>" <% end %>/>
<%- end -%>