forked from golang-migrate/migrate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SqlServer MSI Support (golang-migrate#591)
* MSI Auth for SQL Server Add MSI Auth option to SQL Server connection. Default if no password is provided in connection string. * Parse resource endpoint from server for msi update host name parsing to get just the resource endpoint for msi * Update go-mssqldb update go-mssqldb to resolve panic issue referenced here: denisenkom/go-mssqldb#642 * Update sqlserver.go switch from deprecated methods. NewServicePrincipalTokenFromManagedIdentity calls the two methods that are deprecated for us * Update sqlserver.go add useMsi param instead of looking for nil password * Update sqlserver readme Update sqlserver readme for msi auth. make useMsi a bit safer * Update sqlserver.go remove comment * Update database/sqlserver/README.md Co-authored-by: Keegan Campbell <[email protected]> * Update sqlserver.go refactor resource uri logic into its own method * Update sqlserver_test.go add tests for msi connection. can only test whether it fails with useMsi= true, or succeeds with useMsi=false * Update sqlserver.go check msi.EnsureFresh return value * Return error for multiple auth and move query filter move migrate.FilterCustomQuery(purl).String() into one line out of if/else. return error if both useMsi=true and password are passed * Update README.md update readme with warning for useMsi * Update sqlserver_test.go Update TestMsiFalse test case as now it should fail when useMsi=false and no password is provided Co-authored-by: Keegan Campbell <[email protected]>
- Loading branch information
1 parent
3dfb0ff
commit 805f8c8
Showing
6 changed files
with
153 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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