@@ -2198,7 +2198,7 @@ func TestBuildConfiguration(t *testing.T) {
2198
2198
Spec : ngfAPI.NginxProxySpec {
2199
2199
RewriteClientIP : & ngfAPI.RewriteClientIP {
2200
2200
SetIPRecursively : helpers .GetPointer (true ),
2201
- TrustedAddresses : []ngfAPI.TrustedAddress {"0.0.0.0/0 " },
2201
+ TrustedAddresses : []ngfAPI.TrustedAddress {"1.1.1.1/32 " },
2202
2202
Mode : helpers .GetPointer (ngfAPI .RewriteClientIPModeProxyProtocol ),
2203
2203
},
2204
2204
},
@@ -2214,7 +2214,7 @@ func TestBuildConfiguration(t *testing.T) {
2214
2214
IPFamily : Dual ,
2215
2215
RewriteClientIPSettings : RewriteClientIPSettings {
2216
2216
IPRecursive : true ,
2217
- TrustedAddresses : []string {"0.0.0.0/0 " },
2217
+ TrustedAddresses : []string {"1.1.1.1/32 " },
2218
2218
Mode : RewriteIPModeProxyProtocol ,
2219
2219
},
2220
2220
}
@@ -3620,7 +3620,7 @@ func TestBuildRewriteIPSettings(t *testing.T) {
3620
3620
Spec : ngfAPI.NginxProxySpec {
3621
3621
RewriteClientIP : & ngfAPI.RewriteClientIP {
3622
3622
Mode : helpers .GetPointer (ngfAPI .RewriteClientIPModeProxyProtocol ),
3623
- TrustedAddresses : []ngfAPI.TrustedAddress {"0.0.0.0/0 " },
3623
+ TrustedAddresses : []ngfAPI.TrustedAddress {"10.9.9.4 " },
3624
3624
SetIPRecursively : helpers .GetPointer (true ),
3625
3625
},
3626
3626
},
@@ -3629,7 +3629,7 @@ func TestBuildRewriteIPSettings(t *testing.T) {
3629
3629
},
3630
3630
expRewriteIPSettings : RewriteClientIPSettings {
3631
3631
Mode : RewriteIPModeProxyProtocol ,
3632
- TrustedAddresses : []string {"0.0.0.0/0 " },
3632
+ TrustedAddresses : []string {"10.9.9.4 " },
3633
3633
IPRecursive : true ,
3634
3634
},
3635
3635
},
@@ -3642,7 +3642,7 @@ func TestBuildRewriteIPSettings(t *testing.T) {
3642
3642
Spec : ngfAPI.NginxProxySpec {
3643
3643
RewriteClientIP : & ngfAPI.RewriteClientIP {
3644
3644
Mode : helpers .GetPointer (ngfAPI .RewriteClientIPModeXForwardedFor ),
3645
- TrustedAddresses : []ngfAPI.TrustedAddress {"0.0.0.0/0 " },
3645
+ TrustedAddresses : []ngfAPI.TrustedAddress {"76.89.90.11 " },
3646
3646
SetIPRecursively : helpers .GetPointer (true ),
3647
3647
},
3648
3648
},
@@ -3651,7 +3651,7 @@ func TestBuildRewriteIPSettings(t *testing.T) {
3651
3651
},
3652
3652
expRewriteIPSettings : RewriteClientIPSettings {
3653
3653
Mode : RewriteIPModeXForwardedFor ,
3654
- TrustedAddresses : []string {"0.0.0.0/0 " },
3654
+ TrustedAddresses : []string {"76.89.90.11 " },
3655
3655
IPRecursive : true ,
3656
3656
},
3657
3657
},
@@ -3664,7 +3664,7 @@ func TestBuildRewriteIPSettings(t *testing.T) {
3664
3664
Spec : ngfAPI.NginxProxySpec {
3665
3665
RewriteClientIP : & ngfAPI.RewriteClientIP {
3666
3666
Mode : helpers .GetPointer (ngfAPI .RewriteClientIPModeXForwardedFor ),
3667
- TrustedAddresses : []ngfAPI.TrustedAddress {"0.0.0.0/0 " , "1.1.1.1/32" , "2.2.2.2/32" , "3.3.3.3/24" },
3667
+ TrustedAddresses : []ngfAPI.TrustedAddress {"5.5.5.5 " , "1.1.1.1/32" , "2.2.2.2/32" , "3.3.3.3/24" },
3668
3668
SetIPRecursively : helpers .GetPointer (false ),
3669
3669
},
3670
3670
},
@@ -3673,7 +3673,7 @@ func TestBuildRewriteIPSettings(t *testing.T) {
3673
3673
},
3674
3674
expRewriteIPSettings : RewriteClientIPSettings {
3675
3675
Mode : RewriteIPModeXForwardedFor ,
3676
- TrustedAddresses : []string {"0.0.0.0/0 " , "1.1.1.1/32" , "2.2.2.2/32" , "3.3.3.3/24" },
3676
+ TrustedAddresses : []string {"5.5.5.5 " , "1.1.1.1/32" , "2.2.2.2/32" , "3.3.3.3/24" },
3677
3677
IPRecursive : false ,
3678
3678
},
3679
3679
},
0 commit comments