Currently, If you try to create an HTTPRoute with a basic ExternalAuth filter, like so:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: hello-rest
spec:
parentRefs:
- name: hello-rest
rules:
- filters:
- type: ExternalAuth
externalAuth:
protocol: GRPC
backendRef:
kind: Service
name: external-oauth2
port: 8080
backendRefs:
- name: hello-rest
port: 8080
... you will get a validation error:
The HTTPRoute "hello-rest" is invalid: spec.rules[0].filters[0].externalAuth: Invalid value: grpc must be specified when protocol is set to 'GRPC'
The validation is in HTTPExternalAuthFilter.
However, on reading the docs for GRPCAuthConfig all its (1) attributes are optional, and explicitly states a default behavior: "If this list is empty, then all headers must be sent." The same goes for HTTPAuthConfig. As it stands, if an Application Developer wants to create a HTTPRoute with default behavior, they need to add a grpc: {allowedHeaders: ~} or similar no-op to satisfy the validation.
I think we are unlikely to add mandatory attributes to HTTPAuthConfig/GRPCAuthConfig in the future, so probably the validation rule should be removed?
Currently, If you try to create an HTTPRoute with a basic ExternalAuth filter, like so:
... you will get a validation error:
The validation is in HTTPExternalAuthFilter.
However, on reading the docs for GRPCAuthConfig all its (1) attributes are optional, and explicitly states a default behavior: "If this list is empty, then all headers must be sent." The same goes for HTTPAuthConfig. As it stands, if an Application Developer wants to create a HTTPRoute with default behavior, they need to add a
grpc: {allowedHeaders: ~}or similar no-op to satisfy the validation.I think we are unlikely to add mandatory attributes to HTTPAuthConfig/GRPCAuthConfig in the future, so probably the validation rule should be removed?