Skip to content

Commit

Permalink
fix panic on static role creation when config is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
fairclothjm committed Oct 10, 2024
1 parent fb5c655 commit cde2152
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions path_static_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package openldap

import (
"context"
"errors"
"fmt"
"strings"
"time"
Expand Down Expand Up @@ -318,8 +317,12 @@ func (b *backend) pathStaticRoleCreateUpdate(ctx context.Context, req *logical.R
// otherwise, go get it if this is a create request.
c, err := readConfig(ctx, req.Storage)
if err != nil {
return nil, errors.New("couldn't find configuration for this create operation's endpoint")
return nil, err
}
if c == nil {
return logical.ErrorResponse("missing LDAP configuration"), nil
}

skipRotation = c.SkipStaticRoleImportRotation
}

Expand Down

0 comments on commit cde2152

Please sign in to comment.