@@ -49,11 +49,21 @@ type NginxProxySpec struct {
4949 //
5050 // +optional
5151 Logging * NginxLogging `json:"logging,omitempty"`
52+ // NginxPlus specifies NGINX Plus additional settings.
53+ //
54+ // +optional
55+ NginxPlus * NginxPlus `json:"nginxPlus,omitempty"`
5256 // DisableHTTP2 defines if http2 should be disabled for all servers.
5357 // Default is false, meaning http2 will be enabled for all servers.
58+ DisableHTTP2 bool `json:"disableHTTP2,omitempty"`
59+ }
60+
61+ // NginxPlus specifies NGINX Plus additional settings. These will only be applied if NGINX Plus is being used.
62+ type NginxPlus struct {
63+ // AllowedAddresses specifies IPAddresses or CIDR blocks to the allow list for accessing the NGINX Plus API.
5464 //
5565 // +optional
56- DisableHTTP2 bool `json:"disableHTTP2 ,omitempty"`
66+ AllowedAddresses [] NginxPlusAllowAddress `json:"allowedAddresses ,omitempty"`
5767}
5868
5969// Telemetry specifies the OpenTelemetry configuration.
@@ -149,7 +159,7 @@ type RewriteClientIP struct {
149159 // +listType=map
150160 // +listMapKey=type
151161 // +kubebuilder:validation:MaxItems=16
152- TrustedAddresses []Address `json:"trustedAddresses,omitempty"`
162+ TrustedAddresses []RewriteClientIPAddress `json:"trustedAddresses,omitempty"`
153163}
154164
155165// RewriteClientIPModeType defines how NGINX Gateway Fabric will determine the client's original IP address.
@@ -183,28 +193,49 @@ const (
183193 IPv6 IPFamilyType = "ipv6"
184194)
185195
186- // Address is a struct that specifies address type and value.
187- type Address struct {
196+ // RewriteClientIPAddress specifies the address type and value for a RewriteClientIP address .
197+ type RewriteClientIPAddress struct {
188198 // Type specifies the type of address.
189- Type AddressType `json:"type"`
199+ Type RewriteClientIPAddressType `json:"type"`
190200
191201 // Value specifies the address value.
192202 Value string `json:"value"`
193203}
194204
195- // AddressType specifies the type of address.
205+ // RewriteClientIPAddressType specifies the type of address.
196206// +kubebuilder:validation:Enum=CIDR;IPAddress;Hostname
197- type AddressType string
207+ type RewriteClientIPAddressType string
198208
199209const (
200- // CIDRAddressType specifies that the address is a CIDR block.
201- CIDRAddressType AddressType = "CIDR"
210+ // RewriteClientIPCIDRAddressType specifies that the address is a CIDR block.
211+ RewriteClientIPCIDRAddressType RewriteClientIPAddressType = "CIDR"
212+
213+ // RewriteClientIPIPAddressType specifies that the address is an IP address.
214+ RewriteClientIPIPAddressType RewriteClientIPAddressType = "IPAddress"
215+
216+ // RewriteClientIPHostnameAddressType specifies that the address is a Hostname.
217+ RewriteClientIPHostnameAddressType RewriteClientIPAddressType = "Hostname"
218+ )
202219
203- // IPAddressType specifies that the address is an IP address.
204- IPAddressType AddressType = "IPAddress"
220+ // NginxPlusAllowAddress specifies the address type and value for an NginxPlus allow address.
221+ type NginxPlusAllowAddress struct {
222+ // Type specifies the type of address.
223+ Type NginxPlusAllowAddressType `json:"type"`
224+
225+ // Value specifies the address value.
226+ Value string `json:"value"`
227+ }
228+
229+ // NginxPlusAllowAddressType specifies the type of address.
230+ // +kubebuilder:validation:Enum=CIDR;IPAddress
231+ type NginxPlusAllowAddressType string
232+
233+ const (
234+ // NginxPlusAllowCIDRAddressType specifies that the address is a CIDR block.
235+ NginxPlusAllowCIDRAddressType NginxPlusAllowAddressType = "CIDR"
205236
206- // HostnameAddressType specifies that the address is a Hostname .
207- HostnameAddressType AddressType = "Hostname "
237+ // NginxPlusAllowIPAddressType specifies that the address is an IP address .
238+ NginxPlusAllowIPAddressType NginxPlusAllowAddressType = "IPAddress "
208239)
209240
210241// NginxLogging defines logging related settings for NGINX.
0 commit comments