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

Import path not used #20

Open
blacs30 opened this issue Aug 10, 2020 · 2 comments · May be fixed by #21
Open

Import path not used #20

blacs30 opened this issue Aug 10, 2020 · 2 comments · May be fixed by #21

Comments

@blacs30
Copy link

blacs30 commented Aug 10, 2020

In the Readme it looks like one can define the import path of the secrets but looking at the code it's clear that the path variable is unused.

It would be great if a different path could be used to import the secrets to.

@Lirt
Copy link

Lirt commented Aug 12, 2020

I noticed the same just after first import try.

I guess the import path should be inserted before path (there could be two slashes, so it needs to be handled somehow) in this part of code for each item.

@Lirt
Copy link

Lirt commented Aug 12, 2020

What would be more usable is that the path that is saved in JSON after export command will not contain the path specified in export command.

What I mean is:

vault-backend-migrator -ver 1 -export /my-directory/my-secrets/ -file secrets.json
cat secrets.json
{
  "data":
  [
    {
      "path":"secret1","pairs":[{"key":"value","value":"s1"}]
    },
    {
      "path":"secret2","pairs":[{"key":"value","value":"s2"}]
    },
    {
      "path":"nested-dir1/secret3","pairs":[{"key":"value","value":"s3"}]
    },
    {
      "path":"nested-dir2/secret4","pairs":[{"key":"value","value":"s4"}]
    },
  ]
}

Then I can run import to some path and all paths will be unpacked in it.

vault-backend-migrator -ver 1 -import /different-directory/my-secrets/ -file secrets.json
vault list /different-directory/my-secrets/
> secret1
> secret2
> nested-dir1/secret3
> nested-dir2/secret4

@Lirt Lirt linked a pull request Aug 13, 2020 that will close this issue
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.

2 participants