From cda9c06da4e85cff481e71df7dd6a2997e117e75 Mon Sep 17 00:00:00 2001 From: Paul Trudel Date: Thu, 26 Jan 2023 19:25:36 +0000 Subject: [PATCH 1/2] Added some additional logs for user authentiction and purging --- .../core/apps/users/ValidateAuthTokenReqMsgHdlr.scala | 4 +++- .../scala/org/bigbluebutton/core/models/RegisteredUsers.scala | 4 ++++ .../src/main/java/org/bigbluebutton/api/MeetingService.java | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ValidateAuthTokenReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ValidateAuthTokenReqMsgHdlr.scala index f9ae376609..28d079744d 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ValidateAuthTokenReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ValidateAuthTokenReqMsgHdlr.scala @@ -3,9 +3,10 @@ package org.bigbluebutton.core.apps.users import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.bus.InternalEventBus import org.bigbluebutton.core.domain.MeetingState2x +import org.bigbluebutton.core.models.RegisteredUsers.numUniqueJoinedUsers import org.bigbluebutton.core.models._ import org.bigbluebutton.core.running.{ HandlerHelpers, LiveMeeting, OutMsgRouter } -import org.bigbluebutton.core2.message.senders.{ MsgBuilder } +import org.bigbluebutton.core2.message.senders.MsgBuilder trait ValidateAuthTokenReqMsgHdlr extends HandlerHelpers { this: UsersApp => @@ -20,6 +21,7 @@ trait ValidateAuthTokenReqMsgHdlr extends HandlerHelpers { var failReason = "Invalid auth token." var failReasonCode = EjectReasonCode.VALIDATE_TOKEN + log.info("Number of registered users [{}]", RegisteredUsers.numRegisteredUsers(liveMeeting.registeredUsers)) val regUser = RegisteredUsers.getRegisteredUserWithToken(msg.body.authToken, msg.body.userId, liveMeeting.registeredUsers) regUser match { diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala index c92bd627e9..5169ba5068 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/RegisteredUsers.scala @@ -72,6 +72,10 @@ object RegisteredUsers { regUsers.toVector.filter(_.joined).map(_.externId).distinct.length } + def numRegisteredUsers(regUsers: RegisteredUsers): Int = { + regUsers.toVector.size + } + def add(users: RegisteredUsers, user: RegisteredUser): Vector[RegisteredUser] = { findWithExternUserId(user.externId, users) match { diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java index 58c928c2eb..e83f9f8091 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java @@ -263,7 +263,9 @@ public class MeetingService implements MessageListener { RegisteredUser ru = registeredUser.getValue(); long elapsedTime = now - ru.getGuestWaitedOn(); + log.info("Determining if user [{}] should be purged. Elapsed time waiting [{}] with guest status [{}]", registeredUserID, elapsedTime, ru.getGuestStatus()); if (elapsedTime >= waitingGuestUsersTimeout && ru.getGuestStatus() == GuestPolicy.WAIT) { + log.info("Purging user [{}]", registeredUserID); if (meeting.userUnregistered(registeredUserID) != null) { gw.guestWaitingLeft(meeting.getInternalId(), registeredUserID); meeting.setLeftGuestLobby(registeredUserID, true); From 4fb221c6130dc6514b805c6d396781ce06cba555 Mon Sep 17 00:00:00 2001 From: Paul Trudel Date: Thu, 26 Jan 2023 19:36:34 +0000 Subject: [PATCH 2/2] Removed unused import --- .../core/apps/users/ValidateAuthTokenReqMsgHdlr.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ValidateAuthTokenReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ValidateAuthTokenReqMsgHdlr.scala index 28d079744d..cdaf704920 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ValidateAuthTokenReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ValidateAuthTokenReqMsgHdlr.scala @@ -3,7 +3,6 @@ package org.bigbluebutton.core.apps.users import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.bus.InternalEventBus import org.bigbluebutton.core.domain.MeetingState2x -import org.bigbluebutton.core.models.RegisteredUsers.numUniqueJoinedUsers import org.bigbluebutton.core.models._ import org.bigbluebutton.core.running.{ HandlerHelpers, LiveMeeting, OutMsgRouter } import org.bigbluebutton.core2.message.senders.MsgBuilder