Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add private_key_passphrase kwargs to Connection.__init__ #2130

Open
yassun7010 opened this issue Jan 10, 2025 · 1 comment · May be fixed by #2131
Open

Add private_key_passphrase kwargs to Connection.__init__ #2130

yassun7010 opened this issue Jan 10, 2025 · 1 comment · May be fixed by #2131
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team

Comments

@yassun7010
Copy link

yassun7010 commented Jan 10, 2025

What is the current behavior?

I am trying to move from User/Pass to Key/Pair authentication.

Snowflake's Python connector does not have a field to enter a passphrase if the secret key is passed as a byte string.

The passphrase can be used by passing RSAPrivateKey in Connection's private_key.

snowflake_conn = snowflake.connector.connect(
    user=SNOWFLAKE_USER,
    account=SNOWFLAKE_ACCOUNT,
    warehouse=SNOWFLAKE_WAREHOUSE,
    database=SNOWFLAKE_DATABASE,
    schema=SNOWFLAKE_SCHEMA,
    private_key=load_der_private_key(
        data=base64.b64decode(PRIVATE_KEY),
        password=PRIVATE_KEY_PASSPHRASE.encode("UTF-8"),
    ),
)

What is the desired behavior?

I can use the private key by passing RSAPrivateKey in private_key though,
It would be convenient to pass it directly as an argument, like any other user/password.

How would this improve snowflake-connector-python?

add private_key_passphrase params to Connection.__init__

References and other background

No response

@yassun7010 yassun7010 linked a pull request Jan 10, 2025 that will close this issue
7 tasks
@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage_done Initial triage done, will be further handled by the driver team and removed needs triage labels Jan 10, 2025
@sfc-gh-dszmolka
Copy link
Contributor

hi.- thanks for raising this enhancement request and especially the PR for it. The team will review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants