spacewander commented on a change in pull request #3691: URL: https://github.com/apache/apisix/pull/3691#discussion_r586032971
########## File path: docs/en/latest/plugins/consumer-restriction.md ########## @@ -116,6 +117,80 @@ HTTP/1.1 403 Forbidden {"message":"The consumer_name is forbidden."} ``` +### How to restrict `allowed_methods` + +This example restrict the user `jack1` to only `POST` on the resource + +```shell +curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' +{ + "uri": "/index.html", + "upstream": { + "type": "roundrobin", + "nodes": { + "127.0.0.1:1980": 1 + } + }, + "plugins": { + "basic-auth": {}, + "consumer-restriction": { + "whitelist": [ Review comment: OK. I made a mistake, the `whitelist` is not required with `allowed_by_methods`. I think we should show them separately in the doc and test. ---------------------------------------------------------------- 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: us...@infra.apache.org