From d4d19c157c32f94266b940277ca302bbc00cc8a9 Mon Sep 17 00:00:00 2001 From: justing-bq Date: Fri, 31 Mar 2023 17:29:50 -0700 Subject: [PATCH] hopefully final changes --- driver/iam_proxy.cc | 8 ++------ integration/base_failover_integration_test.cc | 2 +- integration/iam_authentication_integration_test.cc | 2 +- util/installer.cc | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/driver/iam_proxy.cc b/driver/iam_proxy.cc index 2b6de5317..b633e7921 100644 --- a/driver/iam_proxy.cc +++ b/driver/iam_proxy.cc @@ -77,14 +77,10 @@ bool IAM_PROXY::connect(const char* host, const char* user, const char* password } else { // Go with default region if region is not provided. - region = "us-east-1"; + region = Aws::Region::US_EAST_1; } - if (ds->auth_port > 0) { - port = ds->auth_port; - } - - std::string auth_token = this->get_auth_token(auth_host, region, port, user, ds->auth_expiration); + std::string auth_token = this->get_auth_token(auth_host, region, ds->auth_port, user, ds->auth_expiration); bool connect_result = next_proxy->connect(host, user, auth_token.c_str(), database, port, socket, flags); if (!connect_result) { diff --git a/integration/base_failover_integration_test.cc b/integration/base_failover_integration_test.cc index 35c44a521..733692813 100644 --- a/integration/base_failover_integration_test.cc +++ b/integration/base_failover_integration_test.cc @@ -161,7 +161,7 @@ class BaseFailoverIntegrationTest : public testing::Test { const std::string ERROR_CONN_FAILURE_DURING_TX = "08007"; // Helper functions - + std::string get_endpoint(const std::string& instance_id) const { return instance_id + DB_CONN_STR_SUFFIX; } diff --git a/integration/iam_authentication_integration_test.cc b/integration/iam_authentication_integration_test.cc index 151d43b04..f9a89ad71 100644 --- a/integration/iam_authentication_integration_test.cc +++ b/integration/iam_authentication_integration_test.cc @@ -156,7 +156,7 @@ class IamAuthenticationIntegrationTest : public testing::Test { .withEnableClusterFailover(false) // Failover interferes with some of our tests .withAuthMode("IAM") .withAuthRegion("us-east-2") - .withAuthExpiration(100); + .withAuthExpiration(900); } void TearDown() override { diff --git a/util/installer.cc b/util/installer.cc index 4a28c67ec..781da0554 100644 --- a/util/installer.cc +++ b/util/installer.cc @@ -749,8 +749,8 @@ DataSource *ds_new() ds->port = 3306; ds->has_port = false; ds->no_schema = 1; - ds->auth_port = 0; - ds->auth_expiration = 0; + ds->auth_port = 3306; + ds->auth_expiration = 900; // 15 minutes ds->enable_cluster_failover = true; ds->allow_reader_connections = false; ds->gather_perf_metrics = false;