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

Adding AWS S3 Configuration Provider and AWS Secrets Manager Provider #135

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

ting-lan-wang
Copy link
Member

Combining the work by @psilberk into this branch.

This branch adds the following Configuration Providers for AWS Services:

  • AwsS3ConfigurationProvider: this provider retrieves the configuration in JSON Payload format from AWS S3.
  • AwsSecretsManagerConfigurationProvider: which retrieves the configuration in JSON Payload format from AWS Secrets Manager.
  • AwsJsonSecretsManagerProvider: which retrieves the JSON configuration from a AWS Secrets Manager.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 6, 2024
Copy link
Member

@psilberk psilberk left a comment

Choose a reason for hiding this comment

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

Looks good except for some minor comments I just left. Please let me know when addressed.

psilberk and others added 9 commits January 18, 2025 11:46
 Changes to be committed:
	modified:   ojdbc-provider-aws/pom.xml
	new file:   ojdbc-provider-aws/src/main/java/oracle/jdbc/provider/aws/authentication/AwsAuthenticationMethod.java
	new file:   ojdbc-provider-aws/src/main/java/oracle/jdbc/provider/aws/authentication/AwsBasicCredentialsFactory.java
	new file:   ojdbc-provider-aws/src/main/java/oracle/jdbc/provider/aws/configuration/AWSAppConfigProvider.java
	new file:   ojdbc-provider-aws/src/main/java/oracle/jdbc/provider/aws/configuration/AWSAppConfigurationURLParser.java
	new file:   ojdbc-provider-aws/src/main/java/oracle/jdbc/provider/aws/configuration/AWSConfigurationParameters.java
	modified:   ojdbc-provider-aws/src/main/resources/META-INF/services/oracle.jdbc.spi.OracleConfigurationProvider
	new file:   ojdbc-provider-samples/src/main/java/oracle/jdbc/provider/aws/configuration/SimpleAWSAppConfigExample.java
@ting-lan-wang
Copy link
Member Author

ting-lan-wang commented Jan 20, 2025

@psilberk all the review comments has been addressed.

psilberk
psilberk previously approved these changes Jan 21, 2025
Copy link
Member

@psilberk psilberk left a comment

Choose a reason for hiding this comment

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

Looks very good, thanks!

AwsCredentials awsCredentials = getCredential(parameterSet);
// TODO: Access tokens expire. Does a TokenCredential internally cache one?
// If so, then return an expiring resource.
return Resource.createPermanentResource(awsCredentials, true);
Copy link
Member

Choose a reason for hiding this comment

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

Is this TODO resolved ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will fix this in the next commit

.addParameter("value", SecretsManagerFactory.SECRET_NAME)
.addParameter("REGION", SecretsManagerFactory.REGION)
.addParameter("key_name", SecretsManagerFactory.KEY_NAME))
.build();
Copy link
Member

Choose a reason for hiding this comment

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

Why are some parameters in capitals but not all ?

Copy link
Member Author

@ting-lan-wang ting-lan-wang Jan 31, 2025

Choose a reason for hiding this comment

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

This parser is used by both AwsJsonSecretsManagerProvider and AwsSecretsManagerConfigurationProvider. The REGION is in upper case to follow the naming convention in AUTHENTICATION and the related parameters. The same logic applies to the other parameter in lower cases.
Here's an example of the password object in Json payload:

    "password": {
      "type": "awssecretsmanager",
      "value": "db-password-us-east-1",
      "authentication": {
        "AWS_REGION": "us-east-1"
      }
    },

The REGION parameter will be renamed to AWS_REGION in the next upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants