|
1 | | -/* |
| 1 | +/* |
2 | 2 | * Copyright (c) 2019 Snowflake Computing Inc. All rights reserved. |
3 | 3 | */ |
4 | 4 |
|
@@ -139,6 +139,21 @@ public void TestValidateSupportEscapedQuotesInsideValuesForObjectProperties(stri |
139 | 139 | Assert.AreEqual(expectedValue, properties[sessionProperty]); |
140 | 140 | } |
141 | 141 |
|
| 142 | + [Test] |
| 143 | + [TestCase("true")] |
| 144 | + [TestCase("false")] |
| 145 | + public void TestValidateDisableSamlUrlCheckProperty(string expectedDisableSamlUrlCheck) |
| 146 | + { |
| 147 | + // arrange |
| 148 | + var connectionString = $"ACCOUNT=account;USER=test;PASSWORD=test;DISABLE_SAML_URL_CHECK={expectedDisableSamlUrlCheck}"; |
| 149 | + |
| 150 | + // act |
| 151 | + var properties = SFSessionProperties.ParseConnectionString(connectionString, null); |
| 152 | + |
| 153 | + // assert |
| 154 | + Assert.AreEqual(expectedDisableSamlUrlCheck, properties[SFSessionProperty.DISABLE_SAML_URL_CHECK]); |
| 155 | + } |
| 156 | + |
142 | 157 | public static IEnumerable<TestCase> ConnectionStringTestCases() |
143 | 158 | { |
144 | 159 | string defAccount = "testaccount"; |
@@ -194,7 +209,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
194 | 209 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
195 | 210 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
196 | 211 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
197 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 212 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 213 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
198 | 214 | } |
199 | 215 | }; |
200 | 216 |
|
@@ -229,7 +245,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
229 | 245 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
230 | 246 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
231 | 247 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
232 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 248 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 249 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
233 | 250 | } |
234 | 251 | }; |
235 | 252 | var testCaseWithProxySettings = new TestCase() |
@@ -266,7 +283,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
266 | 283 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
267 | 284 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
268 | 285 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
269 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 286 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 287 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
270 | 288 | }, |
271 | 289 | ConnectionString = |
272 | 290 | $"ACCOUNT={defAccount};USER={defUser};PASSWORD={defPassword};useProxy=true;proxyHost=proxy.com;proxyPort=1234;nonProxyHosts=localhost" |
@@ -305,7 +323,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
305 | 323 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
306 | 324 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
307 | 325 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
308 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 326 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 327 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
309 | 328 | }, |
310 | 329 | ConnectionString = |
311 | 330 | $"ACCOUNT={defAccount};USER={defUser};PASSWORD={defPassword};proxyHost=proxy.com;proxyPort=1234;nonProxyHosts=localhost" |
@@ -343,7 +362,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
343 | 362 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
344 | 363 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
345 | 364 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
346 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 365 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 366 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
347 | 367 | } |
348 | 368 | }; |
349 | 369 | var testCaseWithIncludeRetryReason = new TestCase() |
@@ -378,7 +398,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
378 | 398 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
379 | 399 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
380 | 400 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
381 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 401 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 402 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
382 | 403 | } |
383 | 404 | }; |
384 | 405 | var testCaseWithDisableQueryContextCache = new TestCase() |
@@ -412,7 +433,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
412 | 433 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
413 | 434 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
414 | 435 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
415 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 436 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 437 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
416 | 438 | }, |
417 | 439 | ConnectionString = |
418 | 440 | $"ACCOUNT={defAccount};USER={defUser};PASSWORD={defPassword};DISABLEQUERYCONTEXTCACHE=true" |
@@ -448,7 +470,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
448 | 470 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
449 | 471 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
450 | 472 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
451 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 473 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 474 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
452 | 475 | }, |
453 | 476 | ConnectionString = |
454 | 477 | $"ACCOUNT={defAccount};USER={defUser};PASSWORD={defPassword};DISABLE_CONSOLE_LOGIN=false" |
@@ -486,7 +509,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
486 | 509 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
487 | 510 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
488 | 511 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
489 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 512 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 513 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
490 | 514 | } |
491 | 515 | }; |
492 | 516 | var testCaseUnderscoredAccountName = new TestCase() |
@@ -521,7 +545,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
521 | 545 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
522 | 546 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
523 | 547 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
524 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 548 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 549 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
525 | 550 | } |
526 | 551 | }; |
527 | 552 | var testCaseUnderscoredAccountNameWithEnabledAllowUnderscores = new TestCase() |
@@ -556,7 +581,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
556 | 581 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
557 | 582 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
558 | 583 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
559 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 584 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 585 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
560 | 586 | } |
561 | 587 | }; |
562 | 588 | var testQueryTag = "Test QUERY_TAG 12345"; |
@@ -593,7 +619,8 @@ public static IEnumerable<TestCase> ConnectionStringTestCases() |
593 | 619 | { SFSessionProperty.CHANGEDSESSION, DefaultValue(SFSessionProperty.CHANGEDSESSION) }, |
594 | 620 | { SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT, DefaultValue(SFSessionProperty.WAITINGFORIDLESESSIONTIMEOUT) }, |
595 | 621 | { SFSessionProperty.EXPIRATIONTIMEOUT, DefaultValue(SFSessionProperty.EXPIRATIONTIMEOUT) }, |
596 | | - { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) } |
| 622 | + { SFSessionProperty.POOLINGENABLED, DefaultValue(SFSessionProperty.POOLINGENABLED) }, |
| 623 | + { SFSessionProperty.DISABLE_SAML_URL_CHECK, DefaultValue(SFSessionProperty.DISABLE_SAML_URL_CHECK) } |
597 | 624 | } |
598 | 625 | }; |
599 | 626 |
|
|
0 commit comments