Skip to content

Fix get bulk secret for hashicorp vault.#632

Merged
yaron2 merged 1 commit into
dapr:masterfrom
artursouza:fix_hashicorp_kv_list
Jan 25, 2021
Merged

Fix get bulk secret for hashicorp vault.#632
yaron2 merged 1 commit into
dapr:masterfrom
artursouza:fix_hashicorp_kv_list

Conversation

@artursouza

Copy link
Copy Markdown
Contributor

Description

Fix get bulk secret for hashicorp vault.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: None

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

@artursouza artursouza added the kind/bug Something isn't working label Jan 25, 2021
@artursouza
artursouza marked this pull request as draft January 25, 2021 05:14
@artursouza
artursouza marked this pull request as ready for review January 25, 2021 05:35
@artursouza

Copy link
Copy Markdown
Contributor Author

I was surprised when I saw that:

  1. The list call to KV was not even working.
  2. It was not including the secret's key in the dictionary and building it in a funny way.

Let's all take a moment to thank Java SDK's ITs for saving our a** one more time.

@codecov

codecov Bot commented Jan 25, 2021

Copy link
Copy Markdown

Codecov Report

Merging #632 (a6cdeca) into master (66b9734) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #632      +/-   ##
==========================================
- Coverage   30.79%   30.78%   -0.01%     
==========================================
  Files          87       87              
  Lines        7320     7322       +2     
==========================================
  Hits         2254     2254              
- Misses       4830     4832       +2     
  Partials      236      236              
Impacted Files Coverage Δ
secretstores/hashicorp/vault/vault.go 6.84% <0.00%> (-0.10%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66b9734...6957bb8. Read the comment docs.

@mukundansundar mukundansundar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

yaron2
yaron2 previously approved these changes Jan 25, 2021

// Create list secrets url
vaultSecretsPathAddr := fmt.Sprintf("%s/v1/secret/data/%s", v.vaultAddress, v.vaultKVPrefix)
vaultSecretsPathAddr := fmt.Sprintf("%s/v1/secret/metadata/%s", v.vaultAddress, v.vaultKVPrefix)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why did this change? there's another occurance for this in getSecret

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mukundan made the same question. This URL here is used for the LIST API, which (as per hashicorp documentation) is a metadata operation.

https://www.vaultproject.io/api/secret/kv/kv-v2#list-secrets

In the end, I actually ran this as part of my ITs in Java SDK the old way does not work at all.

@yaron2
yaron2 dismissed their stale review January 25, 2021 17:45

late arrival

@yaron2 yaron2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@yaron2
yaron2 merged commit 11454d7 into dapr:master Jan 25, 2021
kumaya pushed a commit to infobloxopen/components-contrib that referenced this pull request Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants