From 22f19c849b52d53d7ae195213ada1dc1596ef11e Mon Sep 17 00:00:00 2001 From: sneak Date: Fri, 7 Aug 2026 17:04:08 +0000 Subject: [PATCH] style: use the config key error-message convention for signing_key The signing_key errors used bare phrasing while every other validation error follows the 'config key %q' convention; align them. The secret value itself is still never echoed. --- internal/config/config.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index cb5b9b9..702f1b8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -262,15 +262,16 @@ func (c *Config) ensureStateDirWritable() error { // validate checks that all required configuration values are set and // that every value is within its valid range. func (c *Config) validate() error { + // The signing key value is never echoed in error messages. if c.SigningKey == "" { - return fmt.Errorf("signing_key is required") + return fmt.Errorf("config key %q: a value is required", "signing_key") } // Minimum key length for security (32 bytes = 256 bits) const minKeyLength = 32 if len(c.SigningKey) < minKeyLength { - return fmt.Errorf("signing_key must be at least %d characters, got %d", - minKeyLength, len(c.SigningKey)) + return fmt.Errorf("config key %q: value must be at least %d characters, got %d", + "signing_key", minKeyLength, len(c.SigningKey)) } const maxPort = 65535