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

SNOW-715504: MFA token cache support #988

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Commits on Oct 25, 2024

  1. Squashed commit of the following:

    commit 7a384e8
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Jul 4 12:39:31 2024 -0700
    
        Rename internal property based on convention and fix missing comma
    
    commit f8b3230
    Merge: dd24c76 cd2078d
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Jul 4 12:35:41 2024 -0700
    
        Merge branch 'master' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-715524-SSO-Token-Cache
    
        # Conflicts:
        #	Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs
        #	Snowflake.Data/Core/Session/SFSession.cs
        #	Snowflake.Data/Core/Session/SFSessionHttpClientProperties.cs
        #	Snowflake.Data/Core/Session/SFSessionProperty.cs
        #	doc/Connecting.md
    
    commit dd24c76
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jul 3 20:53:12 2024 -0700
    
        Temporarily ignore test while looking for fix
    
    commit 2abcad4
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jul 3 19:49:17 2024 -0700
    
        Temporarily ignore test while looking for fix
    
    commit 590e98b
    Merge: 44c746b d1dad1c
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jul 3 17:38:35 2024 -0700
    
        Merge branch 'master' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-715524-SSO-Token-Cache
    
        # Conflicts:
        #	Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs
    
    commit 44c746b
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jul 3 17:30:25 2024 -0700
    
        Add mock for browser and tests for external browser authentication
    
    commit da0cffb
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri Jun 28 16:17:58 2024 -0700
    
        Remove unused packages
    
    commit adb3218
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 26 14:34:13 2024 -0700
    
        Replace user and add test explanation
    
    commit 5c9d8d7
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Tue Jun 25 14:02:05 2024 -0700
    
        Add check for new map parameter value
    
    commit 045fc04
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Tue Jun 25 12:44:11 2024 -0700
    
        Uncomment line in session property test
    
    commit d616dcc
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Tue Jun 25 12:26:32 2024 -0700
    
        Modify session property test
    
    commit 6ef9b35
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Tue Jun 25 11:37:16 2024 -0700
    
        Modify test to open the second connection before calling close
    
    commit 512de5b
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Jun 20 11:35:49 2024 -0700
    
        Remove modifying file permission on Windows
    
    commit 33ebec5
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Mon Jun 17 17:52:56 2024 -0700
    
        Refactor external browser authentication
    
    commit 403dbd2
    Merge: 8666194 194eafa
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Mon Jun 17 14:49:13 2024 -0700
    
        Merge branch 'SNOW-715524-SSO-Token-Cache' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-715524-SSO-Token-Cache
    
    commit 8666194
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Mon Jun 17 14:44:35 2024 -0700
    
        Refactor credential manager
    
    commit 194eafa
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Mon Jun 17 14:44:35 2024 -0700
    
        Refactor credential manager
    
    commit 8b38fed
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Mon Jun 17 11:14:21 2024 -0700
    
        Include ".snowflake" to the default cache directory
    
    commit 61855f2
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 12 17:45:29 2024 -0700
    
        Remove unused packages
    
    commit 4e57147
    Merge: 83119f3 1465bda
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 12 15:00:57 2024 -0700
    
        Merge branch 'master' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-715524-SSO-Token-Cache
    
        # Conflicts:
        #	README.md
        #	Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs
        #	Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs
        #	Snowflake.Data.Tests/UnitTests/SFSessionTest.cs
        #	Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs
        #	Snowflake.Data/Core/SFError.cs
        #	Snowflake.Data/Core/Session/SFSession.cs
        #	Snowflake.Data/Core/Session/SFSessionHttpClientProperties.cs
        #	Snowflake.Data/Core/Session/SFSessionProperty.cs
    
    commit 83119f3
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Jun 6 13:37:31 2024 -0700
    
        Move interface and implementations to subpackage
    
    commit 94bce01
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Jun 6 13:29:03 2024 -0700
    
        Move credential manager files to core folder
    
    commit 465da80
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Jun 6 13:09:22 2024 -0700
    
        Change public modifier for credential manager factory
    
    commit c502e80
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Jun 6 11:41:08 2024 -0700
    
        Change modifier for dictionary
    
    commit 739c40c
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 18:01:13 2024 -0700
    
        Remove encryption for in-memory credential manager
    
    commit a2f9b50
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 16:41:18 2024 -0700
    
        Change parameter from string to enum
    
    commit 9622f5c
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 16:06:41 2024 -0700
    
        Check if json file already exists
    
    commit cdc9f80
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 14:28:49 2024 -0700
    
        Use HomeDirectoryProvider to retrieve the default location
    
    commit 6f31fe6
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 12:40:31 2024 -0700
    
        Rename native class and remove impl with external libs
    
    commit ecdcf37
    Merge: aa00982 780d213
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 12:23:54 2024 -0700
    
        Merge branch 'SNOW-715524-SSO-Token-Cache' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-715524-SSO-Token-Cache
    
    commit aa00982
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 12:19:41 2024 -0700
    
        Add class name to default log message
    
    commit 575c0a4
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 11:52:47 2024 -0700
    
        Add class name to the log
    
    commit 780d213
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 11:52:47 2024 -0700
    
        Add class name to the log
    
    commit 7f0f801
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 11:47:12 2024 -0700
    
        Add class name to the log
    
    commit cb1c84f
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 11:32:31 2024 -0700
    
        Remove MfaToken from TokenType enum
    
    commit 61b2317
    Merge: feab579 2119080
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed Jun 5 11:31:45 2024 -0700
    
        Merge branch 'master' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-715524-SSO-Token-Cache
    
    commit feab579
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri May 17 10:37:12 2024 -0700
    
        Add impl for ReleaseHandle
    
    commit 976bac2
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri May 17 09:50:34 2024 -0700
    
        Add native implementation of credential cache
    
    commit 623ce6a
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed May 8 12:12:47 2024 -0700
    
        Add Meziantou package for credential manager implementation
    
    commit b334fb3
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu May 2 11:45:26 2024 -0700
    
        Add file path to logs
    
    commit 13ba839
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed May 1 13:06:01 2024 -0700
    
        Change log from error to info
    
    commit b4ab4ed
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Wed May 1 13:05:52 2024 -0700
    
        Add more logging
    
    commit 39b90b2
    Merge: c597c64 0c19e2d
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Mon Apr 29 10:33:33 2024 -0700
    
        Merge branch 'master' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-715524-SSO-Token-Cache
    
    commit c597c64
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri Apr 19 15:45:33 2024 -0700
    
        Refactor test and rename file
    
    commit 3788474
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri Apr 19 13:53:19 2024 -0700
    
        Fix test
    
    commit 4e6869d
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri Apr 19 12:46:30 2024 -0700
    
        Add session test
    
    commit 6606823
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri Apr 19 12:45:26 2024 -0700
    
        Refactor code and remove unnecessary check
    
    commit e0b65d0
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri Apr 19 10:12:32 2024 -0700
    
        Revert removed lines
    
    commit a460e4b
    Merge: 8ce9d10 14cf8a5
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Fri Apr 19 10:05:36 2024 -0700
    
        Merge branch 'master' of https://github.com/snowflakedb/snowflake-connector-net into SNOW-715524-SSO-Token-Cache
    
    commit 8ce9d10
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 20:45:05 2024 -0700
    
        Refactor file name and fix test
    
    commit 383fe5e
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 20:07:29 2024 -0700
    
        Refactor test and file impl
    
    commit 625e04b
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 16:23:26 2024 -0700
    
        Refactor test
    
    commit a317158
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 14:09:26 2024 -0700
    
        Refactor constructor and tests
    
    commit 7f28fa8
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 10:41:15 2024 -0700
    
        Fix unit test
    
    commit 632a6b0
    Merge: 15a58be 47235fb
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 10:02:00 2024 -0700
    
        Merge branch 'master' into SNOW-715524-SSO-Token-Cache
    
    commit 15a58be
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 09:59:35 2024 -0700
    
        Remove unused namespace
    
    commit 4457077
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 09:58:30 2024 -0700
    
        Add tests
    
    commit 7de3ea6
    Author: sfc-gh-ext-simba-lf <[email protected]>
    Date:   Thu Apr 18 09:54:44 2024 -0700
    
        SNOW-715524: Add SSO token cache
    sfc-gh-jmartinezramirez committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    c9ef6fd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ebc7375 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8220ffe View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bf675aa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e27cbc1 View commit details
    Browse the repository at this point in the history
  6. Added mechanism to handle connection pooling when using username_pass…

    …word_mfa authenticator.
    
    Added mechanism to disable or throw an error if using a different authenticator using passcode in connection.
    sfc-gh-jmartinezramirez committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    175e5b7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    64fa814 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    66a602f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    30ad120 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1563834 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    071bf1f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    10391e1 View commit details
    Browse the repository at this point in the history
  13. Fix testing

    sfc-gh-jmartinezramirez committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    6f3705d View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    b0d9fbf View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    c8d37ed View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    1dc2509 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    0be66d1 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    a62a30b View commit details
    Browse the repository at this point in the history
  19. Change validation process for session pool, if using passcode in conn…

    …ection string without username_password_authentication an exception will be thrown to indicate the user
    
    that the passcode should not be used if pooling is enabled or with a minimum pool size greater than 0.
    Additionally, if the passcode is provided by an argument and not part of the connection string, it will not be used for the session created by the session pool, and the push MFA mechanism will be triggered.
    sfc-gh-jmartinezramirez committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    ff8cdce View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    c4f049b View commit details
    Browse the repository at this point in the history
  21. some refactor

    (cherry picked from commit ac28924)
    sfc-gh-knozderko authored and sfc-gh-jmartinezramirez committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    cfb8a10 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    fb1c104 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    7224e65 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    9c8e841 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    711a7c0 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    45f0fa6 View commit details
    Browse the repository at this point in the history
  27. Added additional errors that could be thrown when the cached MFA toke…

    …n is expired or invalid. Multi-factor authentication (MFA) will try to use the passcode from the connection string if available; otherwise, send a Duo push notification to try to authenticate again; if it fails, the token will be removed.
    sfc-gh-jmartinezramirez committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    de17995 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    a806406 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    d84508b View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    d755d02 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    25215c3 View commit details
    Browse the repository at this point in the history