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

Remote vault patch 1 #1605

Merged
merged 16 commits into from
Sep 6, 2024
Merged

Remote vault patch 1 #1605

merged 16 commits into from
Sep 6, 2024

Conversation

PatMis16
Copy link
Contributor

@PatMis16 PatMis16 commented Sep 4, 2024

PR Description

Fixed an issue where specifying both path and key in the remote.vault path configuration could result in incorrect URLs. The path and key arguments have been separated to allow for clear and accurate specification of Vault secrets.

Which issue(s) this PR fixes

Fixes #1599

Notes to the Reviewer

Not sure about the config converters part. Please check.
Please also check if the documentation is clear and understandable.

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@CLAassistant
Copy link

CLAassistant commented Sep 4, 2024

CLA assistant check
All committers have signed the CLA.

@mattdurham mattdurham self-assigned this Sep 4, 2024
@PatMis16 PatMis16 requested a review from a team as a code owner September 4, 2024 14:28
@mattdurham
Copy link
Collaborator

Going to take a look at this but need to revisit my vault knowledge.

@@ -40,6 +41,7 @@ Name | Type | Description
`server` | `string` | The Vault server to connect to. | | yes
`namespace` | `string` | The Vault namespace to connect to (Vault Enterprise only). | | no
`path` | `string` | The path to retrieve a secret from. | | yes
`key` | `string` | The key to retrive a secret from. | | yes
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel we need a way to allow for backwards compatibility. Likely we need to have both behaviors. If key is empty use existing behavior.

Nit: Typo in retrieve.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @mattdurham ,
I get that. So what I can do is wrap it in an if-else.
And I think we have to define the argument key as optional.
Thanks,
Patrick

@PatMis16
Copy link
Contributor Author

PatMis16 commented Sep 4, 2024

@mattdurham
Did some work. I tested it as good as I could. I think it should work. However, you might have a deeper look into vault_test.go. I am not quite sure if it is all correct there. The test worked localy on my workstation but not on GitHub Codespace.


cfg := fmt.Sprintf(`
server = "%s"
path = ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this have a path to more accurately test the issue? Should it be secret and key be test?

@PatMis16
Copy link
Contributor Author

PatMis16 commented Sep 5, 2024

@mattdurham
Changed the test accordingly.

@mattdurham
Copy link
Collaborator

Looks good to me, @clayton-cornell can you check the doc? Once thats done will merge.

@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Sep 6, 2024
Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

Docs are ok

Copy link
Collaborator

@mattdurham mattdurham left a comment

Choose a reason for hiding this comment

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

Looks good! Appreciate the PR, thank you.

@mattdurham mattdurham merged commit 91fd0f2 into grafana:main Sep 6, 2024
16 checks passed
@fnerdwq
Copy link

fnerdwq commented Sep 16, 2024

Tanks for fixing this fast. Will it be released with a v1.3.2? When is this version due?
(waiting for the fix ;-) )
Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remote.vault adds "data" to the url at the wrong position
5 participants