Skip to content

Commit

Permalink
review: fix some doc types and rename config variable
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Auernhammer <[email protected]>
  • Loading branch information
aead committed Nov 9, 2023
1 parent 4710def commit 1dc1e23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cmd/kes/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,23 @@ func startServer(addrFlag, configFlag string) error {
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer cancel()

file, err := kesconf.ReadFile(configFlag)
rawConfig, err := kesconf.ReadFile(configFlag)
if err != nil {
return err
}
if addrFlag == "" {
addrFlag = file.Addr
addrFlag = rawConfig.Addr
}
conf, err := file.Config(ctx)
conf, err := rawConfig.Config(ctx)
if err != nil {
return err
}
defer conf.Keys.Close()

srv := &kes.Server{}
if file.Log != nil {
srv.ErrLevel.Set(file.Log.ErrLevel)
srv.AuditLevel.Set(file.Log.AuditLevel)
if rawConfig.Log != nil {
srv.ErrLevel.Set(rawConfig.Log.ErrLevel)
srv.AuditLevel.Set(rawConfig.Log.AuditLevel)
}
sighup := make(chan os.Signal, 10)
signal.Notify(sighup, syscall.SIGHUP)
Expand Down
2 changes: 1 addition & 1 deletion internal/keystore/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ func (s *Store) List(ctx context.Context, prefix string, n int) ([]string, strin
return nil, "", fmt.Errorf("vault: failed to list '%s': %v", location, err)
}
if secret == nil { // The secret may be nil even when there was no error.
return []string{}, "", nil // We return an empty iterator in this case.
return []string{}, "", nil // We return an empty list in this case.
}

// Vault returns a generic map that should contain
Expand Down
2 changes: 1 addition & 1 deletion kesconf/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type File struct {
// Log contains the KES server logging configuration.
Log *LogConfig

// APU contains the KES server API configuration.
// API contains the KES server API configuration.
API *APIConfig

// Policies contains the KES server policy definitions
Expand Down

0 comments on commit 1dc1e23

Please sign in to comment.