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: The path parameter must be provided when updating the Secret resource with the PATCH method #9503

Closed
guoqqqi opened this issue May 18, 2023 · 0 comments · Fixed by #9510

Comments

@guoqqqi
Copy link
Member

guoqqqi commented May 18, 2023

Current Behavior

  1. Use the PATCH method to update the Secret resource:
curl http://127.0.0.1:9180/apisix/admin/secrets/vault/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -XPATCH -d '{
    "token" : "apisix"
}'

{"error_msg":"no secret id and/or sub path in uri"}
  1. Update the Secret resource using the PATCH method, with the path parameter as normal.
curl http://127.0.0.1:9180/apisix/admin/secrets/vault/1/token -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -XPATCH -d '"apisix"'

{"value":{"prefix":"/apisix/kv","token":"apisix","uri":"https://localhost/vault","id":"vault/1","update_time":1684399820,"create_time":1684395392},"key":"/apisix/secrets/vault/1"}

Expected Behavior

Update Secret resource using PATCH method, supports no path parameter.

Error Logs

No response

Steps to Reproduce

  1. Run APISIX via the Docker image
  2. Create new secrets configuration.
curl -i http://127.0.0.1:9180/apisix/admin/secrets/vault/1 \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -XPUT -d '
{
    "uri": "http://xxx/get",
    "prefix" : "apisix",
    "token" : "apisix"
}'
  1. Update the secrets configuration.
curl http://127.0.0.1:9180/apisix/admin/secrets/vault/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -XPATCH -d '{
    "token" : "apisix"
}'

see the error: {"error_msg":"no secret id and/or sub path in uri"}

Environment

  • APISIX version (run apisix version): v3.2.0
  • Operating system (run uname -a): M1
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant