diff options
author | samantharitter <samantha.ritter@10gen.com> | 2017-06-27 12:09:40 -0400 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2017-07-13 17:40:53 -0400 |
commit | e1cae24805e3e7282958ee67a01555dd6ce40039 (patch) | |
tree | ebce77d9a502a193784483b2201b65e1a5010d98 /src/mongo/db/service_context.h | |
parent | 9a49ee3a03e02597086e577f06a71a0723bc0582 (diff) | |
download | mongo-e1cae24805e3e7282958ee67a01555dd6ce40039.tar.gz |
SERVER-29610 Allow LogicalSessionIds to contain signed user information
Diffstat (limited to 'src/mongo/db/service_context.h')
-rw-r--r-- | src/mongo/db/service_context.h | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h index 3cf830c3fe7..9f97445d69f 100644 --- a/src/mongo/db/service_context.h +++ b/src/mongo/db/service_context.h @@ -31,7 +31,8 @@ #include <vector> #include "mongo/base/disallow_copying.h" -#include "mongo/db/logical_session_cache.h" +#include "mongo/db/keys_collection_manager.h" +#include "mongo/db/logical_session_id.h" #include "mongo/db/storage/storage_engine.h" #include "mongo/platform/atomic_word.h" #include "mongo/platform/unordered_set.h" @@ -266,6 +267,28 @@ public: virtual StorageEngine* getGlobalStorageEngine() = 0; // + // Key manager, for HMAC keys. + // + + /** + * Sets the key manager on this service context. + */ + void setKeyManager(std::shared_ptr<KeysCollectionManager> keyManager) & { + stdx::lock_guard<stdx::mutex> lk(_mutex); + _keyManager = std::move(keyManager); + } + + /** + * Returns a pointer to the keys collection manager owned by this service context. + */ + std::shared_ptr<KeysCollectionManager> getKeyManager() & { + stdx::lock_guard<stdx::mutex> lk(_mutex); + return _keyManager; + } + + std::shared_ptr<KeysCollectionManager> getKeyManager() && = delete; + + // // Global operation management. This may not belong here and there may be too many methods // here. // @@ -329,21 +352,6 @@ public: PeriodicRunner* getPeriodicRunner() const; // - // Logical sessions. - // - - /** - * Set the logical session cache on this service context. - */ - void setLogicalSessionCache(std::unique_ptr<LogicalSessionCache> cache) &; - - /** - * Return a pointer to the logical session cache on this service context. - */ - LogicalSessionCache* getLogicalSessionCache() const&; - LogicalSessionCache* getLogicalSessionCache() && = delete; - - // // Transport. // @@ -459,14 +467,14 @@ private: void _killOperation_inlock(OperationContext* opCtx, ErrorCodes::Error killCode); /** - * The periodic runner. + * The key manager. */ - std::unique_ptr<PeriodicRunner> _runner; + std::shared_ptr<KeysCollectionManager> _keyManager; /** - * The logical session cache. + * The periodic runner. */ - std::unique_ptr<LogicalSessionCache> _sessionCache; + std::unique_ptr<PeriodicRunner> _runner; /** * The TransportLayer. |