Skip to content

Commit

Permalink
Formatting code.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioalarcon authored and pmossman committed Dec 12, 2022
1 parent d0f9970 commit 56f990c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -39,7 +39,8 @@ public class AWSSecretManagerPersistence implements SecretPersistence {

/**
* Creates a AWSSecretManagerPersistence using the default client and region from the current AWS
* credentials. Recommended way based on <a href="https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html">this</a>
* credentials. Recommended way based on
* <a href="https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html">this</a>
* This implementation makes use of SecretCache as optimization to access secrets.
*
* @see SecretCache
Expand Down Expand Up @@ -68,14 +69,18 @@ public AWSSecretManagerPersistence(final String region) {

/**
* Creates a new AWSSecretManagerPersistence using the provided explicitly passed credentials.
*
* @param awsAccessKey The AWS access key.
* @param awsSecretAccessKey The AWS secret access key.
*/
public AWSSecretManagerPersistence(final String awsAccessKey, final String awsSecretAccessKey) {
checkNotNull(awsAccessKey, "awsAccessKey cannot be null, to use a default region call AWSSecretManagerPersistence.AWSSecretManagerPersistence()");
checkNotNull(awsSecretAccessKey, "awsSecretAccessKey cannot be null, to use a default region call AWSSecretManagerPersistence.AWSSecretManagerPersistence()");
checkArgument(!awsAccessKey.isEmpty(), "awsAccessKey cannot be empty, to use a default region call AWSSecretManagerPersistence.AWSSecretManagerPersistence()");
checkArgument(!awsSecretAccessKey.isEmpty(), "awsSecretAccessKey cannot be empty, to use a default region call AWSSecretManagerPersistence.AWSSecretManagerPersistence()");
checkNotNull(awsSecretAccessKey,
"awsSecretAccessKey cannot be null, to use a default region call AWSSecretManagerPersistence.AWSSecretManagerPersistence()");
checkArgument(!awsAccessKey.isEmpty(),
"awsAccessKey cannot be empty, to use a default region call AWSSecretManagerPersistence.AWSSecretManagerPersistence()");
checkArgument(!awsSecretAccessKey.isEmpty(),
"awsSecretAccessKey cannot be empty, to use a default region call AWSSecretManagerPersistence.AWSSecretManagerPersistence()");
BasicAWSCredentials credentials = new BasicAWSCredentials(awsAccessKey, awsSecretAccessKey);
this.client = AWSSecretsManagerClientBuilder
.standard()
Expand Down
Expand Up @@ -21,7 +21,6 @@ public class AWSSecretManagerPersistenceIntegrationTest {
private AWSSecretManagerPersistence persistence;
private final Configs configs = new EnvConfigs();


@BeforeEach
void setup() {
persistence = new AWSSecretManagerPersistence(configs.getAwsAccessKey(), configs.getAwsSecretAccessKey());
Expand Down

0 comments on commit 56f990c

Please sign in to comment.