8080 },
8181 {
8282 "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 " ,
8484 "valid" : true ,
8585 "credential" : {
86868989 "mechanism" : " GSSAPI" ,
9090 "mechanism_properties" : {
9191 "SERVICE_NAME" : " other" ,
92- "CANONICALIZE_HOST_NAME" : true
92+ "SERVICE_HOST" : " example.com" ,
93+ "CANONICALIZE_HOST_NAME" : " forward"
9394 }
9495 }
9596 },
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+ },
96132 {
97133 "description" : " should accept the password (GSSAPI)" ,
98134 "uri" : " mongodb://user%40DOMAIN.COM:password@localhost/?authMechanism=GSSAPI&authSource=$external" ,
433469 }
434470 },
435471 {
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)" ,
437473 "uri" : " mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test" ,
438474 "valid" : false ,
439475 "credential" : null
440476 },
441477 {
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" ,
444480 "valid" : false ,
445481 "credential" : null
446482 },
451487 "credential" : null
452488 },
453489 {
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)" ,
455491 "uri" : " mongodb://localhost/?authMechanism=MONGODB-OIDC" ,
456492 "valid" : false ,
457493 "credential" : null
458494 },
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+ },
459501 {
460502 "description" : " should recognise the mechanism with azure provider (MONGODB-OIDC)" ,
461503 "uri" : " mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:foo" ,
586628 "credential" : null
587629 }
588630 ]
589- }
631+ }
0 commit comments