From bb07fbf41d8c9b26cd730cdd9db24c42e90b0ddc Mon Sep 17 00:00:00 2001 From: Jonathan Reams Date: Tue, 10 Sep 2019 14:47:16 +0000 Subject: SERVER-41246 Thread ServiceContext through SaslMechanismFactory --- src/mongo/db/auth/sasl_mechanism_registry_test.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/mongo/db/auth/sasl_mechanism_registry_test.cpp') diff --git a/src/mongo/db/auth/sasl_mechanism_registry_test.cpp b/src/mongo/db/auth/sasl_mechanism_registry_test.cpp index b16df4ec3f8..2b81bb86bc7 100644 --- a/src/mongo/db/auth/sasl_mechanism_registry_test.cpp +++ b/src/mongo/db/auth/sasl_mechanism_registry_test.cpp @@ -79,6 +79,7 @@ protected: template class BaseMockMechanismFactory : public MakeServerFactory { public: + using MakeServerFactory::MakeServerFactory; static constexpr bool isInternal = argIsInternal; bool canMakeMechanismForUser(const User* user) const final { return true; @@ -111,7 +112,10 @@ public: }; template -class FooMechanismFactory : public BaseMockMechanismFactory {}; +class FooMechanismFactory : public BaseMockMechanismFactory { +public: + using BaseMockMechanismFactory::BaseMockMechanismFactory; +}; // Policy for a hypothetical "BAR" SASL mechanism. struct BarPolicy { @@ -138,7 +142,10 @@ public: }; template -class BarMechanismFactory : public BaseMockMechanismFactory {}; +class BarMechanismFactory : public BaseMockMechanismFactory { +public: + using BaseMockMechanismFactory::BaseMockMechanismFactory; +}; // Policy for a hypothetical "InternalAuth" SASL mechanism. struct InternalAuthPolicy { @@ -165,6 +172,8 @@ public: }; class InternalAuthMechanismFactory : public BaseMockMechanismFactory { +public: + using BaseMockMechanismFactory::BaseMockMechanismFactory; }; class MechanismRegistryTest : public ServiceContextTest { @@ -176,7 +185,7 @@ public: std::unique_ptr(authManagerExternalState), AuthorizationManagerImpl::InstallMockForTestingOrAuthImpl{})), // By default the registry is initialized with all mechanisms enabled. - registry({"FOO", "BAR", "InternalAuth"}) { + registry(opCtx->getServiceContext(), {"FOO", "BAR", "InternalAuth"}) { AuthorizationManager::set(getServiceContext(), std::unique_ptr(authManager)); -- cgit v1.2.1