From 1dc1e23795ecd3f80ca6b56369dc50329ea12d48 Mon Sep 17 00:00:00 2001 From: Andreas Auernhammer Date: Thu, 9 Nov 2023 08:31:54 +0100 Subject: [PATCH] review: fix some doc types and rename config variable Signed-off-by: Andreas Auernhammer --- cmd/kes/server.go | 12 ++++++------ internal/keystore/vault/vault.go | 2 +- kesconf/file.go | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/kes/server.go b/cmd/kes/server.go index a6231adf..562c3b3f 100644 --- a/cmd/kes/server.go +++ b/cmd/kes/server.go @@ -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) diff --git a/internal/keystore/vault/vault.go b/internal/keystore/vault/vault.go index 933fd0eb..9933ba83 100644 --- a/internal/keystore/vault/vault.go +++ b/internal/keystore/vault/vault.go @@ -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 diff --git a/kesconf/file.go b/kesconf/file.go index 250048f2..858965c7 100644 --- a/kesconf/file.go +++ b/kesconf/file.go @@ -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