Repository navigation
feat: add KMS service with all 39 operations - #6
Merged
Merged
Conversation
Implement AWS KMS (Key Management Service) support for RustStack with real cryptographic operations using aws-lc-rs. ## Phase 0: Key Management + Crypto (21 operations) - CreateKey, DescribeKey, ListKeys, EnableKey, DisableKey - ScheduleKeyDeletion, CancelKeyDeletion, UpdateKeyDescription - Encrypt/Decrypt (AES-256-GCM symmetric), ReEncrypt - GenerateDataKey, GenerateDataKeyWithoutPlaintext - GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext - Sign/Verify (RSA PSS/PKCS1, ECDSA P-256/P-384/P-521) - GetPublicKey, GenerateMac/VerifyMac (HMAC-SHA-*), GenerateRandom ## Phase 1: Aliases + Tags + Policies (10 operations) - CreateAlias, DeleteAlias, ListAliases, UpdateAlias - TagResource, UntagResource, ListResourceTags - GetKeyPolicy, PutKeyPolicy, ListKeyPolicies ## Phase 2: Grants + Key Rotation (8 operations) - CreateGrant, ListGrants, RetireGrant, RevokeGrant, ListRetirableGrants - EnableKeyRotation, DisableKeyRotation, GetKeyRotationStatus ## Architecture - Smithy-generated model types from official AWS JSON AST - Custom base64 serde for blob fields (ciphertext, plaintext, etc.) - Self-describing ciphertext blob format (key ID + IV + tag + data) - Key state machine (Enabled/Disabled/PendingDeletion) - DashMap-based concurrent storage for keys, aliases, grants - TrentService.* X-Amz-Target routing (awsJson1.1 protocol) - Feature-gated integration in gateway (single binary on port 4566) - 29 integration tests using aws-sdk-kms Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Security: - Redact key material in Debug impls for KmsKey and KeyMaterial Correctness: - Fix internal_error using DependencyTimeoutException -> KMSInternalException - Add PendingWindowInDays validation (7-30 range) - Add key state validation for update_key_description - Fix cast_sign_loss with usize::try_from Compatibility: - Add epoch_seconds serde for timestamp fields (f64 epoch seconds) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
aws-lc-rs, and full aws-sdk-kms compatibilityruststack-kms-model(Smithy-generated types),ruststack-kms-http(awsJson1.1 protocol layer),ruststack-kms-core(business logic + crypto engine)TrentService.*X-Amz-Target routing, feature-gated behindkmscargo featurePhase 0: Key Management + Cryptographic Operations (21 ops)
Phase 1: Aliases + Tags + Policies (10 ops)
Phase 2: Grants + Key Rotation (8 ops)
Key Design Decisions
aws-lc-rs: AES-256-GCM, RSA OAEP, RSA PSS/PKCS1, ECDSA, HMAC — not mockedDecryptworks without explicitKeyIdbytes::Bytesfields matching AWS wire formatchrono::DateTimefields matching AWS SDK expectationsTest plan
aws-sdk-kmscovering all phasescargo clippy --all-targets --all-features -- -D warningscleancargo +nightly fmtappliedcargo test -p ruststack-integration -- --ignored)🤖 Generated with Claude Code