diff options
author | Jonathan Reams <jonathan.reams@mongodb.com> | 2019-09-10 14:47:16 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-10 14:47:16 +0000 |
commit | bb07fbf41d8c9b26cd730cdd9db24c42e90b0ddc (patch) | |
tree | 9b0c8e3500faed56a0802641397857798c10f362 /src/mongo/db/auth/sasl_mechanism_registry_test.cpp | |
parent | 9672002569e4510a5087c4bc873c3db6e4ccf917 (diff) | |
download | mongo-bb07fbf41d8c9b26cd730cdd9db24c42e90b0ddc.tar.gz |
SERVER-41246 Thread ServiceContext through SaslMechanismFactory
Diffstat (limited to 'src/mongo/db/auth/sasl_mechanism_registry_test.cpp')
-rw-r--r-- | src/mongo/db/auth/sasl_mechanism_registry_test.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
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 <typename Policy, bool argIsInternal> class BaseMockMechanismFactory : public MakeServerFactory<Policy> { public: + using MakeServerFactory<Policy>::MakeServerFactory; static constexpr bool isInternal = argIsInternal; bool canMakeMechanismForUser(const User* user) const final { return true; @@ -111,7 +112,10 @@ public: }; template <bool argIsInternal> -class FooMechanismFactory : public BaseMockMechanismFactory<FooMechanism, argIsInternal> {}; +class FooMechanismFactory : public BaseMockMechanismFactory<FooMechanism, argIsInternal> { +public: + using BaseMockMechanismFactory<FooMechanism, argIsInternal>::BaseMockMechanismFactory; +}; // Policy for a hypothetical "BAR" SASL mechanism. struct BarPolicy { @@ -138,7 +142,10 @@ public: }; template <bool argIsInternal> -class BarMechanismFactory : public BaseMockMechanismFactory<BarMechanism, argIsInternal> {}; +class BarMechanismFactory : public BaseMockMechanismFactory<BarMechanism, argIsInternal> { +public: + using BaseMockMechanismFactory<BarMechanism, argIsInternal>::BaseMockMechanismFactory; +}; // Policy for a hypothetical "InternalAuth" SASL mechanism. struct InternalAuthPolicy { @@ -165,6 +172,8 @@ public: }; class InternalAuthMechanismFactory : public BaseMockMechanismFactory<InternalAuthMechanism, true> { +public: + using BaseMockMechanismFactory<InternalAuthMechanism, true>::BaseMockMechanismFactory; }; class MechanismRegistryTest : public ServiceContextTest { @@ -176,7 +185,7 @@ public: std::unique_ptr<AuthzManagerExternalStateMock>(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<AuthorizationManager>(authManager)); |