add error message when trying to rotate mssql root without password in configuration (#19103)

* add error message when trying to rotate mssql root without password in configuration

* add changelog
This commit is contained in:
Ellie 2023-02-13 07:31:13 -05:00 committed by GitHub
parent 1b4bbe2b5b
commit 08ef61cc00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -74,6 +74,11 @@ func (b *databaseBackend) pathRotateRootCredentialsUpdate() framework.OperationF
return nil, fmt.Errorf("unable to rotate root credentials: no username in configuration")
}
rootPassword, ok := config.ConnectionDetails["password"].(string)
if !ok || rootPassword == "" {
return nil, fmt.Errorf("unable to rotate root credentials: no password in configuration")
}
dbi, err := b.GetConnection(ctx, req.Storage, name)
if err != nil {
return nil, err

3
changelog/19103.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
secrets/database: Adds error message requiring password on root crednetial rotation.
```