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

bug: when user not fill in remote address , remote_addrs should be [], but not [""] #940

Closed
nic-chen opened this issue Dec 1, 2020 · 9 comments · Fixed by #948
Closed
Assignees
Labels
backend bug Something isn't working frontend
Milestone

Comments

@nic-chen
Copy link
Member

nic-chen commented Dec 1, 2020

Bug report

How to Reproduce

  1. use dashboard to create a route without filling in remote address

  2. wait a few minutes, will find some error log like

2020/12/01 22:44:48 [error] 34404#36781528: *230358 [lua] config_etcd.lua:509: failed to fetch data from etcd: failed to check item data of [/apisix/routes] err:property "remote_addrs" validation failed: failed to validate item 1: object matches none of the requireds,  etcd key: /apisix/routes, context: ngx.timer
2020/12/01 22:44:48 [error] 34408#36781532: *230380 [lua] config_etcd.lua:509: failed to fetch data from etcd: failed to check item data of [/apisix/routes] err:property "remote_addrs" validation failed: failed to validate item 1: object matches none of the requireds,  etcd key: /apisix/routes, context: ngx.timer
2020/12/01 22:44:48 [error] 34409#36781533: *230352 [lua] config_etcd.lua:509: failed to fetch data from etcd: failed to check item data of [/apisix/routes] err:property "remote_addrs" validation failed: failed to validate item 1: object matches none of the requireds,  etcd key: /apisix/routes, context: ngx.timer

  1. the route doesn't work
@nic-chen nic-chen added the bug Something isn't working label Dec 1, 2020
@membphis
Copy link
Member

membphis commented Dec 1, 2020

@juzhiyuan

@moonming
Copy link
Member

moonming commented Dec 1, 2020

Server API should never trust input

@nic-chen
Copy link
Member Author

nic-chen commented Dec 1, 2020

sure,backend need to fix it too

@moonming moonming added this to the 2.1.1 milestone Dec 1, 2020
@membphis
Copy link
Member

membphis commented Dec 1, 2020

sure,backend need to fix it too

APISIX has fixed this bug: https://github.com/apache/apisix/pull/2907/files

need to sync the JSON schema.

@juzhiyuan
Copy link
Member

related issue #856 (comment)

Just to make sure, will manager-api check the input from the client? (no matter using API or frontend), the manager-api must not trust any data from client.

cc @nic-chen @membphis @ShiningRush

@juzhiyuan
Copy link
Member

oh I noticed this comment, API should never trust any data from client.

Server API should never trust input

@LiteSun
Copy link
Member

LiteSun commented Dec 2, 2020

I noticed that remote_addrs is not required in apisix. When the user does not enter remote_addrs, should the client pass [] or not pass the remote_addrs field? @nic-chen

@nic-chen
Copy link
Member Author

nic-chen commented Dec 2, 2020

@LiteSun

"not pass the remote_addrs field" should be better.

@membphis
Copy link
Member

membphis commented Dec 2, 2020

I noticed that remote_addrs is not required in apisix. When the user does not enter remote_addrs, should the client pass [] or not pass the remote_addrs field? @nic-chen

#856 (comment) I have replied this question before.

When the user not filled, should no field remote_addrs. this should be a bug of the frontend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants