-
Notifications
You must be signed in to change notification settings - Fork 80
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
Implement Healthcheck status for keys loading #738
Changes from 19 commits
d42a1c2
26e7937
6c7c1c0
810c226
3cb3c3c
030c39b
941b3d6
0aa4aad
8983d51
a3f49b2
6c61244
ef8214c
8d9aeb2
498940d
ea83580
d2e47c2
1dc4da1
07f914e
31f2441
13f3dc5
4aa854c
3b335e2
6fb1f29
e15472a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
import tech.pegasys.web3signer.dsl.utils.MetadataFileHelpers; | ||
import tech.pegasys.web3signer.signing.KeyType; | ||
|
||
import java.net.URI; | ||
import java.nio.file.Path; | ||
import java.util.Collections; | ||
import java.util.Optional; | ||
|
@@ -178,10 +179,16 @@ public void ableToSignUsingAws() throws JsonProcessingException { | |
final String roAwsAccessKeyId = System.getenv("AWS_ACCESS_KEY_ID"); | ||
final String roAwsSecretAccessKey = System.getenv("AWS_SECRET_ACCESS_KEY"); | ||
final String region = Optional.ofNullable(System.getenv("AWS_REGION")).orElse("us-east-2"); | ||
// can be pointed to localstack | ||
final Optional<URI> awsEndpointOverride = | ||
System.getenv("AWS_ENDPOINT_OVERRIDE") != null | ||
? Optional.of(URI.create(System.getenv("AWS_ENDPOINT_OVERRIDE"))) | ||
: Optional.empty(); | ||
final String publicKey = KEY_PAIR.getPublicKey().toString(); | ||
|
||
final AwsSecretsManagerUtil awsSecretsManagerUtil = | ||
new AwsSecretsManagerUtil(region, rwAwsAccessKeyId, rwAwsSecretAccessKey); | ||
new AwsSecretsManagerUtil( | ||
region, rwAwsAccessKeyId, rwAwsSecretAccessKey, awsEndpointOverride); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if this appropriate test or not but would be good to have a test case for config-files-loading check as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added healthcheck AT related to config-files-loading. |
||
|
||
awsSecretsManagerUtil.createSecret(publicKey, PRIVATE_KEY, Collections.emptyMap()); | ||
final String fullyPrefixKeyName = awsSecretsManagerUtil.getSecretsManagerPrefix() + publicKey; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, be good to have a test showing that checks have the appropriate status and error count values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it in AWS Secrets Manager AT.