Skip to content

NIFI-15890 Add Token Request Endpoint property to AwsRdsIamDatabasePasswordProvider#11189

Open
yagipy wants to merge 2 commits intoapache:mainfrom
yagipy:NIFI-15890
Open

NIFI-15890 Add Token Request Endpoint property to AwsRdsIamDatabasePasswordProvider#11189
yagipy wants to merge 2 commits intoapache:mainfrom
yagipy:NIFI-15890

Conversation

@yagipy
Copy link
Copy Markdown

@yagipy yagipy commented Apr 29, 2026

Summary

NIFI-15890

Added an optional Token Request Endpoint property to AwsRdsIamDatabasePasswordProvider to support architectures where the JDBC URL points to an intermediary such as a Network Load Balancer in front of an RDS Proxy.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

…ider

Added optional RDS Endpoint property to override hostname and port used for IAM token signing when JDBC URL points to an intermediary such as a Network Load Balancer in front of an RDS Proxy

Signed-off-by: yagipy <email@yagipy.me>
@yagipy yagipy marked this pull request as ready for review April 29, 2026 22:01
Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

Thanks for proposing this optional property @yagipy. The general approach looks good, I recommend a few implementation and naming adjustments.

Comment on lines +190 to +191
// Prepend a dummy scheme to delegate host and port parsing to the standard URI parser
final URI uri = URI.create("tcp://" + endpoint);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I recommend creating a format for the endpoint URI to be used as follows:

Suggested change
// Prepend a dummy scheme to delegate host and port parsing to the standard URI parser
final URI uri = URI.create("tcp://" + endpoint);
final URI uri = URI.create(URI_ENDPOINT_FORMAT.formatted(endpoint));

try {
// Prepend a dummy scheme to delegate host and port parsing to the standard URI parser
final URI uri = URI.create("tcp://" + endpoint);
return new ParsedEndpoint(uri.getHost(), uri.getPort() >= 0 ? uri.getPort() : null);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The port should be required, so the ternary check seems unnecessary.

Suggested change
return new ParsedEndpoint(uri.getHost(), uri.getPort() >= 0 ? uri.getPort() : null);
return new ParsedEndpoint(uri.getHost(), uri.getPort());

final int port = resolvePort(parsedEndpoint);
final String hostname;
final int port;
if (rdsEndpoint != null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor styling, I recommend reversing the logic so that it reads: if (rdsEndpoint == null) { ... } else { ... }

Comment on lines +64 to +65
static final PropertyDescriptor RDS_ENDPOINT = new PropertyDescriptor.Builder()
.name("RDS Endpoint")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For clarity of behavior, it seems like this should be named something like Token Request Endpoint or Token Request RDS Endpoint.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Renamed to Token Request Endpoint.

@yagipy
Copy link
Copy Markdown
Author

yagipy commented May 3, 2026

Thank you for the review, @exceptionfactory. I have pushed a commit addressing all of your comments.
38c7552

@yagipy yagipy changed the title NIFI-15890 Add RDS Endpoint property to AwsRdsIamDatabasePasswordProvider NIFI-15890 Add Token Request Endpoint property to AwsRdsIamDatabasePasswordProvider May 3, 2026
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