@@ -540,6 +540,58 @@ func TestParseDSN(t *testing.T) {
540
540
ocspMode : ocspModeInsecure ,
541
541
err : nil ,
542
542
},
543
+ {
544
+ dsn : "u:p@a?database=d&schema=s&role=r&application=aa&authenticator=snowflake&disableOCSPChecks=true&passcode=pp&passcodeInPassword=true" ,
545
+ config : & Config {
546
+ Account : "a" , User : "u" , Password : "p" ,
547
+ Protocol : "https" , Host : "a.snowflakecomputing.com" , Port : 443 ,
548
+ Database : "d" , Schema : "s" , Role : "r" , Authenticator : AuthTypeSnowflake , Application : "aa" ,
549
+ DisableOCSPChecks : true , Passcode : "pp" , PasscodeInPassword : true ,
550
+ OCSPFailOpen : OCSPFailOpenTrue ,
551
+ ValidateDefaultParameters : ConfigBoolTrue ,
552
+ ClientTimeout : defaultClientTimeout ,
553
+ JWTClientTimeout : defaultJWTClientTimeout ,
554
+ ExternalBrowserTimeout : defaultExternalBrowserTimeout ,
555
+ IncludeRetryReason : ConfigBoolTrue ,
556
+ },
557
+ ocspMode : ocspModeInsecure ,
558
+ err : nil ,
559
+ },
560
+ {
561
+ dsn : "u:p@a?database=d&schema=s&role=r&application=aa&authenticator=snowflake&disableOCSPChecks=true&passcode=pp&passcodeInPassword=true" ,
562
+ config : & Config {
563
+ Account : "a" , User : "u" , Password : "p" ,
564
+ Protocol : "https" , Host : "a.snowflakecomputing.com" , Port : 443 ,
565
+ Database : "d" , Schema : "s" , Role : "r" , Authenticator : AuthTypeSnowflake , Application : "aa" ,
566
+ InsecureMode : false , DisableOCSPChecks : true , Passcode : "pp" , PasscodeInPassword : true ,
567
+ OCSPFailOpen : OCSPFailOpenTrue ,
568
+ ValidateDefaultParameters : ConfigBoolTrue ,
569
+ ClientTimeout : defaultClientTimeout ,
570
+ JWTClientTimeout : defaultJWTClientTimeout ,
571
+ ExternalBrowserTimeout : defaultExternalBrowserTimeout ,
572
+ IncludeRetryReason : ConfigBoolTrue ,
573
+ },
574
+ ocspMode : ocspModeInsecure ,
575
+ err : nil ,
576
+ },
577
+ // disableOCSPChecks should take precedence over insecureMode
578
+ {
579
+ dsn : "u:p@a?database=d&schema=s&role=r&application=aa&authenticator=snowflake&disableOCSPChecks=false&insecureMode=true&passcode=pp&passcodeInPassword=true" ,
580
+ config : & Config {
581
+ Account : "a" , User : "u" , Password : "p" ,
582
+ Protocol : "https" , Host : "a.snowflakecomputing.com" , Port : 443 ,
583
+ Database : "d" , Schema : "s" , Role : "r" , Authenticator : AuthTypeSnowflake , Application : "aa" ,
584
+ DisableOCSPChecks : false , Passcode : "pp" , PasscodeInPassword : true ,
585
+ OCSPFailOpen : OCSPFailOpenTrue ,
586
+ ValidateDefaultParameters : ConfigBoolTrue ,
587
+ ClientTimeout : defaultClientTimeout ,
588
+ JWTClientTimeout : defaultJWTClientTimeout ,
589
+ ExternalBrowserTimeout : defaultExternalBrowserTimeout ,
590
+ IncludeRetryReason : ConfigBoolTrue ,
591
+ },
592
+ ocspMode : ocspModeFailOpen ,
593
+ err : nil ,
594
+ },
543
595
{
544
596
// schema should be ignored as no value is specified.
545
597
dsn : "u:p@a?database=d&schema" ,
@@ -1412,6 +1464,35 @@ func TestDSN(t *testing.T) {
1412
1464
},
1413
1465
dsn :
"u:[email protected] :443?insecureMode=true&ocspFailOpen=true&validateDefaultParameters=true" ,
1414
1466
},
1467
+ {
1468
+ cfg : & Config {
1469
+ User : "u" ,
1470
+ Password : "p" ,
1471
+ Account : "a" ,
1472
+ DisableOCSPChecks : true ,
1473
+ },
1474
+ dsn :
"u:[email protected] :443?disableOCSPChecks=true&ocspFailOpen=true&validateDefaultParameters=true" ,
1475
+ },
1476
+ {
1477
+ cfg : & Config {
1478
+ User : "u" ,
1479
+ Password : "p" ,
1480
+ Account : "a" ,
1481
+ InsecureMode : true ,
1482
+ DisableOCSPChecks : false ,
1483
+ },
1484
+ dsn :
"u:[email protected] :443?insecureMode=true&ocspFailOpen=true&validateDefaultParameters=true" ,
1485
+ },
1486
+ {
1487
+ cfg : & Config {
1488
+ User : "u" ,
1489
+ Password : "p" ,
1490
+ Account : "a" ,
1491
+ InsecureMode : false ,
1492
+ DisableOCSPChecks : true ,
1493
+ },
1494
+ dsn :
"u:[email protected] :443?disableOCSPChecks=true&ocspFailOpen=true&validateDefaultParameters=true" ,
1495
+ },
1415
1496
{
1416
1497
cfg : & Config {
1417
1498
User : "u" ,
0 commit comments