|
474 | 474 | } |
475 | 475 | }, |
476 | 476 | { |
477 | | - "description": "should throw an exception if username and password is specified for test environment (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 |
|
486 | 486 | "credential": null |
487 | 487 | }, |
488 | 488 | { |
489 | | - "description": "should throw an exception if specified provider is not supported (MONGODB-OIDC)", |
| 489 | + "description": "should throw an exception if specified environment is not supported (MONGODB-OIDC)", |
490 | 490 | "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:invalid", |
491 | 491 | "valid": false, |
492 | 492 | "credential": null |
493 | 493 | }, |
494 | | - { |
495 | | - "description": "should throw an exception custom callback is chosen but no callback is provided (MONGODB-OIDC)", |
496 | | - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:custom", |
497 | | - "valid": false, |
498 | | - "credential": null |
499 | | - }, |
500 | | - { |
501 | | - "description": "should throw an exception custom callback is chosen but no callback is provided (MONGODB-OIDC)", |
502 | | - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:custom", |
503 | | - "valid": false, |
504 | | - "credential": null |
505 | | - }, |
506 | 494 | { |
507 | 495 | "description": "should throw an exception if neither provider nor callbacks specified (MONGODB-OIDC)", |
508 | 496 | "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC", |
|
541 | 529 | }, |
542 | 530 | { |
543 | 531 | "description": "should accept a url-encoded TOKEN_RESOURCE (MONGODB-OIDC)", |
544 | | - "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:mongodb%253A//test-cluster", |
| 532 | + "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:mongodb%3A%2F%2Ftest-cluster", |
| 533 | + "valid": true, |
| 534 | + "credential": { |
| 535 | + "username": "user", |
| 536 | + "password": null, |
| 537 | + "source": "$external", |
| 538 | + "mechanism": "MONGODB-OIDC", |
| 539 | + "mechanism_properties": { |
| 540 | + "ENVIRONMENT": "azure", |
| 541 | + "TOKEN_RESOURCE": "mongodb://test-cluster" |
| 542 | + } |
| 543 | + } |
| 544 | + }, |
| 545 | + { |
| 546 | + "description": "should accept an un-encoded TOKEN_RESOURCE (MONGODB-OIDC)", |
| 547 | + "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:mongodb://test-cluster", |
| 548 | + "valid": true, |
| 549 | + "credential": { |
| 550 | + "username": "user", |
| 551 | + "password": null, |
| 552 | + "source": "$external", |
| 553 | + "mechanism": "MONGODB-OIDC", |
| 554 | + "mechanism_properties": { |
| 555 | + "ENVIRONMENT": "azure", |
| 556 | + "TOKEN_RESOURCE": "mongodb://test-cluster" |
| 557 | + } |
| 558 | + } |
| 559 | + }, |
| 560 | + { |
| 561 | + "description": "should handle a complicated url-encoded TOKEN_RESOURCE (MONGODB-OIDC)", |
| 562 | + "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:abc%2Cd%25ef%3Ag%26hi", |
545 | 563 | "valid": true, |
546 | 564 | "credential": { |
547 | 565 | "username": "user", |
|
550 | 568 | "mechanism": "MONGODB-OIDC", |
551 | 569 | "mechanism_properties": { |
552 | 570 | "ENVIRONMENT": "azure", |
553 | | - "TOKEN_RESOURCE": "mongodb%253A//test-cluster" |
| 571 | + "TOKEN_RESOURCE": "abc,d%ef:g&hi" |
554 | 572 | } |
555 | 573 | } |
556 | 574 | }, |
|
565 | 583 | "mechanism": "MONGODB-OIDC", |
566 | 584 | "mechanism_properties": { |
567 | 585 | "ENVIRONMENT": "azure", |
568 | | - "TOKEN_RESOURCE": "a%24b" |
| 586 | + "TOKEN_RESOURCE": "a$b" |
569 | 587 | } |
570 | 588 | } |
571 | 589 | }, |
|
0 commit comments