-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support custom HTTP filter ordering (#3273)
* Support custom HTTP filter ordering. Signed-off-by: huabing zhao <zhaohuabing@gmail.com> * address comments Signed-off-by: huabing zhao <zhaohuabing@gmail.com> * address comments Signed-off-by: huabing zhao <zhaohuabing@gmail.com> * add comments Signed-off-by: huabing zhao <zhaohuabing@gmail.com> * add comments Signed-off-by: huabing zhao <zhaohuabing@gmail.com> * minor wording Signed-off-by: huabing zhao <zhaohuabing@gmail.com> --------- Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
- Loading branch information
1 parent
4c52f10
commit d048a9f
Showing
25 changed files
with
1,380 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
internal/gatewayapi/testdata/custom-filter-order.in.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
secrets: | ||
- apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
namespace: envoy-gateway | ||
name: users-secret1 | ||
data: | ||
.htpasswd: "dXNlcjE6e1NIQX10RVNzQm1FL3lOWTNsYjZhMEw2dlZRRVpOcXc9CnVzZXIyOntTSEF9RUo5TFBGRFhzTjl5blNtYnh2anA3NUJtbHg4PQo=" | ||
envoyproxy: | ||
apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyProxy | ||
metadata: | ||
name: custom-proxy-config | ||
namespace: envoy-gateway-system | ||
spec: | ||
filterOrder: | ||
- name: envoy.filters.http.wasm | ||
before: envoy.filters.http.jwt_authn | ||
- name: envoy.filters.http.cors | ||
after: envoy.filters.http.basic_authn | ||
gateways: | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
namespace: envoy-gateway | ||
name: gateway-1 | ||
spec: | ||
gatewayClassName: envoy-gateway-class | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 | ||
allowedRoutes: | ||
namespaces: | ||
from: All | ||
httpRoutes: | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
namespace: envoy-gateway | ||
name: httproute-1 | ||
spec: | ||
hostnames: | ||
- www.example.com | ||
parentRefs: | ||
- namespace: envoy-gateway | ||
name: gateway-1 | ||
sectionName: http | ||
rules: | ||
- matches: | ||
- path: | ||
value: "/foo" | ||
backendRefs: | ||
- name: service-1 | ||
port: 8080 | ||
securityPolicies: | ||
- apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: SecurityPolicy | ||
metadata: | ||
namespace: envoy-gateway | ||
name: policy-for-gateway | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: Gateway | ||
name: gateway-1 | ||
namespace: envoy-gateway | ||
cors: | ||
allowOrigins: | ||
- "https://*.test.com:8080" | ||
- "https://www.test.org:8080" | ||
allowMethods: | ||
- GET | ||
- POST | ||
basicAuth: | ||
users: | ||
name: "users-secret1" | ||
jwt: | ||
providers: | ||
- name: example1 | ||
issuer: https://one.example.com | ||
audiences: | ||
- one.foo.com | ||
remoteJWKS: | ||
uri: https://one.example.com/jwt/public-key/jwks.json | ||
claimToHeaders: | ||
- header: one-route-example-key | ||
claim: claim1 | ||
- name: example2 | ||
issuer: http://two.example.com | ||
audiences: | ||
- two.foo.com | ||
remoteJWKS: | ||
uri: http://two.example.com/jwt/public-key/jwks.json | ||
claimToHeaders: | ||
- header: two-route-example-key | ||
claim: claim2 | ||
envoyextensionpolicies: | ||
- apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: EnvoyExtensionPolicy | ||
metadata: | ||
namespace: envoy-gateway | ||
name: policy-for-gateway # This policy should attach httproute-2 | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: Gateway | ||
name: gateway-1 | ||
namespace: envoy-gateway | ||
wasm: | ||
- name: wasm-filter-1 | ||
code: | ||
type: HTTP | ||
http: | ||
url: https://www.example.com/wasm-filter-1.wasm | ||
sha256: 746df05c8f3a0b07a46c0967cfbc5cbe5b9d48d0f79b6177eeedf8be6c8b34b5 | ||
config: | ||
parameter1: | ||
key1: value1 | ||
key2: value2 | ||
parameter2: value3 | ||
- name: wasm-filter-2 | ||
code: | ||
type: HTTP | ||
http: | ||
url: https://www.example.com/wasm-filter-2.wasm | ||
sha256: a1efca12ea51069abb123bf9c77889fcc2a31cc5483fc14d115e44fdf07c7980 | ||
config: | ||
parameter1: value1 | ||
parameter2: value2 |
Oops, something went wrong.