generated from ethereum-optimism/.github
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for an AWS KMS provider #122
Open
ddaws
wants to merge
10
commits into
ethereum-optimism:main
Choose a base branch
from
ddaws:feat/add-aws-kms-provider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+573
−9
Conversation
This file contains 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
Add KeyProvider type to specify cloud KMS provider (AWS or GCP) in AuthConfig. Defaults to GCP if not specified for backwards compatibility. Includes tests for config parsing and validation. - Add KeyProvider type with AWS and GCP options - Add validation for KeyProvider values - Default to GCP when type is not specified - Add unit tests for config parsing - Update example config.yaml with explicit GCP type
Move the KeyProvider configuration from individual AuthConfig entries to the top-level SignerServiceConfig. This simplifies the configuration by having a single provider type for all auth configs. - Rename config field to `provider` in yaml - Move KeyProvider from AuthConfig to SignerServiceConfig - Update config validation to check top-level provider - Update tests to reflect new config structure - Maintain backwards compatibility with GCP default
Add factory function to create SignatureProvider instances based on provider type. Updates service initialization to use the new factory pattern. - Add NewSignatureProvider factory function in provider package - Update NewSignerService to handle provider creation errors - Update app.go to handle potential service creation errors - Move ProviderType enum from config to provider package
Add AWS KMS implementation of SignatureProvider interface to support AWS KMS for signing operations. Updates provider factory to support both GCP and AWS. - Add AWSKMSSignatureProvider with Sign and GetPublicKey methods - Add AWS SDK dependencies - Update provider factory to support AWS KMS - Reuse existing signature conversion utilities - Add test-friendly constructor with mock client
Add AWS SDK dependencies required for AWS KMS implementation: - github.com/aws/aws-sdk-go-v2/config - github.com/aws/aws-sdk-go-v2 (indirect) These dependencies are needed for the AWS KMS signature provider functionality.
Add utility functions to marshal and unmarshal secp256k1 public keys in DER format for AWS KMS integration. Includes comprehensive tests to verify encoding compatibility. - Add marshalECDSAPublicKey function for DER encoding - Add unmarshalECDSAPublicKey function for DER decoding - Add tests to verify marshal/unmarshal roundtrip - Add tests to verify compatibility with AWS KMS format
Add utilities for converting between Ethereum's compact recoverable signature format and DER format, with comprehensive tests. - Add convertCompactRecoverableSignatureToDER function - Add test for DER conversion roundtrip - Add test for signature recoverability - Add test for signature format compatibility with go-ethereum This enables proper signature format handling between AWS KMS (DER) and Ethereum (compact recoverable)
Add comprehensive tests for AWS KMS signature provider implementation: - Add mock AWS KMS client for testing - Test GetPublicKey with DER-encoded secp256k1 keys - Test SignDigest with signature verification and recovery - Verify compatibility with Ethereum signature format - Test signature malleability and length requirements
Update error formatting in convertCompactRecoverableSignatureToDER to use %w instead of %v to properly wrap and preserve the original error context.
ddaws
changed the title
Draft: Adding support for an AWS KMS provider
Adding support for an AWS KMS provider
Jan 16, 2025
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.
Description
This PR adds AWS KMS support to the op-signer service, allowing users to choose between AWS KMS and Google Cloud KMS for signing operations. The implementation maintains backward compatibility by defaulting to GCP if no provider is specified.
TODO
Changes
Breaking Changes
None. Existing configurations without a provider specified will continue to use GCP KMS.
Tests
Config Tests (op-signer/service/config_test.go):
AWS KMS Tests (op-signer/service/provider/aws_kms_test.go):
Utility Tests (op-signer/service/provider/utils_test.go):
Additional context
Metadata