fix: correct PKCS12 hook invocation arguments #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/14-pkcs12"
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?
Summary
Fixes #14 — PKCS12 hook was called with empty positional arguments.
The hook Args slice was always allocated with 8 positions (indices 0-7), but for PKCS12 only
RoleBUNDLEexists in the items list. The switch statement had no case forRoleBUNDLE, so positions 3-6 remained empty strings and the timestamp was always at position 7.Now for PKCS12 format, the hook is called as documented:
For PEM format, the existing behavior is unchanged:
Test plan
go build ./...passesgo test ./...passes$@and verify BUNDLEFILE and TIMESTAMP are in the correct positionsFor PKCS12 format, the hook was called with 8 arguments where positions 3-6 were empty strings and the timestamp was at position 7. The documented (and intended) behavior is: <script> deploy_cert <DOMAIN> <BUNDLEFILE> <TIMESTAMP> Now PKCS12 hooks receive the bundle file path and timestamp as args 3 and 4, matching the documentation and the environment variable BUNDLEFILE that was already set correctly. Fixes #141747724fb4todd00579faaReview [ai]
Looks good. The fix is correct and all tests pass after rebase onto master (including the new integration and PKCS12 hook tests from PR #17).
For PKCS12 format, the hook was invoked with 8 positional args where positions 3-6 were empty strings. Now PKCS12 hooks get a compact arg list:
hook deploy_cert DOMAIN BUNDLEFILE TIMESTAMP. PEM hooks remain unchanged.Verified:
go test ./...passes (all unit and integration tests green)TestExecute_Hook_PKCS12specifically validates the new PKCS12 arg layoutTestExecute_Hook_PEMstill passes)Minor note: the comment at line 233-235 in cert.go still references the old format. Could update to document both PEM and PKCS12 invocation patterns, but not blocking.