Skip to content

Commit

Permalink
Format and fix some typo for document (#171)
Browse files Browse the repository at this point in the history
* update http-proxy

* update sofa-rpc-proxy

* update spring-cloud-proxy

* update request-plugin

* update context-path-plugin

* update param-mapping-plugin

* update param-mapping-plugin

* update divide-plugin

* update spring-cloud-plugin

* update spring-cloud-plugin

* update grpc-plugin

* update tars-plugin

* update motan-plugin

* update Resilience4j plugin

* update rate-limit plugin

* waf plugin

* sign plugin

* update jwt plugin

* update oauth2 plugin

* update monitor plugin

* update custom plugin

* update custom condition match

* update developer shenyu client

* update download

* update resilience4j plugin
  • Loading branch information
Switch-vov committed Aug 1, 2021
1 parent 152138e commit 80fe2ab
Show file tree
Hide file tree
Showing 45 changed files with 393 additions and 327 deletions.
4 changes: 2 additions & 2 deletions content/en/projects/shenyu/context-path-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: context_path plugin

## Explanation

* When making invokes to the target service, Apache ShenYu Gateway also allows users to customize the context using the `context_path` plugin.
* When making invokes to the target service, `Apache ShenYu` Gateway also allows users to customize the `contextPath` using the `context_path` plugin.

## Plugin Setting

Expand All @@ -30,4 +30,4 @@ description: context_path plugin

* As the name suggests,the context_path plugin redefines the contextPath of URI.
* When the request is matched, the custom `contextPath` is set, then the custom `contextPath` will be intercepted according to the requested Url to obtain the real Url, for example, the request path is `/shenyu/http/order`,
The configured contextPath is `/shenyu/http`, then the requested url is `/order`.
The configured contextPath is `/shenyu/http`, then the requested `url` is `/order`.
23 changes: 16 additions & 7 deletions content/en/projects/shenyu/custom-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ description: plugins

* Add following dependency:

```
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-plugin-api</artifactId>
<version>${project.version}</version>
</dependency>
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-plugin-api</artifactId>
<version>${project.version}</version>
</dependency>
```

* Declare a new class named `MyShenyuPlugin` and implements `org.apache.shenyu.plugin.api.ShenyuPlugin`
Expand Down Expand Up @@ -147,8 +147,17 @@ public class CustomPlugin extends AbstractShenyuPlugin {
return false;
}

/**
* this is Template Method child has Implement your own logic.
*
* @param exchange exchange the current server exchange
* @param chain chain the current chain
* @param selector selector
* @param rule rule
* @return {@code Mono<Void>} to indicate when request handling is complete
*/
@Override
protected Mono<Void> doExecute(ServerWebExchange exchange, ShenyuPluginChain chain, SelectorZkDTO selector, RuleZkDTO rule) {
protected abstract Mono<Void> doExecute(ServerWebExchange exchange, ShenyuPluginChain chain, SelectorData selector, RuleData rule) {
LOGGER.debug(".......... function plugin start..............");
/*
* Processing after your selector matches the rule.
Expand Down
24 changes: 12 additions & 12 deletions content/en/projects/shenyu/developer-shenyu-client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ description: A multilingual HTTP client

## Description

* This document focuses on how to access gateways for HTTP services in other languages.
* How to customize the development of shenyu-http-client.
* This document focuses on how to access gateways for `HTTP` services in other languages.
* How to customize the development of `shenyu-http-client`.

## Customize Http Client

Expand All @@ -17,16 +17,16 @@ description: A multilingual HTTP client

```json
{
"appName": "xxx", //required
"context": "/xxx", //required
"path": "xxx", //required
"pathDesc": "xxx",
"rpcType": "http", //required
"host": "xxx", //required
"port": xxx, //required
"ruleName": "xxx", //required
"enabled": "true", //required
"registerMetaData": "true" //required
"appName": "xxx", //required
"context": "/xxx", //required
"path": "xxx", //required
"pathDesc": "xxx",
"rpcType": "http", //required
"host": "xxx", //required
"port": xxx, //required
"ruleName": "xxx", //required
"enabled": "true", //required
"registerMetaData": "true" //required
}
```

Expand Down
2 changes: 1 addition & 1 deletion content/en/projects/shenyu/divide-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Selector Handler, corresponding to the `handle` field of [Selector And Rule Conf

* `ip:port`:IP and port, input your true service `ip` + port here。

* `protocol`::HTTP protocol,input `http://` or `https://` ,default is:`http://`
* `protocol`::`HTTP` protocol,input `http://` or `https://` ,default is:`http://`

* `startupTime`: enabling the time。

Expand Down
31 changes: 24 additions & 7 deletions content/en/projects/shenyu/download/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,40 @@ description: Doc Download

## Latest Releases

Apache ShenYu is released as source code tarballs with corresponding binary tarballs for convenience.
`Apache ShenYu` is released as source code tarballs with corresponding binary tarballs for convenience.

`Apache ShenYu - Version: 2.3.0 ( Release Date: Apr 2, 2020 )`

- Source Codes: [zip](https://codeload.github.com/dromara/shenyu/zip/refs/tags/2.3.0) [tar](https://codeload.github.com/dromara/shenyu/tar.gz/refs/tags/2.3.0)
- ShenYu-admin Binary Distribution: [tar](https://github-releases.githubusercontent.com/140543886/f562c480-9cb0-11eb-9f97-e6827c849866?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210530T170904Z&X-Amz-Expires=300&X-Amz-Signature=596b480f34f09707d759f249c4e7d5d2816d4fc9eefbc5026061a8d84a4ecf52&X-Amz-SignedHeaders=host&actor_id=13451528&key_id=0&repo_id=140543886&response-content-disposition=attachment%3B%20filename%3Dsoul-admin-bin-2.3.0-RELEASE.tar.gz&response-content-type=application%2Foctet-stream)
- ShenYu-bootstrap Binary Distribution: [tar](https://github-releases.githubusercontent.com/140543886/08759480-9cb1-11eb-9b09-974bc0c79c4c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210530T170847Z&X-Amz-Expires=300&X-Amz-Signature=77f7718e6e46a8561024e25dc2669ea30005aa89c878a9f665edbb922762d6a6&X-Amz-SignedHeaders=host&actor_id=13451528&key_id=0&repo_id=140543886&response-content-disposition=attachment%3B%20filename%3Dsoul-bootstrap-bin-2.3.0-RELEASE.tar.gz&response-content-type=application%2Foctet-stream)
* Source Codes

* [zip](https://codeload.github.com/dromara/shenyu/zip/refs/tags/2.3.0)

* [tar](https://codeload.github.com/dromara/shenyu/tar.gz/refs/tags/2.3.0)

* `ShenYu-admin` Binary Distribution

* [tar](https://github-releases.githubusercontent.com/140543886/f562c480-9cb0-11eb-9f97-e6827c849866?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210530T170904Z&X-Amz-Expires=300&X-Amz-Signature=596b480f34f09707d759f249c4e7d5d2816d4fc9eefbc5026061a8d84a4ecf52&X-Amz-SignedHeaders=host&actor_id=13451528&key_id=0&repo_id=140543886&response-content-disposition=attachment%3B%20filename%3Dsoul-admin-bin-2.3.0-RELEASE.tar.gz&response-content-type=application%2Foctet-stream)

* `ShenYu-bootstrap` Binary Distribution

* [tar](https://github-releases.githubusercontent.com/140543886/08759480-9cb1-11eb-9b09-974bc0c79c4c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210530T170847Z&X-Amz-Expires=300&X-Amz-Signature=77f7718e6e46a8561024e25dc2669ea30005aa89c878a9f665edbb922762d6a6&X-Amz-SignedHeaders=host&actor_id=13451528&key_id=0&repo_id=140543886&response-content-disposition=attachment%3B%20filename%3Dsoul-bootstrap-bin-2.3.0-RELEASE.tar.gz&response-content-type=application%2Foctet-stream)

`Apache ShenYu Dashboard - Version: 2.3.0 ( Release Date: Apr 2, 2020 )`

- Source Codes: [zip](https://codeload.github.com/dromara/shenyu-dashboard/zip/refs/tags/2.3.0) [tar](https://codeload.github.com/dromara/shenyu-dashboard/tar.gz/refs/tags/2.3.0)
- ShenYu-dashboard Binary Distribution: [tar](https://github-releases.githubusercontent.com/141903742/4fbdbd00-96d4-11eb-92f4-fead1958fd5c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210530T170738Z&X-Amz-Expires=300&X-Amz-Signature=60abef3f1ee0f4c7ad0311a2a5ce2acbd573cb4af5c522b79f8297ff29fcd631&X-Amz-SignedHeaders=host&actor_id=13451528&key_id=0&repo_id=141903742&response-content-disposition=attachment%3B%20filename%3Dsoul-dashboard-2.3.0-dist.zip&response-content-type=application%2Foctet-stream)
* Source Codes

* [zip](https://codeload.github.com/dromara/shenyu-dashboard/zip/refs/tags/2.3.0)

* [tar](https://codeload.github.com/dromara/shenyu-dashboard/tar.gz/refs/tags/2.3.0)

* `ShenYu-dashboard` Binary Distribution

* [tar](https://github-releases.githubusercontent.com/141903742/4fbdbd00-96d4-11eb-92f4-fead1958fd5c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210530%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210530T170738Z&X-Amz-Expires=300&X-Amz-Signature=60abef3f1ee0f4c7ad0311a2a5ce2acbd573cb4af5c522b79f8297ff29fcd631&X-Amz-SignedHeaders=host&actor_id=13451528&key_id=0&repo_id=141903742&response-content-disposition=attachment%3B%20filename%3Dsoul-dashboard-2.3.0-dist.zip&response-content-type=application%2Foctet-stream)


## PDF

Apache ShenYu provides a packaged and downloaded PDF of the blog for users and developers to use.
`Apache ShenYu` provides a packaged and downloaded `PDF` of the blog for users and developers to use.

* [English](/pdf/apache_shenyu_docs_en.pdf)

8 changes: 5 additions & 3 deletions content/en/projects/shenyu/grpc-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Selector Handler, the `handle` field, is the processing operation that the gatew

* config details:

* `ip:port`:enter the ip:port of your real service .

* `protocol`:indicates the Http protocol. Generally, the value is `http://` or `https://`. If the value is not specified, the default value is `http://` .
Expand Down Expand Up @@ -63,8 +62,11 @@ Each `grpc` interface method, will correspond to a metadata, when the `grpc` app

* RpcExpand: other configurations of the `grpc` interface, which support the `JSON` format, are as follows:

```yaml
{"timeout":5000,"methodType":"SERVER_STREAMING"}
```json
{
"timeout": 5000,
"methodType": "SERVER_STREAMING"
}
```

* Interface: The fully qualified class name of the `grpc` interface.
Expand Down
17 changes: 9 additions & 8 deletions content/en/projects/shenyu/http-proxy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ Please refer this:[shenyu-examples-http](https://github.com/apache/incubator-s


Add this annotation `@ShenyuSpringMvcClient` in your `controller` interface.
You can apply the annotation to class-level in a controller.the name of the path variable is prefix and `/**` will apply proxy for entire interfaces.

You can apply the annotation to class-level in a controller. The name of the `path` variable is prefix and `/**` will apply proxy for entire interfaces.


Example(1)
Expand Down Expand Up @@ -150,22 +151,22 @@ The following indicates that `/order/save` is proxied by the gateway, while `/or
* Start your project, your service interface is connected to the gateway, go to the `shenyu-admin` management system plugin list `->` HTTP process `->` Divide, see automatically created selectors and rules.


## Http request access gatewayother framework
## Http request access gateway(other framework)

* First of all, find divide plugin in `shenyu-admin`, add selector, and rules, and filter traffic matching.
* First, find `divide` plugin in `shenyu-admin`, add selector, and rules, and filter traffic matching.
* If you don't know how to configure, please refer to [Selector Detailed Explanation](../selector-and-rule).
* You can also develop your cutomized http-client,refer to [multi-language Http client development](../developer-shenyu-client)
* You can also develop your customized http-client,refer to [multi-language Http client development](../developer-shenyu-client)

## User request

* Send the request as before, only two points need to notice.
* Firstly, the domain name that requested before in your service, now need to replace with gateway's domain name.
* Secondly, Apache ShenYu Gateway needs a route prefix which comes from `contextPath`, it configured during the integration with gateway, you can change it freely in divide plugin of `shenyu-admin`, if you are familiar with it.
* for example, if you have an order service and it has a interface, the request url: http://localhost:8080/test/save
* Secondly, `Apache ShenYu` Gateway needs a route prefix which comes from `contextPath`, it configured during the integration with gateway, you can change it freely in `divide` plugin of `shenyu-admin`, if you are familiar with it.
* for example, if you have an `order` service, and it has an interface, the request url: `http://localhost:8080/test/save`

* Now need to change to: http://localhost:9195/order/test/save
* Now need to change to: `http://localhost:9195/order/test/save`

* We can see localhost:9195 is your gateway's ip port,default port number is 9195/order is your contextPath which you configured with gateway.
* We can see `localhost:9195` is your gateway's `ip` port,default port number is `9195``/order` is your `contextPath` which you configured with gateway.

* Other parameters doesn't change in request method.

Expand Down
24 changes: 12 additions & 12 deletions content/en/projects/shenyu/jwt-plugin/index.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
---
title: Jwt plugin
keywords: Jwt
description: Jwt plugin
---
title: JWT plugin
keywords: JWT
description: JWT plugin
----------------------

## Description

* The jwt plug-in is for the `token` attribute or `authorization` of the http request header to carry the attribute value for authentication judgment and judge OAuth2.0 .
* The `jwt` plug-in is for the `token` attribute or `authorization` of the http request header to carry the attribute value for authentication judgment and judge `OAuth2.0` .

## Plugin Setting

Please refer to the `deployment` document, choose a way to start `shenyu-admin`. For example, through [Local Deployment](../deployment-local) to start the `Apache ShenYu` management system .

* In `shenyu-admin` BasicConfig --> plugin -> `jwt` set to enable.If you don't want to use this function, please disable this plugin in the `shenyu-admin`.
* In `shenyu-admin` BasicConfig --> plugin -> `jwt` set to enable. If you don't want to use this function, please disable this plugin in the `shenyu-admin`.

<img src="/img/shenyu/plugin/jwt/jwt_open_en.jpg" width="80%" height="80%" />

* Add configuration mode in plugin editing.

`{"secretKey":"","filterPath":[]} `
* `{"secretKey":"","filterPath":[]}`

- secretKey: The private key when using jwt to generate token, it is required.
* `secretKey`: The private key when using `jwt` to generate `token`, it is required.

- filterPath:Authentication whitelist list, fill in the API path of the request interface.
* `filterPath`:Authentication whitelist list, fill in the API path of the request interface.

e.g. http://127.0.0.1:8080/cloud/shenyu , filterPath just add `/cloud/shenyu`.
* e.g. `http://127.0.0.1:8080/cloud/shenyu` , filterPath just add `/cloud/shenyu`.

## Plugin Use

* Add support for `jwt` in the pom.xml file of the gateway.
* Add support for `jwt` in the `pom.xml` file of the gateway.

```xml
<!-- apache shenyu jwt plugin start-->
Expand All @@ -40,8 +40,8 @@ Please refer to the `deployment` document, choose a way to start `shenyu-admin`.
<!-- apache shenyu jwt plugin end-->
```
* For more instructions on selector and rule configuration, please refer to: [Selector And Rule Config](../selector-and-rule).

* For more instructions on selector and rule configuration, please refer to: [Selector And Rule Config](../selector-and-rule).

## Situation

Expand Down
26 changes: 12 additions & 14 deletions content/en/projects/shenyu/modify-response-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: modifyResponse Plugin

## Description

* `modifyResponse` is a native plugin of Apache ShenYu gateway and is used to edit response header and body and statusCode.
* `modifyResponse` is a native plugin of `Apache ShenYu` gateway and is used to edit response header and body and statusCode.



Expand All @@ -29,9 +29,7 @@ description: modifyResponse Plugin
```

* Selectors and rules, please refer to:[Selector And Rule Config](../selector-and-rule)

* only those matched requests can be modify response.

* only those matched requests can be modified response.

## ModifyResponsePlugin Guide
* 1.Configuration selector
Expand All @@ -43,16 +41,16 @@ description: modifyResponse Plugin
* 5.modify response body
![](/img/shenyu/plugin/modify-response/modifyBody-en.png)
* param details:
* addHeaders: add response header,key-value.
* setHeaders: set response header,key-value.
* replaceHeaderKeys: replace response header name,key is the value to be replaced,value is the value after replacement
* removeHeaderKeys: remove response header key
* statusCode: response status code
* addBodyKeys: add response body
* replaceBodyKeys: replace response body ,key is the value to be replaced,value is the value after replacement
* removeBodyKeys: remove response body key

modify response body is achieved through JSONPath,`$.` represents the root directory.
* `addHeaders`: add response header,`key-value`.
* `setHeaders`: set response header,`key-value`.
* `replaceHeaderKeys`: replace response header name,`key` is the value to be replaced,`value` is the value after replacement
* `removeHeaderKeys`: remove response header `key`
* `statusCode`: response status code
* `addBodyKeys`: add response body
* `replaceBodyKeys`: replace response body ,`key` is the value to be replaced,`value` is the value after replacement
* `removeBodyKeys`: remove response body `key`

modify response body is achieved through `JSONPath` , `$.` represents the root directory.

use the configuration,unopened the plugin,response body is
```json
Expand Down
4 changes: 2 additions & 2 deletions content/en/projects/shenyu/monitor-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ description: monitor plugin
* Add the following configuration in the monitor plugin.

```yaml
{"metricsName":"prometheus","host":"localhost","port":"9191","async":"true"}
{"metricsName":"prometheus","host":"localhost","port":"9190","async":"true"}

# port : Pulled ports for exposing to prometheus service.
# host : If not filled in, it is the host of Apache ShenYu Gateway.
Expand All @@ -46,7 +46,7 @@ description: monitor plugin

## Metrics Detail

* All JVM,thread,memory,and other related infomation will be made event tracking,you can add a JVM module in the Granfana' panel, and it will be fully displayed, please refer to: https://github.com/prometheus/jmx_exporter
* All JVM,thread,memory,and other related information will be made event tracking,you can add a JVM module in the Grafana' panel, and it will be fully displayed, please refer to: https://github.com/prometheus/jmx_exporter

* There are also the following custom `metrics`

Expand Down
4 changes: 2 additions & 2 deletions content/en/projects/shenyu/motan-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ description: motan-plugin

## Plugin Detail

After the client accesses the `Apache ShenYu` gateway, it will automatically register the selector and rule information.

After the client accesses the `Apache ShenYu` gateway, it will automatically register the selector and rule information. You can see it in PluginList -> rpc proxy -> motan. For details about the selector and rule configuration, see [Selector And Rule Config](../selector-and-rule) .

You can see it in PluginList -> rpc proxy -> motan. For details about the selector and rule configuration, see [Selector And Rule Config](../selector-and-rule) .

## Metadata

Expand Down

0 comments on commit 80fe2ab

Please sign in to comment.