mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Fix: rotate root credentials for database plugins using WAL (#8782)
* fix: rotate root credentials for database plugins using WAL * test: adds a test for WAL rollback logic * fix: progress on wal rollback * docs: updates some comments * docs: updates some comments * test: adds additional test coverage for WAL rollback * chore: remove unneeded log * style: error handling, imports, signature line wraps * fix: always close db plugin connection
This commit is contained in:
@@ -8,10 +8,10 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/errwrap"
|
||||
|
||||
metrics "github.com/armon/go-metrics"
|
||||
"github.com/hashicorp/errwrap"
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// ---- Tracing Middleware Domain ----
|
||||
@@ -318,6 +318,15 @@ func (mw *DatabaseErrorSanitizerMiddleware) sanitize(err error) error {
|
||||
if k == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
// Attempt to keep the status code attached to the
|
||||
// error without changing the actual error message
|
||||
s, ok := status.FromError(err)
|
||||
if ok {
|
||||
err = status.Error(s.Code(), strings.Replace(s.Message(), k, v.(string), -1))
|
||||
continue
|
||||
}
|
||||
|
||||
err = errors.New(strings.Replace(err.Error(), k, v.(string), -1))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user