You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v1alpha1/authorization_types.go
+55-1Lines changed: 55 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ type Operation struct {
72
72
// or any other identity that can be extracted from a custom header.
73
73
// If there are multiple principal types, all principals must match for the rule to match.
74
74
//
75
-
// +kubebuilder:validation:XValidation:rule="(has(self.clientCIDRs) || has(self.jwt) || has(self.headers))",message="at least one of clientCIDRs, jwt, or headers must be specified"
75
+
// +kubebuilder:validation:XValidation:rule="(has(self.clientCIDRs) || has(self.jwt) || has(self.headers) || has(self.clientIPGeoLocations))",message="at least one of clientCIDRs, jwt, headers, or clientIPGeoLocations must be specified"
76
76
typePrincipalstruct {
77
77
// ClientCIDRs are the IP CIDR ranges of the client.
78
78
// Valid examples are "192.168.1.0/24" or "2001:db8::/64"
@@ -128,6 +128,60 @@ type Principal struct {
128
128
// +kubebuilder:validation:MinItems=1
129
129
// +notImplementedHide
130
130
SourceCIDRs []CIDR`json:"sourceCIDRs,omitempty"`
131
+
132
+
// ClientIPGeoLocations authorizes the request based on geolocation metadata derived from the client IP.
133
+
// If multiple entries are specified, one of the ClientIPGeoLocation entries must match for the rule to match.
// ClientIPGeoLocation specifies geolocation-based match criteria for authorization.
142
+
//
143
+
// +kubebuilder:validation:XValidation:rule="has(self.country) || has(self.region) || has(self.city) || has(self.asn) || has(self.isp) || has(self.anonymous)",message="at least one of country, region, city, asn, isp, or anonymous must be specified"
144
+
typeClientIPGeoLocationstruct {
145
+
// Country is the country ISO code associated with the client IP.
0 commit comments