Skip to content

Commit

Permalink
test(DRIVERS-1803): add true/false canonicalization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Feb 4, 2022
1 parent 213701a commit 6172ff7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
30 changes: 30 additions & 0 deletions source/auth/tests/connection-string.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@
}
}
},
{
"description": "should accept true as hostname canonicalization (GSSAPI)",
"uri": "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true",
"valid": true,
"credential": {
"username": "user@DOMAIN.COM",
"password": null,
"source": "$external",
"mechanism": "GSSAPI",
"mechanism_properties": {
"SERVICE_NAME": "other",
"CANONICALIZE_HOST_NAME": true
}
}
},
{
"description": "should accept forwardAndReverse hostname canonicalization (GSSAPI)",
"uri": "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:forwardAndReverse",
Expand Down Expand Up @@ -124,6 +139,21 @@
}
}
},
{
"description": "should accept false hostname canonicalization (GSSAPI)",
"uri": "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:false",
"valid": true,
"credential": {
"username": "user@DOMAIN.COM",
"password": null,
"source": "$external",
"mechanism": "GSSAPI",
"mechanism_properties": {
"SERVICE_NAME": "other",
"CANONICALIZE_HOST_NAME": false
}
}
},
{
"description": "must raise an error when the hostname canonicalization is invalid",
"uri": "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:invalid",
Expand Down
24 changes: 24 additions & 0 deletions source/auth/tests/connection-string.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ tests:
SERVICE_NAME: "other"
SERVICE_HOST: "example.com"
CANONICALIZE_HOST_NAME: "forward"
-
description: "should accept true as hostname canonicalization (GSSAPI)"
uri: "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true"
valid: true
credential:
username: "user@DOMAIN.COM"
password: ~
source: "$external"
mechanism: "GSSAPI"
mechanism_properties:
SERVICE_NAME: "other"
CANONICALIZE_HOST_NAME: true
-
description: "should accept forwardAndReverse hostname canonicalization (GSSAPI)"
uri: "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:forwardAndReverse"
Expand All @@ -99,6 +111,18 @@ tests:
mechanism_properties:
SERVICE_NAME: "other"
CANONICALIZE_HOST_NAME: "none"
-
description: "should accept false hostname canonicalization (GSSAPI)"
uri: "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:false"
valid: true
credential:
username: "user@DOMAIN.COM"
password: ~
source: "$external"
mechanism: "GSSAPI"
mechanism_properties:
SERVICE_NAME: "other"
CANONICALIZE_HOST_NAME: false
-
description: "must raise an error when the hostname canonicalization is invalid"
uri: "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:invalid"
Expand Down

0 comments on commit 6172ff7

Please sign in to comment.