diff options
-rw-r--r-- | src/mongo/db/auth/authorization_session_impl.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/logical_session_id_test.cpp | 15 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/mongo/db/auth/authorization_session_impl.cpp b/src/mongo/db/auth/authorization_session_impl.cpp index a87ada01587..5d8d815c1a4 100644 --- a/src/mongo/db/auth/authorization_session_impl.cpp +++ b/src/mongo/db/auth/authorization_session_impl.cpp @@ -163,7 +163,8 @@ User* AuthorizationSessionImpl::getSingleUser() { if (userNameItr.more()) { userName = userNameItr.next(); if (userNameItr.more()) { - uasserted(ErrorCodes::Unauthorized, + uasserted( + ErrorCodes::Unauthorized, "logical sessions can't have multiple authenticated users (for more details see: " "https://docs.mongodb.com/manual/core/authentication/#authentication-methods)"); } diff --git a/src/mongo/db/logical_session_id_test.cpp b/src/mongo/db/logical_session_id_test.cpp index 883ac77c502..e9043f2da01 100644 --- a/src/mongo/db/logical_session_id_test.cpp +++ b/src/mongo/db/logical_session_id_test.cpp @@ -230,13 +230,14 @@ TEST_F(LogicalSessionIdTest, GenWithMultipleAuthedUsers) { addSimpleUser(UserName("simple", "test")); addSimpleUser(UserName("simple", "test2")); - ASSERT_THROWS_WITH_CHECK( - makeLogicalSessionId(_opCtx.get()), - AssertionException, - [](const AssertionException& exception) { - ASSERT_EQ(exception.code(), ErrorCodes::Unauthorized); - ASSERT_STRING_CONTAINS(exception.reason(), "docs.mongodb.com/manual/core/authentication"); - }); + ASSERT_THROWS_WITH_CHECK(makeLogicalSessionId(_opCtx.get()), + AssertionException, + [](const AssertionException& exception) { + ASSERT_EQ(exception.code(), ErrorCodes::Unauthorized); + ASSERT_STRING_CONTAINS( + exception.reason(), + "docs.mongodb.com/manual/core/authentication"); + }); } TEST_F(LogicalSessionIdTest, GenWithoutAuthedUser) { |