apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

feat: add support for Gateway API HTTPRouteFilter

Open tao12345666333 opened this issue 1 year ago • 10 comments

HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.

https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPRouteFilter

HTTPRouteFilter can appear in HTTPBackendRef and HTTPRouteRule

Since they support different priorities, we can split the following steps to implement.

  • [ ] HTTPRouteRule

    • [x] Core #1426
      • [x] requestHeaderModifier: RequestHeaderModifier defines a schema for a filter that modifies request headers.
      • [x] requestRedirect: RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
    • [ ] Extended
      • [ ] responseHeaderModifier: ResponseHeaderModifier defines a schema for a filter that modifies response headers.
      • [x] requestMirror: RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored. #1461
      • [ ] urlRewrite: URLRewrite defines a schema for a filter that modifies a request during forwarding.
    • [ ] Implementation-specific
      • [ ] extensionRef: ExtensionRef is an optional, implementation-specific extension to the “filter” behavior. For example, resource “myroutefilter” in group “networking.example.net”). ExtensionRef MUST NOT be used for core and extended filters. NOTE: We do not currently have this plan.
  • [ ] HTTPBackendRef

    • [ ] Core
      • [ ] requestHeaderModifier: RequestHeaderModifier defines a schema for a filter that modifies request headers.
      • [ ] requestRedirect: RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
    • [ ] Extended
      • [ ] responseHeaderModifier: ResponseHeaderModifier defines a schema for a filter that modifies response headers.
      • [ ] requestMirror: RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored.
      • [ ] urlRewrite: URLRewrite defines a schema for a filter that modifies a request during forwarding.
    • [ ] Implementation-specific
      • [ ] extensionRef: ExtensionRef is an optional, implementation-specific extension to the “filter” behavior. For example, resource “myroutefilter” in group “networking.example.net”). ExtensionRef MUST NOT be used for core and extended filters. NOTE: We do not currently have this plan.

tao12345666333 avatar Oct 31 '22 07:10 tao12345666333