feat: add secret rotation service for database credentials and API keys (closes #79) - #124
Merged
JamesEjembi merged 2 commits intoJul 30, 2026
Conversation
…ys (closes VeriNode-Labs#79) Add src/secret_rotation/mod.rs implementing a versioned credential store with scheduled expiry, dual-ended grace windows, and atomic rotation: - Register credentials with configurable TTL and validation - Atomic rotation: new credential issued, old deactivated after grace window - Overlapping credential versions support in-flight request draining - Expiry detection with configurable warning thresholds - Automatic purge of expired credentials past the grace window - Comprehensive test suite (14 tests) covering: - Registration and version tracking - Secret length validation (min/max bounds) - Rotation lifecycle and active version enforcement - Expiry detection and warning thresholds - Grace window purge behaviour - Multi-binding independence - Binding revocation - Metrics export for monitoring dashboards
closes VeriNode-Labs#79) Both src/config_audit.rs and src/replication/mod.rs already existed but were never declarated as pub mod in lib.rs, causing unresolved import errors in tests/config_audit_test.rs and tests/replication_dr_test.rs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
src/secret_rotation/mod.rs, a versioned credential store with scheduled expiry, dual-ended grace windows, and atomic rotation.Changes
src/secret_rotation/mod.rs(527 lines)MAX_ACTIVE_VERSIONS) support in-flight request drainingsrc/lib.rs— addedpub mod secret_rotation;Test Coverage (14 tests)
Design
alloc) for Soroban/WASM compatibilityCloses #79