diff --git a/plugins/README.md b/plugins/README.md index 5ee6dc226..66f7ed5e9 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -27,7 +27,7 @@ 例如用如下配置使用 request-block 插件 的 1.0.0 版本: ```yaml -apiVersion: extensions.istio.io/v1alpha1 +apiVersion: extensions.higress.io/v1alpha1 kind: WasmPlugin metadata: name: request-block @@ -36,7 +36,7 @@ spec: selector: matchLabels: higress: higress-system-higress-gateway - pluginConfig: + defaultConfig: block_urls: - "swagger.html" url: oci://higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/request-block:1.0.0 diff --git a/plugins/wasm-go/README.md b/plugins/wasm-go/README.md index 71fe232d0..fc51b5f30 100644 --- a/plugins/wasm-go/README.md +++ b/plugins/wasm-go/README.md @@ -34,7 +34,7 @@ docker push /request-block:1.0.0 ### step3. 创建 WasmPlugin 资源 ```yaml -apiVersion: extensions.istio.io/v1alpha1 +apiVersion: extensions.higress.io/v1alpha1 kind: WasmPlugin metadata: name: request-block @@ -43,7 +43,7 @@ spec: selector: matchLabels: higress: higress-system-higress-gateway - pluginConfig: + defaultConfig: block_urls: - "swagger.html" url: oci:///request-block:1.0.0 @@ -70,7 +70,7 @@ content-length: 0 ## 路由级或域名级生效 ```yaml -apiVersion: extensions.istio.io/v1alpha1 +apiVersion: extensions.higress.io/v1alpha1 kind: WasmPlugin metadata: name: request-block @@ -79,29 +79,32 @@ spec: selector: matchLabels: higress: higress-system-higress-gateway - pluginConfig: + defaultConfig: # 跟上面例子一样,这个配置会全局生效,但如果被下面规则匹配到,则会改为执行命中规则的配置 block_urls: - "swagger.html" - _rules_: + matchRules: # 路由级生效配置 - - _match_route_: - - default/foo + - ingress: + - default/foo # default 命名空间下名为 foo 的 ingress 会执行下面这个配置 - block_bodys: - - "foo" - - _match_route_: - - default/bar - # default 命名空间下名为 bar 的 ingress 会执行下面这个配置 - block_bodys: - - "bar" + config: + block_bodys: + - "foo" + - ingress: + - default/bar + # default 命名空间下名为 bar 的 ingress 会执行下面这个配置 + config: + block_bodys: + - "bar" # 域名级生效配置 - - _match_domain_: - - "*.example.com" - # 若请求匹配了上面的域名, 会执行下面这个配置 - block_bodys: - - "foo" - - "bar" + - domain: + - "*.example.com" + # 若请求匹配了上面的域名, 会执行下面这个配置 + config: + block_bodys: + - "foo" + - "bar" url: oci:///request-block:1.0.0 ``` diff --git a/plugins/wasm-go/README_EN.md b/plugins/wasm-go/README_EN.md index f4d640466..da03938e6 100644 --- a/plugins/wasm-go/README_EN.md +++ b/plugins/wasm-go/README_EN.md @@ -33,7 +33,7 @@ docker push /request-block:1.0.0 Read this [document](https://istio.io/latest/docs/reference/config/proxy_extensions/wasm-plugin/) to learn more about wasmplugin. ```yaml -apiVersion: extensions.istio.io/v1alpha1 +apiVersion: extensions.higress.io/v1alpha1 kind: WasmPlugin metadata: name: request-block @@ -42,7 +42,7 @@ spec: selector: matchLabels: higress: higress-system-higress-gateway - pluginConfig: + defaultConfig: block_urls: - "swagger.html" url: oci:///request-block:1.0.0 @@ -64,7 +64,7 @@ content-length: 0 ## route-level & domain-level takes effect ```yaml -apiVersion: extensions.istio.io/v1alpha1 +apiVersion: extensions.higress.io/v1alpha1 kind: WasmPlugin metadata: name: request-block @@ -73,29 +73,32 @@ spec: selector: matchLabels: higress: higress-system-higress-gateway - pluginConfig: + defaultConfig: # this config will take effect globally (all incoming requests not matched by rules below) block_urls: - "swagger.html" - _rules_: - # route-level takes effect - - _match_route_: - - default/foo - # the ingress foo in namespace default will use this config - block_bodys: - - "foo" - - _match_route_: - - default/bar - # the ingress bar in namespace default will use this config - block_bodys: - - "bar" - # domain-level takes effect - - _match_domain_: - - "*.example.com" - # if the request's domain matched, this config will be used - block_bodys: - - "foo" - - "bar" + matchRules: + # ingress-level takes effect + - ingress: + - default/foo + # the ingress foo in namespace default will use this config + config: + block_bodys: + - "foo" + - ingress: + - default/bar + # the ingress bar in namespace default will use this config + config: + block_bodys: + - "bar" + # domain-level takes effect + - domain: + - "*.example.com" + # if the request's domain matched, this config will be used + config: + block_bodys: + - "foo" + - "bar" url: oci:///request-block:1.0.0 ```