diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2019-01-30 18:50:32 +0000 |
---|---|---|
committer | Sara Golemon <sara.golemon@mongodb.com> | 2019-02-14 16:42:34 +0000 |
commit | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 (patch) | |
tree | 8f9d2d5b4afc2db482a29a0dc028e0b8dffc6c4f /src/mongo/db/auth/user.h | |
parent | 2dedc4f28b8807fc76ce7ad93fcb709728c18642 (diff) | |
download | mongo-e55d6e2292e5dbe2f97153251d8193d1cc89f5d7.tar.gz |
SERVER-38984 Validate unique User ID on UserCache hit
Diffstat (limited to 'src/mongo/db/auth/user.h')
-rw-r--r-- | src/mongo/db/auth/user.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/auth/user.h b/src/mongo/db/auth/user.h index 715b849fe9b..5b3edfb767f 100644 --- a/src/mongo/db/auth/user.h +++ b/src/mongo/db/auth/user.h @@ -104,6 +104,15 @@ public: explicit User(const UserName& name); + using UserId = std::vector<std::uint8_t>; + const UserId& getID() const { + return _id; + } + + void setID(UserId id) { + _id = std::move(id); + } + /** * Returns the user name for this user. */ @@ -230,6 +239,10 @@ protected: void _invalidate(); private: + // Unique ID (often UUID) for this user. + // May be empty for legacy users. + UserId _id; + UserName _name; // Digest of the full username |