ForgeRock / secret-agent

Generate random Kubernetes secrets and optionally store them in a Cloud Secret Manager
Apache License 2.0
17 stars 20 forks source link

fix: Create new secret when Azure Secret is disabled #221

Closed pearj closed 2 years ago

pearj commented 2 years ago

Support creating a new secret when an Azure Secret is disabled.

With Azure Key Vault secrets are now soft deleted, so deleting a secret doesn't have an effect until purged which defaults to 90 days. This means it isn't possible to get the secret agent to regenerate a secret, for example to add additional entries to a keystore.

Individual versions of secrets can however be disabled, and then creating a new secret simply creates a new version of that secret. So this change ignores the "SecretDisabled" inner service error, in addition to the existing "SecretNotFound" behaviour.

pearj commented 2 years ago

I should mention I'm very new to go, so I don't know if there is a better way to implement this.

wstrange commented 2 years ago

Thanks for the PR Joel. It looks OK to me - but I want @lee-baines to also give it a review

pearj commented 2 years ago

Thanks Warren, do need to sign my commit? I see it says "The base branch requires all commits to be signed"

pearj commented 2 years ago

I have amended the commit and signed it.