postfinance / vault-kubernetes

Authenticate services to @hashicorp Vault via the Kubernetes auth method
MIT License
78 stars 24 forks source link

Verify assertion to string #23

Closed pszmytka-viacom closed 2 years ago

pszmytka-viacom commented 2 years ago

When a secret contains a more complicated JSON (not a simple key-value), the following panic occurs when synchronizing:

panic: interface conversion: interface {} is map[string]interface {}, not string
goroutine 1 [running]:
main.(*syncConfig).synchronize(0xc0002ebaa0, 0x0, 0x0)
  /home/runner/work/vault-kubernetes/vault-kubernetes/cmd/synchronizer/main.go:197 +0x13f9
main.main()
  /home/runner/work/vault-kubernetes/vault-kubernetes/cmd/synchronizer/main.go:56 +0x1a9

This PR introduces a simple workaround. Secrets not containing simple key-value are skipped.

clementnuss commented 2 years ago

I have fixed a linting issue but cannot push to your branch @pszmytka-viacom, as you have created a conflicting v0.2.4 tag. \ Can you delete your tag please with the following command please? I'll create a new release once this PR will be merged

git push origin -d v0.2.4
pszmytka-viacom commented 2 years ago

I have fixed a linting issue but cannot push to your branch @pszmytka-viacom, as you have created a conflicting v0.2.4 tag. Can you delete your tag please with the following command please? I'll create a new release once this PR will be merged Thanks @clementnuss! The tag has been deleted.

marcsauter commented 2 years ago

looks good to me, @marcsauter do you agree with skipping secrets where the value isn't a string?

@clementnuss: Could you update to https://github.com/postfinance/vaultkv/releases/tag/v0.0.4 before you create the new tag.

clementnuss commented 2 years ago

sorry, did a mess while trying to rebase your branch. I directly imported all changes into master though, so this can be considered successfully merged ✔️

thanks for your work @pszmytka-viacom ! 👍🏻