Skip to content

Commit 6168ce0

Browse files
committed
Remove deprecated $proxy_ips and $trusted_proxy_ips parameters
1 parent 9f9f32c commit 6168ce0

File tree

3 files changed

+7
-83
lines changed

3 files changed

+7
-83
lines changed

REFERENCE.md

+3-21
Original file line numberDiff line numberDiff line change
@@ -5720,13 +5720,11 @@ The following parameters are available in the `apache::mod::remoteip` class:
57205720

57215721
* [`header`](#-apache--mod--remoteip--header)
57225722
* [`internal_proxy`](#-apache--mod--remoteip--internal_proxy)
5723-
* [`proxy_ips`](#-apache--mod--remoteip--proxy_ips)
57245723
* [`internal_proxy_list`](#-apache--mod--remoteip--internal_proxy_list)
57255724
* [`proxies_header`](#-apache--mod--remoteip--proxies_header)
57265725
* [`proxy_protocol`](#-apache--mod--remoteip--proxy_protocol)
57275726
* [`proxy_protocol_exceptions`](#-apache--mod--remoteip--proxy_protocol_exceptions)
57285727
* [`trusted_proxy`](#-apache--mod--remoteip--trusted_proxy)
5729-
* [`trusted_proxy_ips`](#-apache--mod--remoteip--trusted_proxy_ips)
57305728
* [`trusted_proxy_list`](#-apache--mod--remoteip--trusted_proxy_list)
57315729

57325730
##### <a name="-apache--mod--remoteip--header"></a>`header`
@@ -5739,22 +5737,14 @@ Default value: `'X-Forwarded-For'`
57395737

57405738
##### <a name="-apache--mod--remoteip--internal_proxy"></a>`internal_proxy`
57415739

5742-
Data type: `Optional[Array[Stdlib::Host]]`
5740+
Data type: `Array[Stdlib::Host]`
57435741

57445742
A list of IP addresses, IP blocks or hostname that are trusted to set a
5745-
valid value inside specified header. Unlike the `$trusted_proxy_ips`
5743+
valid value inside specified header. Unlike the `$trusted_proxy`
57465744
parameter, any IP address (including private addresses) presented by these
57475745
proxies will trusted by `mod_remoteip`.
57485746

5749-
Default value: `undef`
5750-
5751-
##### <a name="-apache--mod--remoteip--proxy_ips"></a>`proxy_ips`
5752-
5753-
Data type: `Optional[Array[Stdlib::Host]]`
5754-
5755-
*Deprecated*: use `$internal_proxy` instead.
5756-
5757-
Default value: `undef`
5747+
Default value: `['127.0.0.1']`
57585748

57595749
##### <a name="-apache--mod--remoteip--internal_proxy_list"></a>`internal_proxy_list`
57605750

@@ -5805,14 +5795,6 @@ any private IP presented by these proxies will be disgarded by
58055795

58065796
Default value: `undef`
58075797

5808-
##### <a name="-apache--mod--remoteip--trusted_proxy_ips"></a>`trusted_proxy_ips`
5809-
5810-
Data type: `Optional[Array[Stdlib::Host]]`
5811-
5812-
*Deprecated*: use `$trusted_proxy` instead.
5813-
5814-
Default value: `undef`
5815-
58165798
##### <a name="-apache--mod--remoteip--trusted_proxy_list"></a>`trusted_proxy_list`
58175799

58185800
Data type: `Optional[Stdlib::Absolutepath]`

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)