summaryrefslogtreecommitdiff
path: root/src/mongo/s/sharding_initialization.cpp
diff options
context:
space:
mode:
authorsamantharitter <samantha.ritter@10gen.com>2017-06-27 12:09:40 -0400
committerJason Carey <jcarey@argv.me>2017-07-13 17:40:53 -0400
commite1cae24805e3e7282958ee67a01555dd6ce40039 (patch)
treeebce77d9a502a193784483b2201b65e1a5010d98 /src/mongo/s/sharding_initialization.cpp
parent9a49ee3a03e02597086e577f06a71a0723bc0582 (diff)
downloadmongo-e1cae24805e3e7282958ee67a01555dd6ce40039.tar.gz
SERVER-29610 Allow LogicalSessionIds to contain signed user information
Diffstat (limited to 'src/mongo/s/sharding_initialization.cpp')
-rw-r--r--src/mongo/s/sharding_initialization.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/s/sharding_initialization.cpp b/src/mongo/s/sharding_initialization.cpp
index 3dbaf4f19ea..79287e37a5c 100644
--- a/src/mongo/s/sharding_initialization.cpp
+++ b/src/mongo/s/sharding_initialization.cpp
@@ -38,6 +38,7 @@
#include "mongo/client/remote_command_targeter_factory_impl.h"
#include "mongo/db/audit.h"
#include "mongo/db/keys_collection_manager.h"
+#include "mongo/db/keys_collection_manager_sharding.h"
#include "mongo/db/logical_clock.h"
#include "mongo/db/logical_time_validator.h"
#include "mongo/db/repl/replication_coordinator.h"
@@ -102,7 +103,8 @@ using executor::ThreadPoolTaskExecutor;
using executor::ShardingTaskExecutor;
static constexpr auto kRetryInterval = Seconds{2};
-const std::string kKeyManagerPurposeString = "SigningClusterTime";
+const std::string kKeyManagerPurposeString = "HMAC";
+const Seconds kKeyValidInterval(3 * 30 * 24 * 60 * 60); // ~3 months
auto makeTaskExecutor(std::unique_ptr<NetworkInterface> net) {
auto netPtr = net.get();
@@ -234,12 +236,13 @@ Status initializeGlobalShardingState(OperationContext* opCtx,
}
}
- auto keyManager = stdx::make_unique<KeysCollectionManager>(
+ auto keyManager = std::make_shared<KeysCollectionManagerSharding>(
kKeyManagerPurposeString, grid->catalogClient(), Seconds(KeysRotationIntervalSec));
keyManager->startMonitoring(opCtx->getServiceContext());
LogicalTimeValidator::set(opCtx->getServiceContext(),
- stdx::make_unique<LogicalTimeValidator>(std::move(keyManager)));
+ stdx::make_unique<LogicalTimeValidator>(keyManager));
+ opCtx->getServiceContext()->setKeyManager(keyManager);
auto replCoord = repl::ReplicationCoordinator::get(opCtx->getClient()->getServiceContext());
if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer &&