Take the image signing key from PIXA_SIGNING_KEY and refuse the example placeholder (closes #110) #120

Merged
clawbot merged 6 commits from issue-110-docker-config-signing-key into next 2026-09-21 21:59:25 +02:00
2 changed files with 11 additions and 0 deletions
Showing only changes of commit 3bb992fc1b - Show all commits
+6
View File
@@ -44,6 +44,12 @@ const (
keyCacheMaxBytes = "cache_max_bytes"
)
// placeholderSigningKey is the dummy signing_key shipped in
// config.example.yml. It is 45 characters, so it passes the length
// check, but it is public in this repository and must be rejected at
// startup so no deployment ever signs URLs with it.
const placeholderSigningKey = "CHANGE_ME_generate_with_openssl_rand_base64_32"
// Static validation errors. Each use site attaches the offending key
// and value by wrapping these with fmt.Errorf and %w.
var (
@@ -303,6 +303,11 @@ func invalidHostAndCredentialCases() []abortCase {
yaml: "signing_key: short\n",
wantErrSubstrings: []string{keySigningKey},
},
{
name: "signing_key is the documented placeholder",
yaml: "signing_key: " + placeholderSigningKey + "\n",
wantErrSubstrings: []string{keySigningKey},
},
{
name: "signing_key missing",
yaml: "port: 8080\n",