Files
llm-multiverse/implementation-plans/issue-026.md
shahondin1624 8a0e9a9351 test: add integration tests for Secrets Service (#26)
Add 9 integration tests with mock audit service verifying full gRPC
client→server flow: secret retrieval, error handling, audit logging
with correct action/status/hashed params, and concurrent access.
Extract MockBackend to non-test module for integration test access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:16:18 +01:00

1.7 KiB

Implementation Plan — Issue #26: Integration tests for Secrets Service

Metadata

Field Value
Issue #26
Title Integration tests for Secrets Service
Milestone Phase 3: Secrets Service
Labels type:testing, priority:high, lang:rust, service:secrets
Status COMPLETED
Language Rust
Related Plans issue-025.md
Blocked by #25 (completed)

Acceptance Criteria

  • Test: GetSecret via gRPC returns stored secret
  • Test: Missing secret returns proper error
  • Test: Audit log entry created for each access (via mock audit service)
  • Test: Concurrent access works correctly
  • Tests run in CI (uses MockBackend, no D-Bus required)

Architecture Analysis

Created integration test suite with mock audit service that records all append calls. Tests verify full gRPC client→server flow with MockBackend for portability. Mock audit service validates audit entries contain correct session_id, action (SECRET_ACCESS=8), tool_name, result_status, and hashed params.

Files to Create/Modify

File Action Purpose
services/secrets/tests/integration_test.rs Create 9 integration tests
services/secrets/src/backend/mock.rs Create Extract MockBackend to non-test module
services/secrets/src/backend/mod.rs Modify Add mock module, adjust test imports
services/secrets/src/service.rs Modify Update mock import path

Deviation Log

Deviation Reason
Used MockBackend instead of real keyring CI environments lack keyring daemon
Skipped kernel keyring fallback test #24 not yet implemented