-
Notifications
You must be signed in to change notification settings - Fork 478
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
SNOW-1825473 adding pat authentication integration #2122
Conversation
@@ -22,7 +22,7 @@ def type_(self) -> AuthType: | |||
return AuthType.OAUTH | |||
|
|||
@property | |||
def assertion_content(self) -> str: | |||
def assertion_content(self) -> str | None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why added None here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type-hint was incorrect. It doesn't actually affect correctness, but you can see a few lines below that the function reset_secrets
sets what this returns to None
@@ -187,6 +187,7 @@ | |||
OAUTH_AUTHENTICATOR = "OAUTH" | |||
ID_TOKEN_AUTHENTICATOR = "ID_TOKEN" | |||
USR_PWD_MFA_AUTHENTICATOR = "USERNAME_PASSWORD_MFA" | |||
PROGRAMMATIC_ACCESS_TOKEN = "PROGRAMMATIC_ACCESS_TOKEN" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How user will provide authentication name in connection parameter? like "PROGRAMMATIC_ACCESS_TOKEN"? If yes, then can we use "PAT" instead of long name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the exact shell command I was using to test the feature: python -c 'from snowflake.connector import connect; c=connect(account="account", user="user", authenticator="PROGRAMMATIC_ACCESS_TOKEN", token_file_path="/Users/mkeller/pat"); print(c.cursor().execute("select 1, 2").fetchall())'
I haven't introduced the short form simply because we don't offer short-hands for any of the other authentications. I'm happy to introduce it if you think we should start now though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1825473
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
In this PR I introduce support for the new PAT authentication method. We don't have automated tests for all the different authentication methods, so the code was tested manually.
(Optional) PR for stored-proc connector: