SNOW-2865734: Fix unnecessary token caching and username_password_mfa auth#997
Merged
sfc-gh-pbulawa merged 2 commits intomasterfrom Mar 19, 2026
Merged
SNOW-2865734: Fix unnecessary token caching and username_password_mfa auth#997sfc-gh-pbulawa merged 2 commits intomasterfrom
sfc-gh-pbulawa merged 2 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #997 +/- ##
==========================================
+ Coverage 80.74% 80.84% +0.10%
==========================================
Files 137 137
Lines 12077 12078 +1
==========================================
+ Hits 9751 9764 +13
+ Misses 2326 2314 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sfc-gh-ddas
approved these changes
Mar 19, 2026
sfc-gh-makowalski
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes the missing authenticator type for username/password with MFA token caching (
SF_AUTHENTICATOR_USR_PWD_MFA) and adds comprehensive tests to verify its behavior. It ensures that MFA tokens are only cached for this authenticator and not for the default username/password authentication. The changes include updates to the core logic, constants, and test suites.Authenticator logic and constants:
SF_AUTHENTICATOR_USR_PWD_MFAconstant insnowflake/client.hand updatedAuthenticator.cppto recognize it, mapping it to theAUTH_USR_PWD_MFAtype.AUTH_USR_PWD_MFAseparately, ensuring MFA token caching only applies to this type and not to the default authenticator.Testing enhancements:
test_usr_pwd_mfa(for MFA token caching) andtest_default_auth(for default auth without MFA token caching), with corresponding CMake configurations and Wiremock login responses.test_usr_pwd_mfa.cppto verify successful connection and correct MFA token caching behavior for the new authenticator.test_default_auth.cppto ensure that MFA tokens are not cached for default username/password authentication.