Skip to content

Commit

Permalink
One-of constraints for fields of AuthConfig v1beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
guicassolato committed Aug 30, 2023
1 parent 86455df commit aca78c6
Show file tree
Hide file tree
Showing 2 changed files with 350 additions and 1 deletion.
175 changes: 174 additions & 1 deletion install/crd/patches/oneof_in_authconfigs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Enables oneOf validation for the identity/metadata/authorization modes
# Enables oneOf validation for the identity/authentication, metadata, authorization, and response fields.

# v1beta1
- op: add
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/identity/items/oneOf
value:
Expand Down Expand Up @@ -162,3 +163,175 @@
selector: {}
value: {}
required: [operator, selector]

# v1beta2
- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/authentication/additionalProperties/oneOf
value:
- properties:
credentials: {}
oauth2Introspection: {}
required: [oauth2Introspection]
- properties:
credentials: {}
jwt: {}
required: [jwt]
- properties:
credentials: {}
apiKey: {}
required: [apiKey]
- properties:
credentials: {}
x509: {}
required: [x509]
- properties:
credentials: {}
kubernetesTokenReview: {}
required: [kubernetesTokenReview]
- properties:
credentials: {}
anonymous: {}
required: [anonymous]
- properties:
credentials: {}
plain: {}
required: [plain]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/metadata/additionalProperties/oneOf
value:
- properties:
userInfo: {}
required: [userInfo]
- properties:
uma: {}
required: [uma]
- properties:
http: {}
required: [http]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/authorization/additionalProperties/oneOf
value:
- properties:
opa: {}
required: [opa]
- properties:
patternMatching: {}
required: [patternMatching]
- properties:
kubernetesSubjectAccessReview: {}
required: [kubernetesSubjectAccessReview]
- properties:
spicedb: {}
required: [spicedb]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/response/properties/success/properties/headers/additionalProperties/oneOf
value:
- properties:
wristband: {}
required: [wristband]
- properties:
json: {}
required: [json]
- properties:
plain: {}
required: [plain]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/response/properties/success/properties/dynamicMetadata/additionalProperties/oneOf
value:
- properties:
wristband: {}
required: [wristband]
- properties:
json: {}
required: [json]
- properties:
plain: {}
required: [plain]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/authorization/additionalProperties/properties/patternMatching/properties/patterns/items/oneOf
value:
- properties:
patternRef: {}
required: [patternRef]
- properties:
operator: {}
selector: {}
value: {}
required: [operator, selector]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/when/items/oneOf
value:
- properties:
patternRef: {}
required: [patternRef]
- properties:
operator: {}
selector: {}
value: {}
required: [operator, selector]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/authentication/additionalProperties/properties/when/items/oneOf
value:
- properties:
patternRef: {}
required: [patternRef]
- properties:
operator: {}
selector: {}
value: {}
required: [operator, selector]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/metadata/additionalProperties/properties/when/items/oneOf
value:
- properties:
patternRef: {}
required: [patternRef]
- properties:
operator: {}
selector: {}
value: {}
required: [operator, selector]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/authorization/additionalProperties/properties/when/items/oneOf
value:
- properties:
patternRef: {}
required: [patternRef]
- properties:
operator: {}
selector: {}
value: {}
required: [operator, selector]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/response/properties/success/properties/headers/additionalProperties/properties/when/items/oneOf
value:
- properties:
patternRef: {}
required: [patternRef]
- properties:
operator: {}
selector: {}
value: {}
required: [operator, selector]

- op: add
path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/response/properties/success/properties/dynamicMetadata/additionalProperties/properties/when/items/oneOf
value:
- properties:
patternRef: {}
required: [patternRef]
- properties:
operator: {}
selector: {}
value: {}
required: [operator, selector]
Loading

0 comments on commit aca78c6

Please sign in to comment.