Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change(echo): remove odd auth_value #4055

Merged
merged 2 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions apisix/plugins/echo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ local schema = {
type = "object",
minProperties = 1,
},
auth_value = {
description = "auth value",
type = "string"
},
},
anyOf = {
{required = {"before_body"}},
Expand Down
1 change: 0 additions & 1 deletion docs/en/latest/plugins/echo.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ This plugin addresses the corresponding functionality in the common phases such
| body | string | optional | | | Body to replace upstream response. |
| after_body | string | optional | | | Body after the modification of filter phase. |
| headers | object | optional | | | New headers for response |
| auth_value | string | optional | | | Auth value |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to remove it from the source & test too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


At least one of `before_body`, `body`, and `after_body` must be specified.

Expand Down
1 change: 0 additions & 1 deletion docs/zh/latest/plugins/echo.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ echo 可以帮助用户尽可能全面地了解如何开发APISIX插件。
| body | string | 可选 | | | 返回给客户端的响应内容,它将覆盖 upstream 返回的响应 body。 |
| after_body | string | 可选 | | | 在 body 属性之后添加的内容,如果 body 属性没有指定将在 upstream 响应 body 之后添加。 |
| headers | object | 可选 | | | 返回值的 headers |
| auth_value | string | 可选 | | | |

参数 before_body,body 和 after_body 至少要存在一个

Expand Down
11 changes: 1 addition & 10 deletions t/plugin/echo.t
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ done
"Location":"https://www.iresty.com",
"Authorization": "userpass"
},
"auth_value" : "userpass"
}
},
"upstream": {
Expand All @@ -108,7 +107,6 @@ done
"headers": {
"Location":"https://www.iresty.com"
},
"auth_value" : "userpass"
}
},
"upstream": {
Expand Down Expand Up @@ -167,7 +165,6 @@ Authorization: userpass
"plugins": {
"echo": {
"before_body": "before the body modification ",
"auth_value" : "userpass",
"headers": {
"Location":"https://www.iresty.com"
}
Expand All @@ -187,7 +184,6 @@ Authorization: userpass
"plugins": {
"echo": {
"before_body": "before the body modification ",
"auth_value" : "userpass",
"headers": {
"Location":"https://www.iresty.com"
}
Expand Down Expand Up @@ -249,7 +245,6 @@ Location: https://www.iresty.com
"plugins": {
"echo": {
"before_body": "before the body modification ",
"auth_value" : "userpassword",
"headers": {
"Location":"https://www.iresty.com"
}
Expand All @@ -269,7 +264,6 @@ Location: https://www.iresty.com
"plugins": {
"echo": {
"before_body": "before the body modification ",
"auth_value" : "userpassword",
"headers": {
"Location":"https://www.iresty.com"
}
Expand Down Expand Up @@ -405,7 +399,6 @@ Location: https://www.iresty.com
"plugins": {
"echo": {
"before_body": "before the body modification ",
"auth_value" : "userpass",
"headers": {
"Location":"https://www.iresty.com"
}
Expand All @@ -425,7 +418,6 @@ Location: https://www.iresty.com
"plugins": {
"echo": {
"before_body": "before the body modification ",
"auth_value" : "userpass",
"headers": {
"Location":"https://www.iresty.com"
}
Expand Down Expand Up @@ -485,7 +477,6 @@ Location: https://www.iresty.com
"plugins": {
"echo": {
"before_body": "before the body modification ",
"auth_value" : "userpass",
"headers": {
"Location":"https://www.iresty.com"
}
Expand All @@ -506,7 +497,7 @@ Location: https://www.iresty.com
--- request
GET /t
--- response_body
{"echo":{"auth_value":"userpass","before_body":"before the body modification ","headers":{"Location":"https://www.iresty.com"}}}
{"echo":{"before_body":"before the body modification ","headers":{"Location":"https://www.iresty.com"}}}
--- no_error_log
[error]

Expand Down