Reject empty strings for required secrets #160
Loading…
Reference in a new issue
No description provided.
Delete branch "137-required-secret-empty"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
secret:"required") refused only JSONnull. A present""was stored as "no value", soPUT /vpn/wireguardwith"private_key": ""removed the stored key. The tunnel kept running on the kernel key and failed only at its next re-creation, for example after a reboot (#137).Change
ApplySecretInput: a required secret refuses""likenull(400,<path>: is required and cannot be cleared). Untagged secrets keep""= none. The BGP password (nonempty) is unchanged.validateWireGuardTarget) refuses a tunnel without a private key withvpn.wireguard[N].private_key: private_key is required. Startup and rollback still apply a stored state without a key; the check sits only in admission, because the runtime plan validation also runs on startup, rollback and recovery.openapi.yaml: 400 on the WireGuard writes, and the rule on the required secret fields.Validation
GOFLAGS=-p=2 go vet ./pkg/models/... ./internal/service/... ./internal/api/handlers/...: no findings.TestApplySecretInputRejectsEmptyRequiredSecret,TestSecretContractRejectsEmptyRequiredPrivateKey,TestProvisioningImportRejectsWireGuardTunnelWithoutPrivateKey,TestWireGuardTargetRequiresPrivateKey.-runsets).PUT /vpn/wireguard/{iface}.Closes #137
🤖 Generated with Claude Code