Log LDAP Rotations (#31401)

This commit is contained in:
kpcraig 2025-08-08 11:56:54 -04:00 committed by GitHub
parent 33132416cc
commit 36d873aae2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View file

@ -39,6 +39,14 @@ func pathConfigRotateRoot(b *backend) *framework.Path {
func (b *backend) pathConfigRotateRootUpdate(ctx context.Context, req *logical.Request, _ *framework.FieldData) (*logical.Response, error) {
err := b.rotateRootCredential(ctx, req)
if err != nil {
// log here instead of inside the actual rotate call because the rotation manager also logs, so this is
// the "equivalent" place for manual rotations.
b.Logger().Error("failed to rotate root credential on user request", "path", req.Path, "error", err.Error())
} else {
// err is nil in this case
b.Logger().Info("succesfully rotated root credential on user request", "path", req.Path)
}
var responseError responseError
if errors.As(err, &responseError) {
return logical.ErrorResponse(responseError.Error()), nil

3
changelog/31401.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:improvement
auth/ldap: add explicit logging to rotations in ldap
```