mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Add ability to customize some timeouts in MongoDB database plugin (#11600)
This commit is contained in:
@@ -78,6 +78,14 @@ func (b *databaseBackend) pathRotateRootCredentialsUpdate() framework.OperationF
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Take out the backend lock since we are swapping out the connection
|
||||
b.Lock()
|
||||
defer b.Unlock()
|
||||
|
||||
// Take the write lock on the instance
|
||||
dbi.Lock()
|
||||
defer dbi.Unlock()
|
||||
|
||||
defer func() {
|
||||
// Close the plugin
|
||||
dbi.closed = true
|
||||
@@ -88,14 +96,6 @@ func (b *databaseBackend) pathRotateRootCredentialsUpdate() framework.OperationF
|
||||
delete(b.connections, name)
|
||||
}()
|
||||
|
||||
// Take out the backend lock since we are swapping out the connection
|
||||
b.Lock()
|
||||
defer b.Unlock()
|
||||
|
||||
// Take the write lock on the instance
|
||||
dbi.Lock()
|
||||
defer dbi.Unlock()
|
||||
|
||||
// Generate new credentials
|
||||
oldPassword := config.ConnectionDetails["password"].(string)
|
||||
newPassword, err := dbi.database.GeneratePassword(ctx, b.System(), config.PasswordPolicy)
|
||||
|
||||
Reference in New Issue
Block a user