mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-06 04:26:57 +00:00
Fixes GEN-2198: Snowflake unencrypted key support, connection error on storing bytes (#18927)
This commit is contained in:
parent
e770ba8e0e
commit
81b68682aa
@ -121,7 +121,7 @@ def get_connection(connection: SnowflakeConnection) -> Engine:
|
||||
)
|
||||
p_key = serialization.load_pem_private_key(
|
||||
bytes(connection.privateKey.get_secret_value(), "utf-8"),
|
||||
password=snowflake_private_key_passphrase.encode(),
|
||||
password=snowflake_private_key_passphrase.encode() or None,
|
||||
backend=default_backend(),
|
||||
)
|
||||
pkb = p_key.private_bytes(
|
||||
@ -137,11 +137,16 @@ def get_connection(connection: SnowflakeConnection) -> Engine:
|
||||
"client_session_keep_alive"
|
||||
] = connection.clientSessionKeepAlive
|
||||
|
||||
return create_generic_db_connection(
|
||||
engine = create_generic_db_connection(
|
||||
connection=connection,
|
||||
get_connection_url_fn=get_connection_url,
|
||||
get_connection_args_fn=get_connection_args_common,
|
||||
)
|
||||
if connection.connectionArguments.root and connection.connectionArguments.root.get(
|
||||
"private_key"
|
||||
):
|
||||
del connection.connectionArguments.root["private_key"]
|
||||
return engine
|
||||
|
||||
|
||||
def test_connection(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user