You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/24 04:31:50 UTC
[GitHub] [apisix-dashboard] idbeta opened a new issue #862: bug: 2.1 version create route with jwt-auth will display an error
idbeta opened a new issue #862:
URL: https://github.com/apache/apisix-dashboard/issues/862
# Bug report
## Describe the bug
2.1 version create route with jwt-auth will display an error
![image](https://user-images.githubusercontent.com/7396835/100048866-e50c9300-2e50-11eb-9286-d21d60846ef8.png)
```
Request URL: http://127.0.0.1:8080/apisix/admin/routes
Request Method: POST
{"name":"test","desc":"","uris":["/hello"],"methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"plugins":{"jwt-auth":{}},"vars":[],"upstream":{"type":"roundrobin","timeout":{"connect":6000,"send":6000,"read":6000},"nodes":[{"host":"127.0.0.1","port":7000,"weight":1}]}}
Response
{"code":10000,"message":"scheme validate failed: properties must be of type object","data":null,"request_id":"fa40087e-bfbf-45a3-a216-2f93e0683c9a"}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran commented on issue #862: bug: 2.1 version create route with jwt-auth will display an error
Posted by GitBox <gi...@apache.org>.
liuxiran commented on issue #862:
URL: https://github.com/apache/apisix-dashboard/issues/862#issuecomment-732748732
The issue caused by this hack: https://github.com/apache/apisix-dashboard/blob/1a38fa6cf6540bc966098f6467a160312fb6b0fd/api/internal/core/store/validate.go#L243
as the schema.json do the format, `"properties":[]` changed to `"properties": []` https://github.com/apache/apisix-dashboard/blob/1a38fa6cf6540bc966098f6467a160312fb6b0fd/api/conf/schema.json#L1430
---
The simple and rough way is to modify the regular expression to
```go
reg := regexp.MustCompile(`\"properties\": \[\]`)
```
best way is refer to @membphis `s suggestion: https://github.com/apache/apisix-dashboard/pull/651#discussion_r516351088, and need @nic-chen `s help
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on issue #862: bug: 2.1 version create route with jwt-auth will display an error
Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #862:
URL: https://github.com/apache/apisix-dashboard/issues/862#issuecomment-734283277
fixed by json schema updated.
and here is a test case for it:
https://github.com/apache/apisix-dashboard/blob/master/api/test/e2e/route_with_auth_plugin_test.go#L38-L58
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on issue #862: bug: 2.1 version create route with jwt-auth will display an error
Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #862:
URL: https://github.com/apache/apisix-dashboard/issues/862#issuecomment-732756417
@liuxiran thanks for your remind.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] liuxiran edited a comment on issue #862: bug: 2.1 version create route with jwt-auth will display an error
Posted by GitBox <gi...@apache.org>.
liuxiran edited a comment on issue #862:
URL: https://github.com/apache/apisix-dashboard/issues/862#issuecomment-732748732
The issue caused by this hack: https://github.com/apache/apisix-dashboard/blob/1a38fa6cf6540bc966098f6467a160312fb6b0fd/api/internal/core/store/validate.go#L243
as the schema.json do the format, `"properties":[]` changed to `"properties": []` https://github.com/apache/apisix-dashboard/blob/1a38fa6cf6540bc966098f6467a160312fb6b0fd/api/conf/schema.json#L1430
---
The simple and rough way is to modify the regular expression to
```go
reg := regexp.MustCompile(`\"properties\": \[\]`)
```
best way is refer to @membphis 's suggestion: https://github.com/apache/apisix-dashboard/pull/651#discussion_r516351088, and need @nic-chen 's help
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen closed issue #862: bug: 2.1 version create route with jwt-auth will display an error
Posted by GitBox <gi...@apache.org>.
nic-chen closed issue #862:
URL: https://github.com/apache/apisix-dashboard/issues/862
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org