80
80
},
81
81
{
82
82
"description" : " should accept generic mechanism property (GSSAPI)" ,
83
- "uri" : " mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true " ,
83
+ "uri" : " mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:forward,SERVICE_HOST:example.com " ,
84
84
"valid" : true ,
85
85
"credential" : {
86
86
89
89
"mechanism" : " GSSAPI" ,
90
90
"mechanism_properties" : {
91
91
"SERVICE_NAME" : " other" ,
92
- "CANONICALIZE_HOST_NAME" : true
92
+ "SERVICE_HOST" : " example.com" ,
93
+ "CANONICALIZE_HOST_NAME" : " forward"
93
94
}
94
95
}
95
96
},
97
+ {
98
+ "description" : " should accept forwardAndReverse hostname canonicalization (GSSAPI)" ,
99
+ "uri" : " mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:forwardAndReverse" ,
100
+ "valid" : true ,
101
+ "credential" : {
102
+
103
+ "password" : null ,
104
+ "source" : " $external" ,
105
+ "mechanism" : " GSSAPI" ,
106
+ "mechanism_properties" : {
107
+ "SERVICE_NAME" : " other" ,
108
+ "CANONICALIZE_HOST_NAME" : " forwardAndReverse"
109
+ }
110
+ }
111
+ },
112
+ {
113
+ "description" : " should accept no hostname canonicalization (GSSAPI)" ,
114
+ "uri" : " mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:none" ,
115
+ "valid" : true ,
116
+ "credential" : {
117
+
118
+ "password" : null ,
119
+ "source" : " $external" ,
120
+ "mechanism" : " GSSAPI" ,
121
+ "mechanism_properties" : {
122
+ "SERVICE_NAME" : " other" ,
123
+ "CANONICALIZE_HOST_NAME" : " none"
124
+ }
125
+ }
126
+ },
127
+ {
128
+ "description" : " must raise an error when the hostname canonicalization is invalid" ,
129
+ "uri" : " mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:invalid" ,
130
+ "valid" : false
131
+ },
96
132
{
97
133
"description" : " should accept the password (GSSAPI)" ,
98
134
"uri" : " mongodb://user%40DOMAIN.COM:password@localhost/?authMechanism=GSSAPI&authSource=$external" ,
433
469
}
434
470
},
435
471
{
436
- "description" : " should throw an exception if username and password is specified for test environment (MONGODB-OIDC)" ,
472
+ "description" : " should throw an exception if supplied a password (MONGODB-OIDC)" ,
437
473
"uri" : " mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test" ,
438
474
"valid" : false ,
439
475
"credential" : null
440
476
},
441
477
{
442
- "description" : " should throw an exception if username is specified for test environment (MONGODB-OIDC)" ,
443
- "uri" : " mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&ENVIRONMENT:test" ,
478
+ "description" : " should throw an exception if username is specified for test (MONGODB-OIDC)" ,
479
+ "uri" : " mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties= ENVIRONMENT:test" ,
444
480
"valid" : false ,
445
481
"credential" : null
446
482
},
451
487
"credential" : null
452
488
},
453
489
{
454
- "description" : " should throw an exception if neither provider nor callbacks specified (MONGODB-OIDC)" ,
490
+ "description" : " should throw an exception if neither environment nor callbacks specified (MONGODB-OIDC)" ,
455
491
"uri" : " mongodb://localhost/?authMechanism=MONGODB-OIDC" ,
456
492
"valid" : false ,
457
493
"credential" : null
458
494
},
495
+ {
496
+ "description" : " should throw an exception when unsupported auth property is specified (MONGODB-OIDC)" ,
497
+ "uri" : " mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=UnsupportedProperty:unexisted" ,
498
+ "valid" : false ,
499
+ "credential" : null
500
+ },
459
501
{
460
502
"description" : " should recognise the mechanism with azure provider (MONGODB-OIDC)" ,
461
503
"uri" : " mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:foo" ,
586
628
"credential" : null
587
629
}
588
630
]
589
- }
631
+ }
0 commit comments