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

fix: Ensure tokens are cached when using browser authentication or basic authentication with MFA #50

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

dlouseiro
Copy link
Contributor

The purpose of this PR is to fix the issue reported here, essentially making sure that oauth tokens are cached when using browser authentication to avoid having multiple browser windows popping in consecutive runs, even when the Snowflake account being accessed has ALLOW_ID_TOKEN option enabled.

While there, also ensured proper caching of MFA tokens (when the user account has ALLOW_CLIENT_MFA_CACHING enabled).

Implementation details:

  • Add secure-local-storage extra to snowflake-connector-python dependency
  • Add "client_request_mfa_token": True and "client_store_temporary_credential": True to the connection arguments of the SQLAlchemy engine. This is mostly relevant for Linux users, as for MacOs (at least) the secure-local-storage extra is enough.
  • Fix some linting issues (done by pre-commit steps)

@edgarrmondragon edgarrmondragon changed the title Ensure tokens are cached when using browser authentication or basic authentication with MFA fix: Ensure tokens are cached when using browser authentication or basic authentication with MFA Oct 24, 2024
@edgarrmondragon edgarrmondragon self-requested a review October 24, 2024 15:58
@edgarrmondragon edgarrmondragon self-assigned this Oct 24, 2024
Copy link
Member

@edgarrmondragon edgarrmondragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @dlouseiro!

Just one question.

tap_snowflake/client.py Show resolved Hide resolved
@edgarrmondragon edgarrmondragon merged commit 833642e into MeltanoLabs:main Oct 25, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants