[quality] test: cover buildAgentMinter mint-credential bootstrap (src/cmd/hive/main.go) - #5695
Conversation
…md/hive buildAgentMinter (src/cmd/hive/main.go) was 0% covered despite issuing per-agent mint credentials. Adds hermetic tests for: key_path/issuer fail-closed validation, corrupt-key load failure, key bootstrap with 0600 perms, mint round-trip incl. empty-agent-name rejection, key reuse across rebuilds, and zero-TTL default fallback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
|
Review — OK to merge on green. Checked the assertions against
On the mint-deadlock incident class: these tests call |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
Test Improvement
Adds
src/cmd/hive/build_agent_minter_test.gocoveringbuildAgentMinter(src/cmd/hive/main.go:890), previously 0% covered despite sitting on the per-agent mint-credential path (0% → 93.3%):mint.key_pathand missingmint.issuer(and that issuer validation fails before any key file is created)loading mint signing keyerror instead of silently regenerating (which would orphan outstanding tokens)MaxTTLSeconds=0falls back to the package default and still mintsClaimed ground:
buildAgentMinterinsrc/cmd/hive/main.goonly — disjoint from open PR #5665 (labelPlanSink / planFromLabeledIssues insrc/cmd/hive/plan_from_label_sink_test.go).Verified:
go test -run TestBuildAgentMinter ./cmd/hive/passes; full./cmd/hivesuite unaffected.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.78