Skip to content

Commit

Permalink
fix: dont write the token config as a secret
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijamt committed Oct 15, 2024
1 parent 6a03020 commit 18985e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions path_config_rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ func (b *Backend) checkAndRotateConfigToken(ctx context.Context, request *logica
return err
}

func (b *Backend) pathConfigTokenRotate(ctx context.Context, request *logical.Request, data *framework.FieldData) (*logical.Response, error) {
func (b *Backend) pathConfigTokenRotate(ctx context.Context, request *logical.Request, data *framework.FieldData) (lResp *logical.Response, err error) {
var name = data.Get("config_name").(string)
b.Logger().Debug("Running pathConfigTokenRotate")
var config *EntryConfig
var client Client
var err error

b.lockClientMutex.RLock()
if config, err = getConfig(ctx, request.Storage, name); err != nil {
Expand Down Expand Up @@ -105,6 +104,7 @@ func (b *Backend) pathConfigTokenRotate(ctx context.Context, request *logical.Re
return nil, err
}

lResp = &logical.Response{Data: config.LogicalResponseData()}
event(ctx, b.Backend, "config-token-rotate", map[string]string{
"path": fmt.Sprintf("%s/%s", PathConfigStorage, name),
"expires_at": entryToken.ExpiresAt.Format(time.RFC3339),
Expand All @@ -115,5 +115,5 @@ func (b *Backend) pathConfigTokenRotate(ctx context.Context, request *logical.Re
})

b.SetClient(nil, name)
return config.Response(), nil
return lResp, err
}

0 comments on commit 18985e4

Please sign in to comment.