NIFI-15890 Add Token Request Endpoint property to AwsRdsIamDatabasePasswordProvider#11189
NIFI-15890 Add Token Request Endpoint property to AwsRdsIamDatabasePasswordProvider#11189yagipy wants to merge 2 commits intoapache:mainfrom
Conversation
…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>
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for proposing this optional property @yagipy. The general approach looks good, I recommend a few implementation and naming adjustments.
| // Prepend a dummy scheme to delegate host and port parsing to the standard URI parser | ||
| final URI uri = URI.create("tcp://" + endpoint); |
There was a problem hiding this comment.
I recommend creating a format for the endpoint URI to be used as follows:
| // 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); |
There was a problem hiding this comment.
The port should be required, so the ternary check seems unnecessary.
| 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) { |
There was a problem hiding this comment.
Minor styling, I recommend reversing the logic so that it reads: if (rdsEndpoint == null) { ... } else { ... }
| static final PropertyDescriptor RDS_ENDPOINT = new PropertyDescriptor.Builder() | ||
| .name("RDS Endpoint") |
There was a problem hiding this comment.
For clarity of behavior, it seems like this should be named something like Token Request Endpoint or Token Request RDS Endpoint.
There was a problem hiding this comment.
Renamed to Token Request Endpoint.
|
Thank you for the review, @exceptionfactory. I have pushed a commit addressing all of your comments. |
Summary
NIFI-15890
Added an optional
Token Request Endpointproperty toAwsRdsIamDatabasePasswordProviderto 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
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation