Added some additional logs for user authentiction and purging

This commit is contained in:
Paul Trudel 2023-01-26 19:25:36 +00:00
parent 9564436abf
commit cda9c06da4
3 changed files with 9 additions and 1 deletions

View File

@ -3,9 +3,10 @@ package org.bigbluebutton.core.apps.users
import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.bus.InternalEventBus import org.bigbluebutton.core.bus.InternalEventBus
import org.bigbluebutton.core.domain.MeetingState2x import org.bigbluebutton.core.domain.MeetingState2x
import org.bigbluebutton.core.models.RegisteredUsers.numUniqueJoinedUsers
import org.bigbluebutton.core.models._ import org.bigbluebutton.core.models._
import org.bigbluebutton.core.running.{ HandlerHelpers, LiveMeeting, OutMsgRouter } 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 { trait ValidateAuthTokenReqMsgHdlr extends HandlerHelpers {
this: UsersApp => this: UsersApp =>
@ -20,6 +21,7 @@ trait ValidateAuthTokenReqMsgHdlr extends HandlerHelpers {
var failReason = "Invalid auth token." var failReason = "Invalid auth token."
var failReasonCode = EjectReasonCode.VALIDATE_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, val regUser = RegisteredUsers.getRegisteredUserWithToken(msg.body.authToken, msg.body.userId,
liveMeeting.registeredUsers) liveMeeting.registeredUsers)
regUser match { regUser match {

View File

@ -72,6 +72,10 @@ object RegisteredUsers {
regUsers.toVector.filter(_.joined).map(_.externId).distinct.length regUsers.toVector.filter(_.joined).map(_.externId).distinct.length
} }
def numRegisteredUsers(regUsers: RegisteredUsers): Int = {
regUsers.toVector.size
}
def add(users: RegisteredUsers, user: RegisteredUser): Vector[RegisteredUser] = { def add(users: RegisteredUsers, user: RegisteredUser): Vector[RegisteredUser] = {
findWithExternUserId(user.externId, users) match { findWithExternUserId(user.externId, users) match {

View File

@ -263,7 +263,9 @@ public class MeetingService implements MessageListener {
RegisteredUser ru = registeredUser.getValue(); RegisteredUser ru = registeredUser.getValue();
long elapsedTime = now - ru.getGuestWaitedOn(); 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) { if (elapsedTime >= waitingGuestUsersTimeout && ru.getGuestStatus() == GuestPolicy.WAIT) {
log.info("Purging user [{}]", registeredUserID);
if (meeting.userUnregistered(registeredUserID) != null) { if (meeting.userUnregistered(registeredUserID) != null) {
gw.guestWaitingLeft(meeting.getInternalId(), registeredUserID); gw.guestWaitingLeft(meeting.getInternalId(), registeredUserID);
meeting.setLeftGuestLobby(registeredUserID, true); meeting.setLeftGuestLobby(registeredUserID, true);