Skip to content

Commit 62769ea

Browse files
committed
MB-32570: Add userdata tags to name and agent name in conn stats
stats connections is part of cbcollect_info and reveals the name of the users for the connections. Change-Id: Icd1339e21778b302f4284ff96f7c463c020943d1 Reviewed-on: http://review.couchbase.org/103528 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent 29fa921 commit 62769ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

daemon/connection.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ nlohmann::json Connection::toJSON() const {
142142
ret["internal"] = isInternal();
143143

144144
if (authenticated) {
145-
ret["username"] = username.c_str();
145+
if (internal) {
146+
// We want to be able to map these connections, and given
147+
// that it is internal we don't reveal any user data
148+
ret["username"] = username;
149+
} else {
150+
ret["username"] = cb::tagUserData(username);
151+
}
146152
}
147153

148154
ret["nodelay"] = nodelay;

0 commit comments

Comments
 (0)