fix(release): Validate GCP GetSecret json format#5336
fix(release): Validate GCP GetSecret json format#5336Skarlso merged 4 commits intoexternal-secrets:mainfrom
Conversation
| } | ||
|
|
||
| func getDataByProperty(data []byte, property string) gjson.Result { | ||
| func getDataByProperty(data []byte, property string) (gjson.Result, error) { |
There was a problem hiding this comment.
Please add some test for the new behaviour.
There was a problem hiding this comment.
Hi, I added the test but it's kind of my first test, so it might be wrong.
There was a problem hiding this comment.
Well done! :) I'll check it out! :)
|
@Gabrielmadrid73 Ah can you sign your commit please? |
Signed-off-by: Gabriel Madrid <gabrielmadrid73@gmail.com>
…rty changes Signed-off-by: Gabriel Madrid <gabrielmadrid73@gmail.com>
Signed-off-by: Gabriel Madrid <gabrielmadrid73@gmail.com>
01112f5 to
07b4aac
Compare
|
@Skarlso mb, executed the DCO indicated commands: |
|
|
Hey 👋🏻 Even though this is not so critical, it'd be good to release this in a Just found out I had a few "broken" secrets after naively applying this patch. I read the changelog but missed this change. I'm not sure it's worth changing the release since I think I'm the only one mentioning this, but I'm sharing anyway. |
* chore/json-parser - Updated GCP GetSecret to validate json format Signed-off-by: Gabriel Madrid <gabrielmadrid73@gmail.com> * fix/gcp-json-parser - Updated GCP needUpdate according getDataByProperty changes Signed-off-by: Gabriel Madrid <gabrielmadrid73@gmail.com> * fix/gcp-json-parse - Added test to GCP client getDataByProperty Signed-off-by: Gabriel Madrid <gabrielmadrid73@gmail.com> --------- Signed-off-by: Gabriel Madrid <gabrielmadrid73@gmail.com> Co-authored-by: Gergely Brautigam <skarlso777@gmail.com> Signed-off-by: Samuel Molling <samuelmolling@gmail.com>



Problem Statement
The current method allows user to use a GCP secret manager with a malformed json content. It happens because there's no validation and it can cause problems in the future.
Related Issue
Fixes #4336
Proposed Changes
Add a json validation using the official lib
encoding/jsonto GCP secrets. This change will prevent malformed stored json's to the secrets.Checklist
git commit --signoffmake testmake reviewable