mirror of
https://github.com/alibaba/higress.git
synced 2026-03-09 19:20:51 +08:00
267 lines
7.3 KiB
YAML
267 lines
7.3 KiB
YAML
# Copyright (c) 2022 Alibaba Group Holding Ltd.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
annotations:
|
|
name: wasmplugin-transform-request
|
|
namespace: higress-conformance-infra
|
|
spec:
|
|
ingressClassName: higress
|
|
rules:
|
|
- host: "foo1.com"
|
|
http:
|
|
paths:
|
|
- pathType: Prefix
|
|
path: "/"
|
|
backend:
|
|
service:
|
|
name: infra-backend-v1
|
|
port:
|
|
number: 8080
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
annotations:
|
|
name: wasmplugin-transform-response-header-and-query
|
|
namespace: higress-conformance-infra
|
|
spec:
|
|
ingressClassName: higress
|
|
rules:
|
|
- host: "foo2.com"
|
|
http:
|
|
paths:
|
|
- pathType: Prefix
|
|
path: "/"
|
|
backend:
|
|
service:
|
|
name: infra-backend-v1
|
|
port:
|
|
number: 8080
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
annotations:
|
|
name: wasmplugin-transform-request-body
|
|
namespace: higress-conformance-infra
|
|
spec:
|
|
ingressClassName: higress
|
|
rules:
|
|
- host: "foo4.com"
|
|
http:
|
|
paths:
|
|
- pathType: Prefix
|
|
path: "/"
|
|
backend:
|
|
service:
|
|
name: infra-backend-v1
|
|
port:
|
|
number: 8080
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
annotations:
|
|
name: wasmplugin-transform-response-body
|
|
namespace: higress-conformance-infra
|
|
spec:
|
|
ingressClassName: higress
|
|
rules:
|
|
- host: "foo5.com"
|
|
http:
|
|
paths:
|
|
- pathType: Prefix
|
|
path: "/"
|
|
backend:
|
|
service:
|
|
name: infra-backend-echo-body-v1
|
|
port:
|
|
number: 8080
|
|
---
|
|
apiVersion: extensions.higress.io/v1alpha1
|
|
kind: WasmPlugin
|
|
metadata:
|
|
name: transformer
|
|
namespace: higress-system
|
|
spec:
|
|
matchRules:
|
|
# request transformer
|
|
- ingress:
|
|
- higress-conformance-infra/wasmplugin-transform-request
|
|
configDisable: false
|
|
config:
|
|
type: request
|
|
rules:
|
|
- operate: remove
|
|
headers:
|
|
- key: X-remove
|
|
querys:
|
|
- key: k1
|
|
- operate: rename
|
|
headers:
|
|
- key: X-not-renamed
|
|
value: X-renamed
|
|
querys:
|
|
- key: k2
|
|
value: k2-new
|
|
- operate: replace
|
|
headers:
|
|
- key: X-replace
|
|
value: replaced
|
|
querys:
|
|
- key: k2-new
|
|
value: v2-new
|
|
- operate: add
|
|
headers:
|
|
- key: X-add-append
|
|
value: add
|
|
querys:
|
|
- key: k3
|
|
value: v31
|
|
- operate: append
|
|
headers:
|
|
- key: X-add-append
|
|
value: append
|
|
querys:
|
|
- key: k3
|
|
value: v32
|
|
- operate: map
|
|
headers:
|
|
- key: X-add-append
|
|
value: X-map
|
|
querys:
|
|
- key: k3
|
|
value: k4
|
|
- operate: dedupe
|
|
headers:
|
|
- key: X-dedupe-first
|
|
value: RETAIN_FIRST
|
|
- key: X-dedupe-last
|
|
value: RETAIN_LAST
|
|
- key: X-dedupe-unique
|
|
value: RETAIN_UNIQUE
|
|
querys:
|
|
- key: k4
|
|
value: RETAIN_FIRST
|
|
|
|
- ingress:
|
|
- higress-conformance-infra/wasmplugin-transform-response-header-and-query
|
|
configDisable: false
|
|
config:
|
|
type: response
|
|
rules:
|
|
- operate: remove
|
|
headers:
|
|
- key: X-remove
|
|
- operate: rename
|
|
headers:
|
|
- key: X-not-renamed
|
|
value: X-renamed
|
|
- operate: replace
|
|
headers:
|
|
- key: X-replace
|
|
value: replace-$1
|
|
path_pattern: ^.*?\/(\w+)[\?]{0,1}.*$
|
|
- operate: add
|
|
headers:
|
|
- key: X-add-append
|
|
value: add-$1
|
|
host_pattern: ^(.*)\.com$
|
|
- operate: append
|
|
headers:
|
|
- key: X-add-append
|
|
value: append-$1
|
|
path_pattern: ^\/get\/(.*)\.html$
|
|
- operate: map
|
|
headers:
|
|
- key: X-add-append
|
|
value: X-map
|
|
- ingress:
|
|
- higress-conformance-infra/wasmplugin-transform-request-body
|
|
configDisable: false
|
|
config:
|
|
type: request
|
|
rules:
|
|
- operate: remove
|
|
body:
|
|
- key: X-removed
|
|
- operate: rename
|
|
body:
|
|
- key: X-not-renamed
|
|
value: X-renamed
|
|
- operate: replace
|
|
body:
|
|
- key: X-replace
|
|
value: replaced
|
|
- operate: add
|
|
body:
|
|
- key: X-add-append
|
|
value: add
|
|
- operate: append
|
|
body:
|
|
- key: X-add-append
|
|
value: append
|
|
- operate: map
|
|
body:
|
|
- key: X-add-append
|
|
value: X-map
|
|
- operate: dedupe
|
|
body:
|
|
- key: X-dedupe-first
|
|
value: RETAIN_FIRST
|
|
- key: X-dedupe-last
|
|
value: RETAIN_LAST
|
|
- key: X-dedupe-unique
|
|
value: RETAIN_UNIQUE
|
|
- ingress:
|
|
- higress-conformance-infra/wasmplugin-transform-response-body
|
|
configDisable: false
|
|
config:
|
|
type: response
|
|
rules:
|
|
- operate: remove
|
|
body:
|
|
- key: X-removed
|
|
- operate: rename
|
|
body:
|
|
- key: X-not-renamed
|
|
value: X-renamed
|
|
- operate: replace
|
|
body:
|
|
- key: X-replace
|
|
value: replaced
|
|
- operate: add
|
|
body:
|
|
- key: X-add-append
|
|
value: add
|
|
- operate: append
|
|
body:
|
|
- key: X-add-append
|
|
value: append
|
|
- operate: map
|
|
body:
|
|
- key: X-add-append
|
|
value: X-map
|
|
- operate: dedupe
|
|
body:
|
|
- key: X-dedupe-first
|
|
value: RETAIN_FIRST
|
|
- key: X-dedupe-last
|
|
value: RETAIN_LAST
|
|
- key: X-dedupe-unique
|
|
value: RETAIN_UNIQUE
|
|
url: file:///opt/plugins/wasm-go/extensions/transformer/plugin.wasm |