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
+21-18Lines changed: 21 additions & 18 deletions
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) || has(self.geoLocation))",message="at least one of clientCIDRs, jwt, headers, or geoLocation must be specified"
75
+
// +kubebuilder:validation:XValidation:rule="(has(self.clientCIDRs) || has(self.jwt) || has(self.headers) || has(self.geoLocations))",message="at least one of clientCIDRs, jwt, headers, or geoLocations 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"
@@ -129,40 +129,43 @@ type Principal struct {
129
129
// +notImplementedHide
130
130
SourceCIDRs []CIDR`json:"sourceCIDRs,omitempty"`
131
131
132
-
// GeoLocation authorizes the request based on geolocation metadata derived from the client IP.
132
+
// GeoLocations authorizes the request based on geolocation metadata derived from the client IP.
133
+
// If multiple entries are specified, one of the GeoLocation entries must match for the rule to match.
// GeoLocationPrincipal specifies geolocation-based match criteria for authorization.
141
+
// GeoLocation specifies geolocation-based match criteria for authorization.
140
142
//
141
-
// +kubebuilder:validation:XValidation:rule="(has(self.countries) || has(self.regions) || has(self.cities) || has(self.asns) || has(self.anonymous))",message="at least one of countries, regions, cities, asns, or anonymous must be specified"
142
-
typeGeoLocationPrincipalstruct {
143
-
// Countries is a list of ISO 3166-1 alpha-2 country codes.
143
+
// +kubebuilder:validation:XValidation:rule="(has(self.country) ? 1 : 0) + (has(self.region) ? 1 : 0) + (has(self.city) ? 1 : 0) + (has(self.asn) ? 1 : 0) + (has(self.isp) ? 1 : 0) + (has(self.anonymous) ? 1 : 0) == 1",message="exactly one of country, region, city, asn, isp, or anonymous must be specified"
144
+
typeGeoLocationstruct {
145
+
// Country is the country associated with the client IP.
144
146
//
145
147
// +optional
146
-
// +kubebuilder:validation:MinItems=1
147
-
Countries []string`json:"countries,omitempty"`
148
+
Country*string`json:"country,omitempty"`
148
149
149
-
// Regions refines matching to ISO 3166-2 subdivisions.
150
+
// Region is the region associated with the client IP.
150
151
//
151
152
// +optional
152
-
// +kubebuilder:validation:MinItems=1
153
-
Regions []GeoIPRegion`json:"regions,omitempty"`
153
+
Region*string`json:"region,omitempty"`
154
154
155
-
// Cities refines matching to specific city names.
155
+
// City is the city associated with the client IP.
156
156
//
157
157
// +optional
158
-
// +kubebuilder:validation:MinItems=1
159
-
Cities []GeoIPCity`json:"cities,omitempty"`
158
+
City*string`json:"city,omitempty"`
160
159
161
-
// ASNs matches the autonomous system numbers associated with the client IP.
160
+
// ASN is the autonomous system number associated with the client IP.
162
161
//
163
162
// +optional
164
-
// +kubebuilder:validation:MinItems=1
165
-
ASNs []uint32`json:"asns,omitempty"`
163
+
ASN*uint32`json:"asn,omitempty"`
164
+
165
+
// ISP is the internet service provider associated with the client IP.
0 commit comments