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: IAM auth token generator for RDS #1851

Merged
merged 9 commits into from
Dec 30, 2024
Merged

Conversation

sichanyoo
Copy link
Contributor

@sichanyoo sichanyoo commented Dec 26, 2024

Issue #

Description of changes

Changes:

  • Adds AWSClientRuntime.AuthTokenGenerator. It's tagged with @_spi to hide it and re-expose through AWSRDS module.
  • Adds integration for code-generatingAWSRDS.AuthTokenGenerator, which is a wrapper class for AWSClientRutime.AuthTokenGenerator (this is done to expose token generator via RDS module, as outlined by specifications)

Tested using a dummy AWS RDS MySQL database and confirmed it works.

New/existing dependencies impact assessment, if applicable

Conventional Commits

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

Copy link
Contributor Author

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

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

Misc. informational comments

@@ -0,0 +1,100 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the handwritten code for token generator, located in AWSClientRuntime

@@ -0,0 +1,63 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the generated token generator located in AWSRDS that wraps AWSClientRuntime.AuthTokenGenerator; it's included in the PR as reference for reviewers on what generated output looks like.

@@ -0,0 +1,84 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new codegen integration that writes a new file with wrapper token generator if service is RDS.

@@ -26,3 +26,4 @@ software.amazon.smithy.aws.swift.codegen.AWSClientConfigurationIntegration
software.amazon.smithy.swift.codegen.swiftintegrations.InitialRequestIntegration
software.amazon.smithy.aws.swift.codegen.swiftintegrations.RegistryConfigIntegration
software.amazon.smithy.aws.swift.codegen.swiftintegrations.AmzSdkRetryHeadersIntegration
software.amazon.smithy.aws.swift.codegen.customization.rds.AuthTokenGeneratorIntegration
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes the new integration run during codegen

@sichanyoo sichanyoo merged commit bd2b045 into main Dec 30, 2024
25 checks passed
@sichanyoo sichanyoo deleted the feat/rds-auth-token-generator branch December 30, 2024 17:49
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.

2 participants