Skip to content

test(keyring): add unit test surface for production Keyring implementation#135

Merged
allisson merged 1 commit into
mainfrom
improve-codebase
May 25, 2026
Merged

test(keyring): add unit test surface for production Keyring implementation#135
allisson merged 1 commit into
mainfrom
improve-codebase

Conversation

@allisson
Copy link
Copy Markdown
Owner

Summary

  • Adds internal/keyring/impl_test.go with 15 unit tests covering the production keyringImpl adapter (previously only reachable through integration tests)
  • Implements an in-memory memDekStore within the test file so tests require no database or KMS — they run in milliseconds under -race
  • Covers all 6 scenarios called out in the architecture review: fresh-DEK round-trip, persistent-DEK round-trip, AEAD cross-algorithm rejection, Rewrap/RewrapAll idempotency, sign/verify, and Zero memory clearing

Test plan

  • go test -race ./internal/keyring/... — all 20 tests pass (15 new + 5 pre-existing fake_test.go)
  • No integration tests required; new tests are pure unit tests with no external dependencies

🤖 Generated with Claude Code

…ation

Covers all 6 scenarios from the architecture review: fresh-DEK and
persistent-DEK round-trips, AEAD cross-algorithm rejection, Rewrap/RewrapAll
idempotency, signing, and memory-zeroing. Uses an in-memory dekStore and a
directly-constructed keyringImpl — no database or KMS required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@allisson allisson merged commit d376052 into main May 25, 2026
3 checks passed
@allisson allisson deleted the improve-codebase branch May 25, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant