|
474 | 474 | }
|
475 | 475 | },
|
476 | 476 | {
|
477 |
| - "description": "should throw an exception if supplied a password (MONGODB-OIDC)", |
| 477 | + "description": "should throw an exception if username and password is specified for test environment (MONGODB-OIDC)", |
478 | 478 | "uri": "mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test",
|
479 | 479 | "valid": false,
|
480 | 480 | "credential": null
|
481 | 481 | },
|
482 | 482 | {
|
483 |
| - "description": "should throw an exception if username is specified for test (MONGODB-OIDC)", |
| 483 | + "description": "should throw an exception if username is specified for test environment (MONGODB-OIDC)", |
484 | 484 | "uri": "mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&ENVIRONMENT:test",
|
485 | 485 | "valid": false,
|
486 | 486 | "credential": null
|
|
503 | 503 | "valid": false,
|
504 | 504 | "credential": null
|
505 | 505 | },
|
| 506 | + { |
| 507 | + "description": "should throw an exception if neither provider nor callbacks specified (MONGODB-OIDC)", |
| 508 | + "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC", |
| 509 | + "valid": false, |
| 510 | + "credential": null |
| 511 | + }, |
506 | 512 | {
|
507 | 513 | "description": "should recognise the mechanism with azure provider (MONGODB-OIDC)",
|
508 | 514 | "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:foo",
|
|
533 | 539 | }
|
534 | 540 | }
|
535 | 541 | },
|
| 542 | + { |
| 543 | + "description": "should accept a url-encoded TOKEN_RESOURCE (MONGODB-OIDC)", |
| 544 | + "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:mongodb%3A%2F%2Ftest-cluster", |
| 545 | + "valid": true, |
| 546 | + "credential": { |
| 547 | + "username": "user", |
| 548 | + "password": null, |
| 549 | + "source": "$external", |
| 550 | + "mechanism": "MONGODB-OIDC", |
| 551 | + "mechanism_properties": { |
| 552 | + "ENVIRONMENT": "azure", |
| 553 | + "TOKEN_RESOURCE": "mongodb://test-cluster" |
| 554 | + } |
| 555 | + } |
| 556 | + }, |
| 557 | + { |
| 558 | + "description": "should accept an un-encoded TOKEN_RESOURCE (MONGODB-OIDC)", |
| 559 | + "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:mongodb://test-cluster", |
| 560 | + "valid": true, |
| 561 | + "credential": { |
| 562 | + "username": "user", |
| 563 | + "password": null, |
| 564 | + "source": "$external", |
| 565 | + "mechanism": "MONGODB-OIDC", |
| 566 | + "mechanism_properties": { |
| 567 | + "ENVIRONMENT": "azure", |
| 568 | + "TOKEN_RESOURCE": "mongodb://test-cluster" |
| 569 | + } |
| 570 | + } |
| 571 | + }, |
| 572 | + { |
| 573 | + "description": "should handle a complicated url-encoded TOKEN_RESOURCE (MONGODB-OIDC)", |
| 574 | + "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:abc%2Cd%25ef%3Ag%26hi", |
| 575 | + "valid": true, |
| 576 | + "credential": { |
| 577 | + "username": "user", |
| 578 | + "password": null, |
| 579 | + "source": "$external", |
| 580 | + "mechanism": "MONGODB-OIDC", |
| 581 | + "mechanism_properties": { |
| 582 | + "ENVIRONMENT": "azure", |
| 583 | + "TOKEN_RESOURCE": "abc,d%ef:g&hi" |
| 584 | + } |
| 585 | + } |
| 586 | + }, |
| 587 | + { |
| 588 | + "description": "should url-encode a TOKEN_RESOURCE (MONGODB-OIDC)", |
| 589 | + "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:a$b", |
| 590 | + "valid": true, |
| 591 | + "credential": { |
| 592 | + "username": "user", |
| 593 | + "password": null, |
| 594 | + "source": "$external", |
| 595 | + "mechanism": "MONGODB-OIDC", |
| 596 | + "mechanism_properties": { |
| 597 | + "ENVIRONMENT": "azure", |
| 598 | + "TOKEN_RESOURCE": "a$b" |
| 599 | + } |
| 600 | + } |
| 601 | + }, |
536 | 602 | {
|
537 | 603 | "description": "should accept a username and throw an error for a password with azure provider (MONGODB-OIDC)",
|
538 | 604 | "uri": "mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:foo",
|
|
0 commit comments