Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### :bug: Fixed
- Custom endpoint monitor obeys refresh rate ([PR #1175](https://github.com/aws/aws-advanced-jdbc-wrapper/pull/1175)).
- Abort interrupts running queries ([PR #1182](https://github.com/aws/aws-advanced-jdbc-wrapper/pull/1182))
- Use the AwsCredentialsProviderHandler from the ConfigurationProfile when it is defined ([PR #1183](https://github.com/aws/aws-advanced-jdbc-wrapper/pull/1183)).

## [2.5.2] - 2024-11-4
### :bug: Fixed
Expand Down
4 changes: 4 additions & 0 deletions wrapper/src/main/java/software/amazon/jdbc/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.logging.Logger;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import software.amazon.jdbc.authentication.AwsCredentialsManager;
import software.amazon.jdbc.profile.ConfigurationProfile;
import software.amazon.jdbc.profile.DriverConfigurationProfiles;
import software.amazon.jdbc.states.ResetSessionStateOnCloseCallable;
Expand Down Expand Up @@ -125,6 +126,9 @@ public Connection connect(final String url, final Properties info) throws SQLExc
configurationProfile = DriverConfigurationProfiles.getProfileConfiguration(profileName);
if (configurationProfile != null) {
PropertyUtils.addProperties(props, configurationProfile.getProperties());
if (configurationProfile.getAwsCredentialsProviderHandler() != null) {
AwsCredentialsManager.setCustomHandler(configurationProfile.getAwsCredentialsProviderHandler());
}
} else {
throw new SQLException(
Messages.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@
import java.io.PrintWriter;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import javax.naming.NamingException;
import javax.naming.Reference;
import javax.naming.Referenceable;
Expand All @@ -45,6 +41,7 @@
import software.amazon.jdbc.HostSpec;
import software.amazon.jdbc.PropertyDefinition;
import software.amazon.jdbc.TargetDriverHelper;
import software.amazon.jdbc.authentication.AwsCredentialsManager;
import software.amazon.jdbc.profile.ConfigurationProfile;
import software.amazon.jdbc.profile.DriverConfigurationProfiles;
import software.amazon.jdbc.targetdriverdialect.TargetDriverDialect;
Expand Down Expand Up @@ -111,6 +108,9 @@ public Connection getConnection(final String username, final String password) th
configurationProfile = DriverConfigurationProfiles.getProfileConfiguration(profileName);
if (configurationProfile != null) {
PropertyUtils.addProperties(props, configurationProfile.getProperties());
if (configurationProfile.getAwsCredentialsProviderHandler() != null) {
AwsCredentialsManager.setCustomHandler(configurationProfile.getAwsCredentialsProviderHandler());
}
} else {
throw new SQLException(
Messages.get(
Expand Down
Loading