Skip to content

Can't fetching secrets #19

Open
@rbakhtaraev

Description

@rbakhtaraev

I reproduced the structure from your example, but all trying ended with errors.

  1. I have secrets on the following path, that can be read and listed.
    any/path/daytona_test/{api-key|database}
    I exported the variable VAULT_SECRETS_APPLICATION=any/path/daytona_test and try to fetching that secrets, but i got 405 error.
URL: GET https://awesome.vault/v1/secret/data/any/path/daytona_test?list=true
Code: 405. Errors:

* 1 error occurred:
        * unsupported operation
  1. Trying to fetch secret by direct path. Use the variable: VAULT_SECRET_APPLICATION=any/path/daytona_test/api-key. Got non-string value error.
DAYTONA - 2019/08/15 12:18:05 Starting secret fetch
DAYTONA - 2019/08/15 12:18:06 secret 'api-key_data' has non-string value: map[string]interface {}{"value":"1234"}

Try again:

DAYTONA - 2019/08/15 12:21:17 Starting secret fetch
DAYTONA - 2019/08/15 12:21:17 secret 'api-key_metadata' has non-string value: map[string]interface {}{"destroyed":false, "version":"1", "created_time":"2019-08-15T05:02:57.750127434Z", "deletion_time":""}

If i send in the API by Postman i get next:

{
    "request_id": "a273f8e1-342f-7ee1-550f-de0734456154",
    "lease_id": "",
    "renewable": false,
    "lease_duration": 0,
    "data": {
        "data": {
            "value": "1234"
        },
        "metadata": {
            "created_time": "2019-08-15T05:02:57.750127434Z",
            "deletion_time": "",
            "destroyed": false,
            "version": 1
        }
    },
    "wrap_info": null,
    "warnings": null,
    "auth": null
}

Is this an unexpected response for Daytona? What am I doing wrong?
Vault version: 1.1.1

Activity

broamski

broamski commented on Oct 8, 2019

@broamski
Collaborator

Hi @rbakhtaraev - Are you using the KV Secrets Engine V2?

To determine version number, run vault secrets list -detailed and inspect the Options column for version:2.

rbakhtaraev

rbakhtaraev commented on Oct 17, 2019

@rbakhtaraev
Author

Hi @broamski, sorry for the delay. We are using KV Engine V2.

ecejas

ecejas commented on Jan 8, 2020

@ecejas

@broamski There is any special consideration we need to have with KV Engine V2? It doesn't work for me. Works fine when I use Engine V1. I suspect is related to the existence of multiple keys in V2 (Secret Metadata).

linked a pull request that will close this issueRudimentary support for KV version 2 #35on Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Participants

    @broamski@ecejas@rbakhtaraev

    Issue actions

      Can't fetching secrets · Issue #19 · cruise-automation/daytona