Skip to content

Commit ae4c038

Browse files
author
gdgate
authored
Merge pull request #1821 from tqtu/MSF-22578
FEATURE: MSF-22578,MSF-22133 Add Gooddata platform parameter snowflake and set TLS default mysql Reviewed-by: <phong.nguyen-duy@gooddata.com> https://github.com/phong-nguyen-duy
2 parents 3dd4e65 + 93e8c0f commit ae4c038

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.41
1+
3.7.42

lib/gooddata/cloud_resources/mysql/mysql_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def build_url(url)
9393
host = matches[0][0]
9494
port = matches[0][2]&.to_i || MYSQL_DEFAULT_PORT
9595

96-
"#{JDBC_MYSQL_PROTOCOL}#{host}:#{port}/#{@database}?sslmode=#{get_ssl_mode(@ssl_mode)}&useCursorFetch=true"
96+
"#{JDBC_MYSQL_PROTOCOL}#{host}:#{port}/#{@database}?sslmode=#{get_ssl_mode(@ssl_mode)}&useCursorFetch=true&enabledTLSProtocols=TLSv1.2"
9797
end
9898

9999
def get_ssl_mode(ssl_mode)

lib/gooddata/cloud_resources/snowflake/snowflake_client.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
module GoodData
1919
module CloudResources
2020
class SnowflakeClient < CloudResourceClient
21+
SNOWFLAKE_GDC_APPLICATION_PARAMETER = 'application=GoodData_Platform'
22+
SNOWFLAKE_SEPARATOR_PARAM = '?'
23+
2124
class << self
2225
def accept?(type)
2326
type == 'snowflake'
@@ -31,7 +34,7 @@ def initialize(options = {})
3134
@database = options['snowflake_client']['connection']['database']
3235
@schema = options['snowflake_client']['connection']['schema'] || 'public'
3336
@warehouse = options['snowflake_client']['connection']['warehouse']
34-
@url = options['snowflake_client']['connection']['url']
37+
@url = build_url(options['snowflake_client']['connection']['url'])
3538
@authentication = options['snowflake_client']['connection']['authentication']
3639
else
3740
raise('Missing connection info for Snowflake client')
@@ -79,6 +82,20 @@ def connect
7982

8083
@connection = java.sql.DriverManager.getConnection(@url, prop)
8184
end
85+
86+
def build_url(url)
87+
is_contain = url.include?(SNOWFLAKE_GDC_APPLICATION_PARAMETER)
88+
unless is_contain
89+
if url.include?(SNOWFLAKE_SEPARATOR_PARAM)
90+
url.concat("&")
91+
else
92+
url.concat(SNOWFLAKE_SEPARATOR_PARAM)
93+
end
94+
url.concat(SNOWFLAKE_GDC_APPLICATION_PARAMETER)
95+
end
96+
97+
url
98+
end
8299
end
83100
end
84101
end

0 commit comments

Comments
 (0)