summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/authz_manager_external_state_d.h
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2013-11-07 11:56:08 -0500
committerAndy Schwerin <schwerin@10gen.com>2013-11-08 14:22:14 -0500
commit33f16ec7ed5faf0f5bcf8e6677447a8024f0e7f7 (patch)
treedc8c1636bfa0650a2f0a1f6cb2a333cd858cad90 /src/mongo/db/auth/authz_manager_external_state_d.h
parentd0fa8b74df7c4a5d1ac897110610d6582f17556b (diff)
downloadmongo-33f16ec7ed5faf0f5bcf8e6677447a8024f0e7f7.tar.gz
SERVER-9516 Factor out common code from mock & mongod implementations of AuthzManagerExternalState.
Diffstat (limited to 'src/mongo/db/auth/authz_manager_external_state_d.h')
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_d.h45
1 files changed, 3 insertions, 42 deletions
diff --git a/src/mongo/db/auth/authz_manager_external_state_d.h b/src/mongo/db/auth/authz_manager_external_state_d.h
index 22e99d5573a..193126d2247 100644
--- a/src/mongo/db/auth/authz_manager_external_state_d.h
+++ b/src/mongo/db/auth/authz_manager_external_state_d.h
@@ -34,7 +34,7 @@
#include "mongo/base/disallow_copying.h"
#include "mongo/base/status.h"
-#include "mongo/db/auth/authz_manager_external_state.h"
+#include "mongo/db/auth/authz_manager_external_state_local.h"
#include "mongo/db/auth/role_graph.h"
#include "mongo/db/auth/user_name.h"
@@ -43,19 +43,13 @@ namespace mongo {
/**
* The implementation of AuthzManagerExternalState functionality for mongod.
*/
- class AuthzManagerExternalStateMongod : public AuthzManagerExternalState {
+ class AuthzManagerExternalStateMongod : public AuthzManagerExternalStateLocal {
MONGO_DISALLOW_COPYING(AuthzManagerExternalStateMongod);
public:
AuthzManagerExternalStateMongod();
virtual ~AuthzManagerExternalStateMongod();
- virtual Status initialize();
-
- virtual Status getStoredAuthorizationVersion(int* outVersion);
- virtual Status getUserDescription(const UserName& userName, BSONObj* result);
- virtual Status getRoleDescription(const RoleName& roleName, BSONObj* result);
-
virtual Status getAllDatabaseNames(std::vector<std::string>* dbnames);
virtual Status findOne(const NamespaceString& collectionName,
@@ -88,41 +82,8 @@ namespace mongo {
virtual bool tryAcquireAuthzUpdateLock(const StringData& why);
virtual void releaseAuthzUpdateLock();
- virtual void logOp(
- const char* op,
- const char* ns,
- const BSONObj& o,
- BSONObj* o2,
- bool* b);
-
private:
- enum RoleGraphState {
- roleGraphStateInitial = 0,
- roleGraphStateConsistent,
- roleGraphStateHasCycle
- };
-
- /**
- * Initializes the role graph from the contents of the admin.system.roles collection.
- */
- Status _initializeRoleGraph();
-
- /**
- * Eventually consistent, in-memory representation of all roles in the system (both
- * user-defined and built-in). Synchronized via _roleGraphMutex.
- */
- RoleGraph _roleGraph;
-
- /**
- * State of _roleGraph, one of "initial", "consistent" and "has cycle". Synchronized via
- * _roleGraphMutex.
- */
- RoleGraphState _roleGraphState;
-
- /**
- * Guards _roleGraphState and _roleGraph.
- */
- boost::mutex _roleGraphMutex;
+ virtual Status _getUserDocument(const UserName& userName, BSONObj* userDoc);
boost::timed_mutex _authzDataUpdateLock;
};