Skip to content
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

feat: allow endpoint override for secrets manager plugin #707

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

crystall-bitquill
Copy link
Contributor

Summary

Allow endpoint override for secrets manager plugin

Description

  • adds the configuration parameter secretsManagerEndpoint to allow users to set the endpoint override for secret retrieval in the secrets manager plugin

Addresses #630

Additional Reviewers

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

.endpointOverride(endpointURI)
.region(region)
.build();
} catch (URISyntaxException e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the only exception we can have from the endpoint override?
What happens if the syntax is ok but the endpoint doesn't lead anywhere?
is there a way to see all the exceptions this call can throw?

@@ -36,6 +36,7 @@ AwsCredentialsManager.nullProvider=The configured AwsCredentialsProvider was nul
AwsSdk.unsupportedRegion=Unsupported AWS region ''{0}''. For supported regions please read https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html

# AWS Secrets Manager Connection Plugin
AwsSecretsManagerConnectionPlugin.endpointOverrideMisconfigured=The provided endpoint could not be used to create a URI: ``{0}``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: is it worth using a scarier word like incorrect or invalid?

@@ -72,6 +74,9 @@ public class AwsSecretsManagerConnectionPlugin extends AbstractConnectionPlugin
public static final AwsWrapperProperty REGION_PROPERTY = new AwsWrapperProperty(
"secretsManagerRegion", "us-east-1",
"The region of the secret to retrieve.");
public static final AwsWrapperProperty ENDPOINT_PROPERTY = new AwsWrapperProperty(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: should we add SECRETS_MANAGER prefix to both properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ok without the prefix, since these properties are only used in the plugin and there isn't any ambiguity on what the they are.

|--------------------------|:------:|:--------------------------------------------------------:|:-------------------------------------------------------------------------|:------------------------|---------------|
| `secretsManagerSecretId` | String | Yes | Set this value to be the secret name or the secret ARN. | `secretId` | `null` |
| `secretsManagerRegion` | String | Yes unless the `secretsManagerSecretId` is a Secret ARN. | Set this value to be the region your secret is in. | `us-east-2` | `us-east-1` |
| `secretsManagerEndpoint` | String | No | Set this value to be the endpoint override to retrieve your secret from. | `http://localhost:1234` | `null` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to indicate that it is a URL in the description, and also indicate which formats are OK or not (ex: port mandatory or not)

@crystall-bitquill crystall-bitquill enabled auto-merge (squash) October 31, 2023 21:56
@crystall-bitquill crystall-bitquill merged commit 203e83b into aws:main Nov 1, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants