Skip to content

Commit

Permalink
replace get_secrets_file with get
Browse files Browse the repository at this point in the history
Signed-off-by: HH <hhcs9527@gmail.com>
  • Loading branch information
hhcs9527 committed Sep 27, 2023
1 parent b8cba87 commit 8346fb9
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions flytekit/types/structured/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,9 @@ def get_private_key():

import flytekit

pk_path = flytekit.current_context().secrets.get_secrets_file(SNOWFLAKE, "rsa_key.p8")
pk_string = flytekit.current_context().secrets.get(SNOWFLAKE, "private_key")

with open(pk_path, "rb") as key:
p_key = serialization.load_pem_private_key(key.read(), password=None, backend=default_backend())

return p_key.private_bytes(
encoding=serialization.Encoding.DER,
format=serialization.PrivateFormat.PKCS8,
encryption_algorithm=serialization.NoEncryption(),
)
return serialization.load_pem_private_key(pk_string, password=None, backend=default_backend())


def _write_to_sf(structured_dataset: StructuredDataset):
Expand Down

0 comments on commit 8346fb9

Please sign in to comment.