diff options
author | Spencer T Brody <spencer@10gen.com> | 2013-10-10 16:56:10 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2013-10-10 18:55:55 -0400 |
commit | 49901a5d8ac97a41d72c4f89fd5ba2fb5a8789b8 (patch) | |
tree | 3ba4ef95d81bc8eb7dc40e90875abed1c382972f /src/mongo/db/auth/user_cache_invalidator_job.h | |
parent | 9a37b9f48505fb49604c6d9b99f448a18d524969 (diff) | |
download | mongo-49901a5d8ac97a41d72c4f89fd5ba2fb5a8789b8.tar.gz |
SERVER-9518 Invalidate user cache periodically on mongos
Diffstat (limited to 'src/mongo/db/auth/user_cache_invalidator_job.h')
-rw-r--r-- | src/mongo/db/auth/user_cache_invalidator_job.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mongo/db/auth/user_cache_invalidator_job.h b/src/mongo/db/auth/user_cache_invalidator_job.h new file mode 100644 index 00000000000..23d2367d3d6 --- /dev/null +++ b/src/mongo/db/auth/user_cache_invalidator_job.h @@ -0,0 +1,38 @@ +/* Copyright 2013 10gen Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mongo/util/background.h" + +#include <string> + +namespace mongo { + + class AuthorizationManager; + + // Background job that periodically causes the AuthorizationManager to throw out its in-memory + // cache of User objects (which contains the users' credentials, roles, privileges, etc). + class UserCacheInvalidator : public BackgroundJob { + public: + UserCacheInvalidator(AuthorizationManager* authzManager) : _authzManager(authzManager) {} + + protected: + virtual std::string name() const; + virtual void run(); + + private: + AuthorizationManager* _authzManager; + }; + +} // namespace mongo |