Skip to content
New issue

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

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

Already on GitHub? # to your account

suffix /data to secret path only when using v2 KV secret engine #42

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

c35sys
Copy link
Contributor

@c35sys c35sys commented Sep 30, 2020

Try fo fix #41

@dirtycajunrice
Copy link
Contributor

dirtycajunrice commented Sep 30, 2020

Interesting. So the /data path is not used with kv-v1 ?

@c35sys
Copy link
Contributor Author

c35sys commented Sep 30, 2020

Interesting. So the /data path is not used with kv-v1 ?

No, it is new since v2.

Here are the curl requests I made:

v1

v1 request:

curl --header "X-Vault-Token: xxx" \
    https://xxx:8200/v1/testkv/teamA/hello-service | jq .

v1 response:

{
  "request_id": "05fa4c93-05c6-d616-591b-7292a584ee4e",
  "lease_id": "",
  "renewable": false,
  "lease_duration": 2764800,
  "data": {
    "private-images": "{ \"auths\": {\"registry.example.com\":{\"username\":\"foo\",\"password\":\"bar\",\"email\":\"foo@example.com\"}}}",
    "serviceBapiKey": "foo-123",
    "serviceCapiKey": "bar-456"
  },
  "wrap_info": null,
  "warnings": null,
  "auth": null
}

I changed testkv engine from v1 to v2, then I had to append /data

v2

v2 request:

curl --header "X-Vault-Token: xxx" \
    https://xxx:8200/v1/testkv/data/teamA/hello-service | jq .

v2 response:

{
  "request_id": "0b1797d5-e27a-f367-a5b9-90c9e2ae75af",
  "lease_id": "",
  "renewable": false,
  "lease_duration": 0,
  "data": {
    "data": {
      "private-images": "{ \"auths\": {\"registry.example.com\":{\"username\":\"foo\",\"password\":\"bar\",\"email\":\"foo@example.com\"}}}",
      "serviceBapiKey": "foo-123",
      "serviceCapiKey": "bar-456"
    },
    "metadata": {
      "created_time": "2020-09-30T07:24:05.859896046Z",
      "deletion_time": "",
      "destroyed": false,
      "version": 1
    }
  },
  "wrap_info": null,
  "warnings": null,
  "auth": null
}

Copy link
Collaborator

@mcavoyk mcavoyk left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for PR

@mcavoyk mcavoyk merged commit 34d40dd into itscontained:master Sep 30, 2020
@c35sys c35sys deleted the backend/vault/v1 branch September 30, 2020 20:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vault backend] /data is appended when using v1 KV secret engine
3 participants