secrets-engine/verifier/testsupport/signer/main.go
tegwick 4dd004a225
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Verify normalized task approval facts and preserve signed source types
Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a140c4-354a-7823-8f0d-8f717397f786
2026-10-16 17:28:03 +02:00

32 lines
626 B
Go

// Synthetic test-only signer with the producer's published nonproduction seed.
package main
import (
"bytes"
"crypto/ed25519"
"encoding/json"
"github.com/netkingdom/access-engine/internal/sign"
"io"
"os"
)
func main() {
seed := byte(0x42)
kid := "testdata-ed25519"
if len(os.Args) > 1 {
seed = 0x43
kid = "next-admitted"
}
raw, err := io.ReadAll(os.Stdin)
if err != nil {
os.Exit(1)
}
env, err := sign.DecodeEnvelope(raw)
if err != nil {
os.Exit(1)
}
if sign.Sign(&env, ed25519.NewKeyFromSeed(bytes.Repeat([]byte{seed}, 32)), kid) != nil {
os.Exit(1)
}
json.NewEncoder(os.Stdout).Encode(env)
}