From 2073b07c5c0ad98e49fa2733cbdcfcb0013e1dcc Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Fri, 2 Aug 2024 15:51:57 -0300 Subject: [PATCH] Remove unused ValidateConnAuthTokenSysMsg --- .../core/BigBlueButtonActor.scala | 13 -------- .../ValidateConnAuthTokenSysMsgHdlr.scala | 30 ------------------- .../senders/ReceivedJsonMsgHandlerActor.scala | 2 -- .../core/running/MeetingActor.scala | 9 ++---- .../bigbluebutton/core2/AnalyticsActor.scala | 2 -- .../core2/message/senders/MsgBuilder.scala | 12 +------- .../common2/msgs/SystemMsgs.scala | 16 ---------- 7 files changed, 3 insertions(+), 81 deletions(-) delete mode 100755 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/meeting/ValidateConnAuthTokenSysMsgHdlr.scala diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala index ad30f0b787..5aca32b3b6 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/BigBlueButtonActor.scala @@ -135,7 +135,6 @@ class BigBlueButtonActor( case m: CreateMeetingReqMsg => handleCreateMeetingReqMsg(m) case m: RegisterUserReqMsg => handleRegisterUserReqMsg(m) case m: CheckAlivePingSysMsg => handleCheckAlivePingSysMsg(m) - case m: ValidateConnAuthTokenSysMsg => handleValidateConnAuthTokenSysMsg(m) case _: UserGraphqlConnectionEstablishedSysMsg => //Ignore case _: UserGraphqlConnectionClosedSysMsg => //Ignore case _: CheckGraphqlMiddlewareAlivePongSysMsg => //Ignore @@ -143,18 +142,6 @@ class BigBlueButtonActor( } } - def handleValidateConnAuthTokenSysMsg(msg: ValidateConnAuthTokenSysMsg): Unit = { - RunningMeetings.findWithId(meetings, msg.body.meetingId) match { - case Some(meeting) => - meeting.actorRef forward msg - - case None => - val event = MsgBuilder.buildValidateConnAuthTokenSysRespMsg(msg.body.meetingId, msg.body.userId, - false, msg.body.connId, msg.body.app) - outGW.send(event) - } - } - def handleRegisterUserReqMsg(msg: RegisterUserReqMsg): Unit = { log.debug("RECEIVED RegisterUserReqMsg msg {}", msg) for { diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/meeting/ValidateConnAuthTokenSysMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/meeting/ValidateConnAuthTokenSysMsgHdlr.scala deleted file mode 100755 index e440fa2a6c..0000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/meeting/ValidateConnAuthTokenSysMsgHdlr.scala +++ /dev/null @@ -1,30 +0,0 @@ -package org.bigbluebutton.core.apps.meeting - -import org.bigbluebutton.common2.msgs.ValidateConnAuthTokenSysMsg -import org.bigbluebutton.core.models.RegisteredUsers -import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } -import org.bigbluebutton.core2.message.senders.MsgBuilder - -trait ValidateConnAuthTokenSysMsgHdlr { - val liveMeeting: LiveMeeting - val outGW: OutMsgRouter - - def handleValidateConnAuthTokenSysMsg(msg: ValidateConnAuthTokenSysMsg): Unit = { - val regUser = RegisteredUsers.getRegisteredUserWithToken( - msg.body.authToken, - msg.body.userId, - liveMeeting.registeredUsers - ) - - regUser match { - case Some(u) => - val event = MsgBuilder.buildValidateConnAuthTokenSysRespMsg(msg.body.meetingId, msg.body.userId, - true, msg.body.connId, msg.body.app) - outGW.send(event) - case None => - val event = MsgBuilder.buildValidateConnAuthTokenSysRespMsg(msg.body.meetingId, msg.body.userId, - false, msg.body.connId, msg.body.app) - outGW.send(event) - } - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala index 4703b7cf07..a72c5321df 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala @@ -67,8 +67,6 @@ class ReceivedJsonMsgHandlerActor( route[DestroyMeetingSysCmdMsg](meetingManagerChannel, envelope, jsonNode) case EjectUserFromMeetingSysMsg.NAME => routeGenericMsg[EjectUserFromMeetingSysMsg](envelope, jsonNode) - case ValidateConnAuthTokenSysMsg.NAME => - route[ValidateConnAuthTokenSysMsg](meetingManagerChannel, envelope, jsonNode) // Guests case GetGuestsWaitingApprovalReqMsg.NAME => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index c9535fc6fe..a31d33900b 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -38,7 +38,6 @@ import org.bigbluebutton.ClientSettings.{ getConfigPropertyValueByPathAsBooleanO import org.bigbluebutton.common2.msgs import scala.concurrent.duration._ import org.bigbluebutton.core.apps.layout.LayoutApp2x -import org.bigbluebutton.core.apps.meeting.ValidateConnAuthTokenSysMsgHdlr import org.bigbluebutton.core.apps.plugin.PluginHdlrs import org.bigbluebutton.core.apps.users.ChangeLockSettingsInMeetingCmdMsgHdlr import org.bigbluebutton.core.db.{ MeetingDAO, NotificationDAO, TimerDAO, UserStateDAO } @@ -91,7 +90,6 @@ class MeetingActor( with DestroyMeetingSysCmdMsgHdlr with ChangeLockSettingsInMeetingCmdMsgHdlr with ClientToServerLatencyTracerMsgHdlr - with ValidateConnAuthTokenSysMsgHdlr with UserActivitySignCmdMsgHdlr { object CheckVoiceRecordingInternalMsg @@ -265,7 +263,6 @@ class MeetingActor( // Handling RegisterUserReqMsg as it is forwarded from BBBActor and // its type is not BbbCommonEnvCoreMsg case m: RegisterUserReqMsg => usersApp.handleRegisterUserReqMsg(m) - case m: ValidateConnAuthTokenSysMsg => handleValidateConnAuthTokenSysMsg(m) //API Msgs case m: GetUserApiMsg => usersApp.handleGetUserApiMsg(m, sender) @@ -764,11 +761,9 @@ class MeetingActor( timerApp2x.handle(m, liveMeeting, msgBus) updateUserLastActivity(m.header.userId) - case m: ValidateConnAuthTokenSysMsg => handleValidateConnAuthTokenSysMsg(m) + case m: UserActivitySignCmdMsg => handleUserActivitySignCmdMsg(m) - case m: UserActivitySignCmdMsg => handleUserActivitySignCmdMsg(m) - - case _ => log.warning("***** Cannot handle " + msg.envelope.name) + case _ => log.warning("***** Cannot handle " + msg.envelope.name) } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala index 820563d1d0..36fe7c2e68 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala @@ -161,8 +161,6 @@ class AnalyticsActor(val includeChat: Boolean) extends Actor with ActorLogging { // System case m: ClientToServerLatencyTracerMsg => traceMessage(msg) case m: ServerToClientLatencyTracerMsg => traceMessage(msg) - case m: ValidateConnAuthTokenSysMsg => traceMessage(msg) - case m: ValidateConnAuthTokenSysRespMsg => traceMessage(msg) // Recording case m: RecordingChapterBreakSysMsg => logMessage(msg) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala index b0e93c5c48..dcb5176c43 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala @@ -1,7 +1,7 @@ package org.bigbluebutton.core2.message.senders import org.bigbluebutton.common2.domain.DefaultProps -import org.bigbluebutton.common2.msgs.{ BbbCommonEnvCoreMsg, BbbCoreEnvelope, BbbCoreHeaderWithMeetingId, MessageTypes, NotifyAllInMeetingEvtMsg, NotifyAllInMeetingEvtMsgBody, NotifyRoleInMeetingEvtMsg, NotifyRoleInMeetingEvtMsgBody, NotifyUserInMeetingEvtMsg, NotifyUserInMeetingEvtMsgBody, Routing, ValidateConnAuthTokenSysRespMsg, ValidateConnAuthTokenSysRespMsgBody, _ } +import org.bigbluebutton.common2.msgs.{ BbbCommonEnvCoreMsg, BbbCoreEnvelope, BbbCoreHeaderWithMeetingId, MessageTypes, NotifyAllInMeetingEvtMsg, NotifyAllInMeetingEvtMsgBody, NotifyRoleInMeetingEvtMsg, NotifyRoleInMeetingEvtMsgBody, NotifyUserInMeetingEvtMsg, NotifyUserInMeetingEvtMsgBody, Routing, _ } import org.bigbluebutton.core.models.{ GuestWaiting, PresentationPod } object MsgBuilder { @@ -97,16 +97,6 @@ object MsgBuilder { BbbCommonEnvCoreMsg(envelope, event) } - def buildValidateConnAuthTokenSysRespMsg(meetingId: String, userId: String, - authzed: Boolean, connId: String, app: String): BbbCommonEnvCoreMsg = { - val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, userId) - val envelope = BbbCoreEnvelope(ValidateConnAuthTokenSysRespMsg.NAME, routing) - val header = BbbCoreHeaderWithMeetingId(ValidateConnAuthTokenSysRespMsg.NAME, meetingId) - val body = ValidateConnAuthTokenSysRespMsgBody(meetingId, userId, connId, authzed, app) - val event = ValidateConnAuthTokenSysRespMsg(header, body) - BbbCommonEnvCoreMsg(envelope, event) - } - def buildPresenterAssignedEvtMsg(meetingId: String, intId: String, name: String, assignedBy: String): BbbCommonEnvCoreMsg = { val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, intId) val envelope = BbbCoreEnvelope(PresenterAssignedEvtMsg.NAME, routing) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala index a74a3b2007..d72ada0503 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala @@ -148,22 +148,6 @@ case class RecordingChapterBreakSysMsg( ) extends BbbCoreMsg case class RecordingChapterBreakSysMsgBody(meetingId: String, timestamp: Long) -object ValidateConnAuthTokenSysMsg { val NAME = "ValidateConnAuthTokenSysMsg" } -case class ValidateConnAuthTokenSysMsg( - header: BbbCoreBaseHeader, - body: ValidateConnAuthTokenSysMsgBody -) extends BbbCoreMsg -case class ValidateConnAuthTokenSysMsgBody(meetingId: String, userId: String, authToken: String, - connId: String, app: String) - -object ValidateConnAuthTokenSysRespMsg { val NAME = "ValidateConnAuthTokenSysRespMsg" } -case class ValidateConnAuthTokenSysRespMsg( - header: BbbCoreHeaderWithMeetingId, - body: ValidateConnAuthTokenSysRespMsgBody -) extends BbbCoreMsg -case class ValidateConnAuthTokenSysRespMsgBody(meetingId: String, userId: String, - connId: String, authzed: Boolean, app: String) - object PublishedRecordingSysMsg { val NAME = "PublishedRecordingSysMsg" } case class PublishedRecordingSysMsg(header: BbbCoreBaseHeader, body: PublishedRecordingSysMsgBody) extends BbbCoreMsg case class PublishedRecordingSysMsgBody(recordId: String)