forked from envoyproxy/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the Merge behavior to Replace for SecurityPolicy (envoyproxy#2885
) * Change the Merge behavior to Replace for SecurityPolicy Signed-off-by: huabing zhao <[email protected]> * add another http route Signed-off-by: huabing zhao <[email protected]> --------- Signed-off-by: huabing zhao <[email protected]>
- Loading branch information
1 parent
4c7c008
commit 01bea8b
Showing
3 changed files
with
451 additions
and
1 deletion.
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
117 changes: 117 additions & 0 deletions
117
internal/gatewayapi/testdata/securitypolicy-override-replace.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,117 @@ | ||
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: default | ||
name: httproute-1 | ||
spec: | ||
hostnames: | ||
- gateway.envoyproxy.io | ||
parentRefs: | ||
- namespace: envoy-gateway | ||
name: gateway-1 | ||
sectionName: http | ||
rules: | ||
- matches: | ||
- path: | ||
value: "/foo" | ||
backendRefs: | ||
- name: service-1 | ||
port: 8080 | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
namespace: default | ||
name: httproute-2 | ||
spec: | ||
hostnames: | ||
- gateway.envoyproxy.io | ||
parentRefs: | ||
- namespace: envoy-gateway | ||
name: gateway-1 | ||
sectionName: http | ||
rules: | ||
- matches: | ||
- path: | ||
value: "/bar" | ||
backendRefs: | ||
- name: service-1 | ||
port: 8080 | ||
securityPolicies: | ||
- apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: SecurityPolicy | ||
metadata: | ||
namespace: envoy-gateway | ||
name: policy-for-gateway-1 | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: Gateway | ||
name: gateway-1 | ||
namespace: envoy-gateway | ||
cors: | ||
allowOrigins: | ||
- "http://*.example.com" | ||
- "http://foo.bar.com" | ||
- "https://*" | ||
allowMethods: | ||
- GET | ||
- POST | ||
allowHeaders: | ||
- "x-header-1" | ||
- "x-header-2" | ||
exposeHeaders: | ||
- "x-header-3" | ||
- "x-header-4" | ||
maxAge: 1000s | ||
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 | ||
- apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: SecurityPolicy | ||
metadata: | ||
namespace: default | ||
name: policy-for-route-1 | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
name: httproute-1 | ||
namespace: default | ||
cors: | ||
allowOrigins: | ||
- "https://*.test.com:8080" | ||
- "https://www.test.org:8080" | ||
allowMethods: | ||
- GET | ||
- POST | ||
allowHeaders: | ||
- "x-header-5" | ||
- "x-header-6" | ||
exposeHeaders: | ||
- "x-header-7" | ||
- "x-header-8" | ||
maxAge: 2000s |
Oops, something went wrong.