-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-955538: Multiple SAML Integrations Support (#1025)
sdk issue #726
- Loading branch information
1 parent
f1dfe51
commit 5c89d42
Showing
8 changed files
with
171 additions
and
13 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -714,6 +714,40 @@ func TestParseDSN(t *testing.T) { | |
dsn: "u:[email protected]:443?authenticator=http%3A%2F%2Fsc.okta.com&ocspFailOpen=true&validateDefaultParameters=true", | ||
err: errFailedToParseAuthenticator(), | ||
}, | ||
{ | ||
dsn: "u:[email protected]:9876?account=a&protocol=http&authenticator=EXTERNALBROWSER&disableConsoleLogin=true", | ||
config: &Config{ | ||
Account: "a", User: "u", Password: "p", | ||
Authenticator: AuthTypeExternalBrowser, | ||
Protocol: "http", Host: "a.snowflake.local", Port: 9876, | ||
OCSPFailOpen: OCSPFailOpenTrue, | ||
ValidateDefaultParameters: ConfigBoolTrue, | ||
ClientTimeout: defaultClientTimeout, | ||
JWTClientTimeout: defaultJWTClientTimeout, | ||
ExternalBrowserTimeout: defaultExternalBrowserTimeout, | ||
IncludeRetryReason: ConfigBoolTrue, | ||
DisableConsoleLogin: ConfigBoolTrue, | ||
}, | ||
ocspMode: ocspModeFailOpen, | ||
err: nil, | ||
}, | ||
{ | ||
dsn: "u:[email protected]:9876?account=a&protocol=http&authenticator=EXTERNALBROWSER&disableConsoleLogin=false", | ||
config: &Config{ | ||
Account: "a", User: "u", Password: "p", | ||
Authenticator: AuthTypeExternalBrowser, | ||
Protocol: "http", Host: "a.snowflake.local", Port: 9876, | ||
OCSPFailOpen: OCSPFailOpenTrue, | ||
ValidateDefaultParameters: ConfigBoolTrue, | ||
ClientTimeout: defaultClientTimeout, | ||
JWTClientTimeout: defaultJWTClientTimeout, | ||
ExternalBrowserTimeout: defaultExternalBrowserTimeout, | ||
IncludeRetryReason: ConfigBoolTrue, | ||
DisableConsoleLogin: ConfigBoolFalse, | ||
}, | ||
ocspMode: ocspModeFailOpen, | ||
err: nil, | ||
}, | ||
} | ||
|
||
for _, at := range []AuthType{AuthTypeExternalBrowser, AuthTypeOAuth} { | ||
|
@@ -873,6 +907,9 @@ func TestParseDSN(t *testing.T) { | |
if test.config.IncludeRetryReason != cfg.IncludeRetryReason { | ||
t.Fatalf("%v: Failed to match IncludeRetryReason. expected: %v, got: %v", i, test.config.IncludeRetryReason, cfg.IncludeRetryReason) | ||
} | ||
if test.config.DisableConsoleLogin != cfg.DisableConsoleLogin { | ||
t.Fatalf("%v: Failed to match DisableConsoleLogin. expected: %v, got: %v", i, test.config.DisableConsoleLogin, cfg.DisableConsoleLogin) | ||
} | ||
assertEqualF(t, cfg.ClientConfigFile, test.config.ClientConfigFile, "client config file") | ||
case test.err != nil: | ||
driverErrE, okE := test.err.(*SnowflakeError) | ||
|
@@ -1322,6 +1359,26 @@ func TestDSN(t *testing.T) { | |
}, | ||
dsn: "u:[email protected]:443?clientConfigFile=c%3A%5CUsers%5Cuser%5Cconfig.json&ocspFailOpen=true®ion=b.c&validateDefaultParameters=true", | ||
}, | ||
{ | ||
cfg: &Config{ | ||
User: "u", | ||
Password: "p", | ||
Account: "a.b.c", | ||
Authenticator: AuthTypeExternalBrowser, | ||
DisableConsoleLogin: ConfigBoolTrue, | ||
}, | ||
dsn: "u:[email protected]:443?authenticator=externalbrowser&disableConsoleLogin=true&ocspFailOpen=true®ion=b.c&validateDefaultParameters=true", | ||
}, | ||
{ | ||
cfg: &Config{ | ||
User: "u", | ||
Password: "p", | ||
Account: "a.b.c", | ||
Authenticator: AuthTypeExternalBrowser, | ||
DisableConsoleLogin: ConfigBoolFalse, | ||
}, | ||
dsn: "u:[email protected]:443?authenticator=externalbrowser&disableConsoleLogin=false&ocspFailOpen=true®ion=b.c&validateDefaultParameters=true", | ||
}, | ||
} | ||
for _, test := range testcases { | ||
t.Run(test.dsn, func(t *testing.T) { | ||
|
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