Skip to content

Commit 07e0454

Browse files
committed
Remove deprecated $proxy_ips and $trusted_proxy_ips parameters
1 parent 9f9f32c commit 07e0454

File tree

2 files changed

+4
-62
lines changed

2 files changed

+4
-62
lines changed

manifests/mod/remoteip.pp

+4-28
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
#
99
# @param internal_proxy
1010
# A list of IP addresses, IP blocks or hostname that are trusted to set a
11-
# valid value inside specified header. Unlike the `$trusted_proxy_ips`
11+
# valid value inside specified header. Unlike the `$trusted_proxy`
1212
# parameter, any IP address (including private addresses) presented by these
1313
# proxies will trusted by `mod_remoteip`.
1414
#
15-
# @param proxy_ips
16-
# *Deprecated*: use `$internal_proxy` instead.
17-
#
1815
# @param internal_proxy_list
1916
# The path to a file containing a list of IP addresses, IP blocks or hostname
2017
# that are trusted to set a valid value inside the specified header. See
@@ -39,9 +36,6 @@
3936
# any private IP presented by these proxies will be disgarded by
4037
# `mod_remoteip`.
4138
#
42-
# @param trusted_proxy_ips
43-
# *Deprecated*: use `$trusted_proxy` instead.
44-
#
4539
# @param trusted_proxy_list
4640
# The path to a file containing a list of IP addresses, IP blocks or hostname
4741
# that are trusted to set a valid value inside the specified header. See
@@ -51,44 +45,26 @@
5145
#
5246
class apache::mod::remoteip (
5347
String $header = 'X-Forwarded-For',
54-
Optional[Array[Stdlib::Host]] $internal_proxy = undef,
55-
Optional[Array[Stdlib::Host]] $proxy_ips = undef,
48+
Array[Stdlib::Host] $internal_proxy = ['127.0.0.1'],
5649
Optional[Stdlib::Absolutepath] $internal_proxy_list = undef,
5750
Optional[String] $proxies_header = undef,
5851
Boolean $proxy_protocol = false,
5952
Optional[Array[Stdlib::Host]] $proxy_protocol_exceptions = undef,
6053
Optional[Array[Stdlib::Host]] $trusted_proxy = undef,
61-
Optional[Array[Stdlib::Host]] $trusted_proxy_ips = undef,
6254
Optional[Stdlib::Absolutepath] $trusted_proxy_list = undef,
6355
) {
6456
include apache
6557

66-
if $proxy_ips {
67-
deprecation('apache::mod::remoteip::proxy_ips', 'This parameter is deprecated, please use `internal_proxy`.')
68-
$_internal_proxy = $proxy_ips
69-
} elsif $internal_proxy {
70-
$_internal_proxy = $internal_proxy
71-
} else {
72-
$_internal_proxy = ['127.0.0.1']
73-
}
74-
75-
if $trusted_proxy_ips {
76-
deprecation('apache::mod::remoteip::trusted_proxy_ips', 'This parameter is deprecated, please use `trusted_proxy`.')
77-
$_trusted_proxy = $trusted_proxy_ips
78-
} else {
79-
$_trusted_proxy = $trusted_proxy
80-
}
81-
8258
::apache::mod { 'remoteip': }
8359

8460
$template_parameters = {
8561
header => $header,
86-
internal_proxy => $_internal_proxy,
62+
internal_proxy => $internal_proxy,
8763
internal_proxy_list => $internal_proxy_list,
8864
proxies_header => $proxies_header,
8965
proxy_protocol => $proxy_protocol,
9066
proxy_protocol_exceptions => $proxy_protocol_exceptions,
91-
trusted_proxy => $_trusted_proxy,
67+
trusted_proxy => $trusted_proxy,
9268
trusted_proxy_list => $trusted_proxy_list,
9369
}
9470

spec/classes/mod/remoteip_spec.rb

-34
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,6 @@
4646
it { is_expected.to contain_file('remoteip.conf').with_content(%r{^RemoteIPInternalProxy fd00:fd00:fd00:2000::/64$}) }
4747
end
4848

49-
describe 'with proxy_ips => [ 10.42.17.8, 10.42.18.99 ]' do
50-
let :params do
51-
{ proxy_ips: ['10.42.17.8', '10.42.18.99'] }
52-
end
53-
54-
it { is_expected.to contain_file('remoteip.conf').with_content(%r{^RemoteIPInternalProxy 10.42.17.8$}) }
55-
it { is_expected.to contain_file('remoteip.conf').with_content(%r{^RemoteIPInternalProxy 10.42.18.99$}) }
56-
end
57-
58-
describe 'with IPv4 CIDR in proxy_ips => [ 192.168.1.0/24 ]' do
59-
let :params do
60-
{ proxy_ips: ['192.168.1.0/24'] }
61-
end
62-
63-
it { is_expected.to contain_file('remoteip.conf').with_content(%r{^RemoteIPInternalProxy 192.168.1.0/24$}) }
64-
end
65-
66-
describe 'with IPv6 CIDR in proxy_ips => [ fd00:fd00:fd00:2000::/64 ]' do
67-
let :params do
68-
{ proxy_ips: ['fd00:fd00:fd00:2000::/64'] }
69-
end
70-
71-
it { is_expected.to contain_file('remoteip.conf').with_content(%r{^RemoteIPInternalProxy fd00:fd00:fd00:2000::/64$}) }
72-
end
73-
7449
describe 'with trusted_proxy => [ 10.42.17.8, 10.42.18.99 ]' do
7550
let :params do
7651
{ trusted_proxy: ['10.42.17.8', '10.42.18.99'] }
@@ -80,15 +55,6 @@
8055
it { is_expected.to contain_file('remoteip.conf').with_content(%r{^RemoteIPTrustedProxy 10.42.18.99$}) }
8156
end
8257

83-
describe 'with trusted_proxy_ips => [ 10.42.17.8, 10.42.18.99 ]' do
84-
let :params do
85-
{ trusted_proxy: ['10.42.17.8', '10.42.18.99'] }
86-
end
87-
88-
it { is_expected.to contain_file('remoteip.conf').with_content(%r{^RemoteIPTrustedProxy 10.42.17.8$}) }
89-
it { is_expected.to contain_file('remoteip.conf').with_content(%r{^RemoteIPTrustedProxy 10.42.18.99$}) }
90-
end
91-
9258
describe 'with proxy_protocol_exceptions => [ 10.42.17.8, 10.42.18.99 ]' do
9359
let :params do
9460
{ proxy_protocol_exceptions: ['10.42.17.8', '10.42.18.99'] }

0 commit comments

Comments
 (0)