-
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-1821505 Introduce disableOCSPChecks config option
- Loading branch information
1 parent
ce3db31
commit 15f7990
Showing
9 changed files
with
136 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -540,6 +540,58 @@ func TestParseDSN(t *testing.T) { | |
ocspMode: ocspModeInsecure, | ||
err: nil, | ||
}, | ||
{ | ||
dsn: "u:p@a?database=d&schema=s&role=r&application=aa&authenticator=snowflake&disableOCSPChecks=true&passcode=pp&passcodeInPassword=true", | ||
config: &Config{ | ||
Account: "a", User: "u", Password: "p", | ||
Protocol: "https", Host: "a.snowflakecomputing.com", Port: 443, | ||
Database: "d", Schema: "s", Role: "r", Authenticator: AuthTypeSnowflake, Application: "aa", | ||
DisableOCSPChecks: true, Passcode: "pp", PasscodeInPassword: true, | ||
OCSPFailOpen: OCSPFailOpenTrue, | ||
ValidateDefaultParameters: ConfigBoolTrue, | ||
ClientTimeout: defaultClientTimeout, | ||
JWTClientTimeout: defaultJWTClientTimeout, | ||
ExternalBrowserTimeout: defaultExternalBrowserTimeout, | ||
IncludeRetryReason: ConfigBoolTrue, | ||
}, | ||
ocspMode: ocspModeInsecure, | ||
err: nil, | ||
}, | ||
{ | ||
dsn: "u:p@a?database=d&schema=s&role=r&application=aa&authenticator=snowflake&disableOCSPChecks=true&passcode=pp&passcodeInPassword=true", | ||
config: &Config{ | ||
Account: "a", User: "u", Password: "p", | ||
Protocol: "https", Host: "a.snowflakecomputing.com", Port: 443, | ||
Database: "d", Schema: "s", Role: "r", Authenticator: AuthTypeSnowflake, Application: "aa", | ||
InsecureMode: false, DisableOCSPChecks: true, Passcode: "pp", PasscodeInPassword: true, | ||
OCSPFailOpen: OCSPFailOpenTrue, | ||
ValidateDefaultParameters: ConfigBoolTrue, | ||
ClientTimeout: defaultClientTimeout, | ||
JWTClientTimeout: defaultJWTClientTimeout, | ||
ExternalBrowserTimeout: defaultExternalBrowserTimeout, | ||
IncludeRetryReason: ConfigBoolTrue, | ||
}, | ||
ocspMode: ocspModeInsecure, | ||
err: nil, | ||
}, | ||
// disableOCSPChecks should take precedence over insecureMode | ||
{ | ||
dsn: "u:p@a?database=d&schema=s&role=r&application=aa&authenticator=snowflake&disableOCSPChecks=false&insecureMode=true&passcode=pp&passcodeInPassword=true", | ||
config: &Config{ | ||
Account: "a", User: "u", Password: "p", | ||
Protocol: "https", Host: "a.snowflakecomputing.com", Port: 443, | ||
Database: "d", Schema: "s", Role: "r", Authenticator: AuthTypeSnowflake, Application: "aa", | ||
DisableOCSPChecks: false, Passcode: "pp", PasscodeInPassword: true, | ||
OCSPFailOpen: OCSPFailOpenTrue, | ||
ValidateDefaultParameters: ConfigBoolTrue, | ||
ClientTimeout: defaultClientTimeout, | ||
JWTClientTimeout: defaultJWTClientTimeout, | ||
ExternalBrowserTimeout: defaultExternalBrowserTimeout, | ||
IncludeRetryReason: ConfigBoolTrue, | ||
}, | ||
ocspMode: ocspModeFailOpen, | ||
err: nil, | ||
}, | ||
{ | ||
// schema should be ignored as no value is specified. | ||
dsn: "u:p@a?database=d&schema", | ||
|
@@ -1412,6 +1464,35 @@ func TestDSN(t *testing.T) { | |
}, | ||
dsn: "u:[email protected]:443?insecureMode=true&ocspFailOpen=true&validateDefaultParameters=true", | ||
}, | ||
{ | ||
cfg: &Config{ | ||
User: "u", | ||
Password: "p", | ||
Account: "a", | ||
DisableOCSPChecks: true, | ||
}, | ||
dsn: "u:[email protected]:443?disableOCSPChecks=true&ocspFailOpen=true&validateDefaultParameters=true", | ||
}, | ||
{ | ||
cfg: &Config{ | ||
User: "u", | ||
Password: "p", | ||
Account: "a", | ||
InsecureMode: true, | ||
DisableOCSPChecks: false, | ||
}, | ||
dsn: "u:[email protected]:443?insecureMode=true&ocspFailOpen=true&validateDefaultParameters=true", | ||
}, | ||
{ | ||
cfg: &Config{ | ||
User: "u", | ||
Password: "p", | ||
Account: "a", | ||
InsecureMode: false, | ||
DisableOCSPChecks: true, | ||
}, | ||
dsn: "u:[email protected]:443?disableOCSPChecks=true&ocspFailOpen=true&validateDefaultParameters=true", | ||
}, | ||
{ | ||
cfg: &Config{ | ||
User: "u", | ||
|
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