-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore: don't allow nil credential store #1514
Conversation
Currently we allow a nil credential store for legacy functionality to store secrets in Postgres or Vault. Nowadays secrets go to the CredentialStore interface which can be Vault/Postgres/Other. Secrets/sensitive data are now no longer in dbmodel types.
4ef374a
to
f59ab3a
Compare
f59ab3a
to
de3895e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a few nitpicks. thanks
@@ -126,6 +126,9 @@ func (d *Database) Get(ctx context.Context, tag names.CloudCredentialTag) (_ map | |||
secret := dbmodel.NewSecret(tag.Kind(), tag.String(), nil) | |||
err = d.GetSecret(ctx, &secret) | |||
if err != nil { | |||
if errors.ErrorCode(err) == errors.CodeNotFound { | |||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we returning no error if it is not found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the behaviour of our Vault client, that test where I set it to run against Postgres and Vault showed that our Postgres implementation was not consistent with our Vault implementation. So I've changed the Postgres implementation to match Vault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but i think we should go back to small prs. These latest prs (min included) are becoming difficult to review properly
Yeah it will hopefully be better with the other managers because we can move whole files over and make changes rather than extracting bits and creating more lines changed than necessary. |
Description
Currently we allow a nil credential store for legacy functionality to store secrets in Postgres or Vault. Nowadays secrets go to the CredentialStore interface which can use an underlying Vault/Postgres/Other. In addition, secrets/sensitive data are no longer in dbmodel types.
Fixes JUJU-7285
Engineering checklist