Authenticated guests feature controlled at bbb-web properties

This commit is contained in:
Pedro Beschorner Marin 2019-04-09 17:52:48 -03:00
parent 8a72b8ef22
commit 0bbef12ac7
14 changed files with 71 additions and 8 deletions

View File

@ -39,6 +39,7 @@ trait AppsTestFixtures {
val maxUsers = 25 val maxUsers = 25
val guestPolicy = "ALWAYS_ASK" val guestPolicy = "ALWAYS_ASK"
val allowModsToUnmuteUsers = false val allowModsToUnmuteUsers = false
val authenticatedGuest = false
val red5DeskShareIPTestFixture = "127.0.0.1" val red5DeskShareIPTestFixture = "127.0.0.1"
val red5DeskShareAppTestFixtures = "red5App" val red5DeskShareAppTestFixtures = "red5App"
@ -58,7 +59,7 @@ trait AppsTestFixtures {
modOnlyMessage = modOnlyMessage) modOnlyMessage = modOnlyMessage)
val voiceProp = VoiceProp(telVoice = voiceConfId, voiceConf = voiceConfId, dialNumber = dialNumber, muteOnStart = muteOnStart) val voiceProp = VoiceProp(telVoice = voiceConfId, voiceConf = voiceConfId, dialNumber = dialNumber, muteOnStart = muteOnStart)
val usersProp = UsersProp(maxUsers = maxUsers, webcamsOnlyForModerator = webcamsOnlyForModerator, val usersProp = UsersProp(maxUsers = maxUsers, webcamsOnlyForModerator = webcamsOnlyForModerator,
guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers) guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers, authenticatedGuest = authenticatedGuest)
val metadataProp = new MetadataProp(metadata) val metadataProp = new MetadataProp(metadata)
val defaultProps = DefaultProps(meetingProp, breakoutProps, durationProps, password, recordProp, welcomeProp, voiceProp, val defaultProps = DefaultProps(meetingProp, breakoutProps, durationProps, password, recordProp, welcomeProp, voiceProp,

View File

@ -26,7 +26,7 @@ case class WelcomeProp(welcomeMsgTemplate: String, welcomeMsg: String, modOnlyMe
case class VoiceProp(telVoice: String, voiceConf: String, dialNumber: String, muteOnStart: Boolean) case class VoiceProp(telVoice: String, voiceConf: String, dialNumber: String, muteOnStart: Boolean)
case class UsersProp(maxUsers: Int, webcamsOnlyForModerator: Boolean, guestPolicy: String, allowModsToUnmuteUsers: Boolean) case class UsersProp(maxUsers: Int, webcamsOnlyForModerator: Boolean, guestPolicy: String, allowModsToUnmuteUsers: Boolean, authenticatedGuest: Boolean)
case class MetadataProp(metadata: collection.immutable.Map[String, String]) case class MetadataProp(metadata: collection.immutable.Map[String, String])

View File

@ -35,6 +35,7 @@ trait TestFixtures {
val allowModsToUnmuteUsers = false val allowModsToUnmuteUsers = false
val keepEvents = false val keepEvents = false
val guestPolicy = "ALWAYS_ASK" val guestPolicy = "ALWAYS_ASK"
val authenticatedGuest = false
val metadata: collection.immutable.Map[String, String] = Map("foo" -> "bar", "bar" -> "baz", "baz" -> "foo") val metadata: collection.immutable.Map[String, String] = Map("foo" -> "bar", "bar" -> "baz", "baz" -> "foo")
val meetingProp = MeetingProp(name = meetingName, extId = externalMeetingId, intId = meetingId, val meetingProp = MeetingProp(name = meetingName, extId = externalMeetingId, intId = meetingId,
@ -51,7 +52,7 @@ trait TestFixtures {
modOnlyMessage = modOnlyMessage) modOnlyMessage = modOnlyMessage)
val voiceProp = VoiceProp(telVoice = voiceConfId, voiceConf = voiceConfId, dialNumber = dialNumber, muteOnStart = muteOnStart) val voiceProp = VoiceProp(telVoice = voiceConfId, voiceConf = voiceConfId, dialNumber = dialNumber, muteOnStart = muteOnStart)
val usersProp = UsersProp(maxUsers = maxUsers, webcamsOnlyForModerator = webcamsOnlyForModerator, val usersProp = UsersProp(maxUsers = maxUsers, webcamsOnlyForModerator = webcamsOnlyForModerator,
guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers) guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers, authenticatedGuest = authenticatedGuest)
val metadataProp = new MetadataProp(metadata) val metadataProp = new MetadataProp(metadata)
val screenshareProps = ScreenshareProps(screenshareConf = "FixMe!", red5ScreenshareIp = "fixMe!", val screenshareProps = ScreenshareProps(screenshareConf = "FixMe!", red5ScreenshareIp = "fixMe!",
red5ScreenshareApp = "fixMe!") red5ScreenshareApp = "fixMe!")

View File

@ -396,7 +396,7 @@ public class MeetingService implements MessageListener {
m.getTelVoice(), m.getDuration(), m.getAutoStartRecording(), m.getAllowStartStopRecording(), m.getTelVoice(), m.getDuration(), m.getAutoStartRecording(), m.getAllowStartStopRecording(),
m.getWebcamsOnlyForModerator(), m.getModeratorPassword(), m.getViewerPassword(), m.getCreateTime(), m.getWebcamsOnlyForModerator(), m.getModeratorPassword(), m.getViewerPassword(), m.getCreateTime(),
formatPrettyDate(m.getCreateTime()), m.isBreakout(), m.getSequence(), m.isFreeJoin(), m.getMetadata(), formatPrettyDate(m.getCreateTime()), m.isBreakout(), m.getSequence(), m.isFreeJoin(), m.getMetadata(),
m.getGuestPolicy(), m.getWelcomeMessageTemplate(), m.getWelcomeMessage(), m.getModeratorOnlyMessage(), m.getGuestPolicy(), m.getAuthenticatedGuest(), m.getWelcomeMessageTemplate(), m.getWelcomeMessage(), m.getModeratorOnlyMessage(),
m.getDialNumber(), m.getMaxUsers(), m.getDialNumber(), m.getMaxUsers(),
m.getMeetingExpireIfNoUserJoinedInMinutes(), m.getmeetingExpireWhenLastUserLeftInMinutes(), m.getMeetingExpireIfNoUserJoinedInMinutes(), m.getmeetingExpireWhenLastUserLeftInMinutes(),
m.getUserInactivityInspectTimerInMinutes(), m.getUserInactivityThresholdInMinutes(), m.getUserInactivityInspectTimerInMinutes(), m.getUserInactivityThresholdInMinutes(),

View File

@ -79,6 +79,7 @@ public class ParamsProcessorUtil {
private String defaultAvatarURL; private String defaultAvatarURL;
private String defaultConfigURL; private String defaultConfigURL;
private String defaultGuestPolicy; private String defaultGuestPolicy;
private Boolean authenticatedGuest;
private int defaultMeetingDuration; private int defaultMeetingDuration;
private boolean disableRecordingDefault; private boolean disableRecordingDefault;
private boolean autoStartRecording; private boolean autoStartRecording;
@ -485,6 +486,7 @@ public class ParamsProcessorUtil {
.withWelcomeMessageTemplate(welcomeMessageTemplate) .withWelcomeMessageTemplate(welcomeMessageTemplate)
.withWelcomeMessage(welcomeMessage).isBreakout(isBreakout) .withWelcomeMessage(welcomeMessage).isBreakout(isBreakout)
.withGuestPolicy(guestPolicy) .withGuestPolicy(guestPolicy)
.withAuthenticatedGuest(authenticatedGuest)
.withBreakoutRoomsParams(breakoutParams) .withBreakoutRoomsParams(breakoutParams)
.withLockSettingsParams(lockSettingsParams) .withLockSettingsParams(lockSettingsParams)
.withAllowDuplicateExtUserid(defaultAllowDuplicateExtUserid) .withAllowDuplicateExtUserid(defaultAllowDuplicateExtUserid)
@ -956,6 +958,10 @@ public class ParamsProcessorUtil {
this.defaultGuestPolicy = guestPolicy; this.defaultGuestPolicy = guestPolicy;
} }
public void setAuthenticatedGuest(Boolean value) {
this.authenticatedGuest = value;
}
public void setClientLogoutTimerInMinutes(Integer value) { public void setClientLogoutTimerInMinutes(Integer value) {
clientLogoutTimerInMinutes = value; clientLogoutTimerInMinutes = value;
} }

View File

@ -68,6 +68,7 @@ public class Meeting {
private String defaultAvatarURL; private String defaultAvatarURL;
private String defaultConfigToken; private String defaultConfigToken;
private String guestPolicy = GuestPolicy.ASK_MODERATOR; private String guestPolicy = GuestPolicy.ASK_MODERATOR;
private Boolean authenticatedGuest = false;
private boolean userHasJoined = false; private boolean userHasJoined = false;
private Map<String, String> metadata; private Map<String, String> metadata;
private Map<String, Object> userCustomData; private Map<String, Object> userCustomData;
@ -125,6 +126,7 @@ public class Meeting {
createdTime = builder.createdTime; createdTime = builder.createdTime;
isBreakout = builder.isBreakout; isBreakout = builder.isBreakout;
guestPolicy = builder.guestPolicy; guestPolicy = builder.guestPolicy;
authenticatedGuest = builder.authenticatedGuest;
breakoutRoomsParams = builder.breakoutRoomsParams; breakoutRoomsParams = builder.breakoutRoomsParams;
lockSettingsParams = builder.lockSettingsParams; lockSettingsParams = builder.lockSettingsParams;
allowDuplicateExtUserid = builder.allowDuplicateExtUserid; allowDuplicateExtUserid = builder.allowDuplicateExtUserid;
@ -362,8 +364,36 @@ public class Meeting {
return guestPolicy; return guestPolicy;
} }
public void setAuthenticatedGuest(Boolean authGuest) {
authenticatedGuest = authGuest;
}
public Boolean getAuthenticatedGuest() {
return authenticatedGuest;
}
private String getUnauthenticatedGuestStatus(Boolean guest) {
if (guest) {
switch(guestPolicy) {
case GuestPolicy.ALWAYS_ACCEPT:
case GuestPolicy.ALWAYS_ACCEPT_AUTH:
return GuestPolicy.ALLOW;
case GuestPolicy.ASK_MODERATOR:
return GuestPolicy.WAIT;
case GuestPolicy.ALWAYS_DENY:
return GuestPolicy.DENY;
default:
return GuestPolicy.DENY;
}
} else {
return GuestPolicy.ALLOW;
}
}
public String calcGuestStatus(String role, Boolean guest, Boolean authned) { public String calcGuestStatus(String role, Boolean guest, Boolean authned) {
// Good ol' Mconf guest status
if (!authenticatedGuest) return getUnauthenticatedGuestStatus(guest);
// Allow moderators all the time. // Allow moderators all the time.
if (ROLE_MODERATOR.equals(role)) { if (ROLE_MODERATOR.equals(role)) {
return GuestPolicy.ALLOW; return GuestPolicy.ALLOW;
@ -670,6 +700,7 @@ public class Meeting {
private long createdTime; private long createdTime;
private boolean isBreakout; private boolean isBreakout;
private String guestPolicy; private String guestPolicy;
private Boolean authenticatedGuest;
private BreakoutRoomsParams breakoutRoomsParams; private BreakoutRoomsParams breakoutRoomsParams;
private LockSettingsParams lockSettingsParams; private LockSettingsParams lockSettingsParams;
private Boolean allowDuplicateExtUserid; private Boolean allowDuplicateExtUserid;
@ -791,6 +822,11 @@ public class Meeting {
guestPolicy = policy; guestPolicy = policy;
return this; return this;
} }
public Builder withAuthenticatedGuest(Boolean authGuest) {
authenticatedGuest = authGuest;
return this;
}
public Builder withBreakoutRoomsParams(BreakoutRoomsParams params) { public Builder withBreakoutRoomsParams(BreakoutRoomsParams params) {
breakoutRoomsParams = params; breakoutRoomsParams = params;

View File

@ -19,7 +19,7 @@ public interface IBbbWebApiGWApp {
Boolean allowStartStopRecording, Boolean webcamsOnlyForModerator, Boolean allowStartStopRecording, Boolean webcamsOnlyForModerator,
String moderatorPass, String viewerPass, Long createTime, String moderatorPass, String viewerPass, Long createTime,
String createDate, Boolean isBreakout, Integer sequence, Boolean freejoin, Map<String, String> metadata, String createDate, Boolean isBreakout, Integer sequence, Boolean freejoin, Map<String, String> metadata,
String guestPolicy, String welcomeMsgTemplate, String welcomeMsg, String modOnlyMessage, String guestPolicy, Boolean authenticatedGuest, String welcomeMsgTemplate, String welcomeMsg, String modOnlyMessage,
String dialNumber, Integer maxUsers, String dialNumber, Integer maxUsers,
Integer meetingExpireIfNoUserJoinedInMinutes, Integer meetingExpireIfNoUserJoinedInMinutes,
Integer meetingExpireWhenLastUserLeftInMinutes, Integer meetingExpireWhenLastUserLeftInMinutes,

View File

@ -5,6 +5,7 @@ import java.util.Map;
public class UsersProp2 { public class UsersProp2 {
public final String guestPolicy; public final String guestPolicy;
public final boolean authenticatedGuest;
public final boolean userHasJoined; public final boolean userHasJoined;
public final boolean webcamsOnlyForModerator; public final boolean webcamsOnlyForModerator;
public final int maxUsers; public final int maxUsers;
@ -15,6 +16,7 @@ public class UsersProp2 {
public UsersProp2(int maxUsers, public UsersProp2(int maxUsers,
boolean webcamsOnlyForModerator, boolean webcamsOnlyForModerator,
String guestPolicy, String guestPolicy,
boolean authenticatedGuest,
boolean userHasJoined, boolean userHasJoined,
Map<String, String> userCustomData, Map<String, String> userCustomData,
Map<String, User2> users, Map<String, User2> users,
@ -22,6 +24,7 @@ public class UsersProp2 {
this.maxUsers = maxUsers; this.maxUsers = maxUsers;
this.webcamsOnlyForModerator = webcamsOnlyForModerator; this.webcamsOnlyForModerator = webcamsOnlyForModerator;
this.guestPolicy = guestPolicy; this.guestPolicy = guestPolicy;
this.authenticatedGuest = authenticatedGuest;
this.userHasJoined = userHasJoined; this.userHasJoined = userHasJoined;
this.userCustomData = userCustomData; this.userCustomData = userCustomData;
this.users = users; this.users = users;

View File

@ -127,7 +127,7 @@ class BbbWebApiGWApp(
viewerPass: String, createTime: java.lang.Long, createDate: String, isBreakout: java.lang.Boolean, viewerPass: String, createTime: java.lang.Long, createDate: String, isBreakout: java.lang.Boolean,
sequence: java.lang.Integer, sequence: java.lang.Integer,
freeJoin: java.lang.Boolean, freeJoin: java.lang.Boolean,
metadata: java.util.Map[String, String], guestPolicy: String, metadata: java.util.Map[String, String], guestPolicy: String, authenticatedGuest: java.lang.Boolean,
welcomeMsgTemplate: String, welcomeMsg: String, modOnlyMessage: String, welcomeMsgTemplate: String, welcomeMsg: String, modOnlyMessage: String,
dialNumber: String, maxUsers: java.lang.Integer, dialNumber: String, maxUsers: java.lang.Integer,
meetingExpireIfNoUserJoinedInMinutes: java.lang.Integer, meetingExpireIfNoUserJoinedInMinutes: java.lang.Integer,
@ -172,7 +172,7 @@ class BbbWebApiGWApp(
modOnlyMessage = modOnlyMessage) modOnlyMessage = modOnlyMessage)
val voiceProp = VoiceProp(telVoice = voiceBridge, voiceConf = voiceBridge, dialNumber = dialNumber, muteOnStart = muteOnStart.booleanValue()) val voiceProp = VoiceProp(telVoice = voiceBridge, voiceConf = voiceBridge, dialNumber = dialNumber, muteOnStart = muteOnStart.booleanValue())
val usersProp = UsersProp(maxUsers = maxUsers.intValue(), webcamsOnlyForModerator = webcamsOnlyForModerator.booleanValue(), val usersProp = UsersProp(maxUsers = maxUsers.intValue(), webcamsOnlyForModerator = webcamsOnlyForModerator.booleanValue(),
guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers.booleanValue()) guestPolicy = guestPolicy, allowModsToUnmuteUsers = allowModsToUnmuteUsers.booleanValue(), authenticatedGuest = authenticatedGuest.booleanValue())
val metadataProp = MetadataProp(mapAsScalaMap(metadata).toMap) val metadataProp = MetadataProp(mapAsScalaMap(metadata).toMap)
val screenshareProps = ScreenshareProps( val screenshareProps = ScreenshareProps(
screenshareConf = voiceBridge + screenshareConfSuffix, screenshareConf = voiceBridge + screenshareConfSuffix,

View File

@ -35,6 +35,7 @@ export default function addMeeting(meeting) {
usersProp: { usersProp: {
webcamsOnlyForModerator: Boolean, webcamsOnlyForModerator: Boolean,
guestPolicy: String, guestPolicy: String,
authenticatedGuest: Boolean,
maxUsers: Number, maxUsers: Number,
allowModsToUnmuteUsers: Boolean, allowModsToUnmuteUsers: Boolean,
}, },

View File

@ -1,3 +1,4 @@
import _ from 'lodash';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Session } from 'meteor/session'; import { Session } from 'meteor/session';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
@ -148,6 +149,7 @@ const WaitingUsers = (props) => {
guestUsers, guestUsers,
guestUsersCall, guestUsersCall,
changeGuestPolicy, changeGuestPolicy,
authenticatedGuest,
} = props; } = props;
const onCheckBoxChange = (e) => { const onCheckBoxChange = (e) => {
@ -173,7 +175,7 @@ const WaitingUsers = (props) => {
/> />
); );
const buttonsData = [ const authGuestButtonsData = [
{ {
messageId: intlMessages.allowAllAuthenticated, messageId: intlMessages.allowAllAuthenticated,
action: () => guestUsersCall(authenticatedUsers, ALLOW_STATUS), action: () => guestUsersCall(authenticatedUsers, ALLOW_STATUS),
@ -189,6 +191,9 @@ const WaitingUsers = (props) => {
key: 'allow-all-guest', key: 'allow-all-guest',
policy: 'ALWAYS_ACCEPT', policy: 'ALWAYS_ACCEPT',
}, },
];
const guestButtonsData = [
{ {
messageId: intlMessages.allowEveryone, messageId: intlMessages.allowEveryone,
action: () => guestUsersCall([...guestUsers, ...authenticatedUsers], ALLOW_STATUS), action: () => guestUsersCall([...guestUsers, ...authenticatedUsers], ALLOW_STATUS),
@ -203,6 +208,8 @@ const WaitingUsers = (props) => {
}, },
]; ];
const buttonsData = authenticatedGuest ? _.concat(authGuestButtonsData , guestButtonsData) : guestButtonsData;
return ( return (
<div <div
data-test="note" data-test="note"

View File

@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
import { withTracker } from 'meteor/react-meteor-data'; import { withTracker } from 'meteor/react-meteor-data';
import Auth from '/imports/ui/services/auth'; import Auth from '/imports/ui/services/auth';
import GuestUsers from '/imports/api/guest-users/'; import GuestUsers from '/imports/api/guest-users/';
import Meetings from '/imports/api/meetings';
import Service from './service'; import Service from './service';
import WaitingComponent from './component'; import WaitingComponent from './component';
@ -30,10 +31,13 @@ export default withTracker(() => {
denied: false, denied: false,
}).fetch(); }).fetch();
const authenticatedGuest = Meetings.findOne({ meetingId: Auth.meetingID }).usersProp.authenticatedGuest;
return { return {
guestUsers, guestUsers,
authenticatedUsers, authenticatedUsers,
guestUsersCall: Service.guestUsersCall, guestUsersCall: Service.guestUsersCall,
changeGuestPolicy: Service.changeGuestPolicy, changeGuestPolicy: Service.changeGuestPolicy,
authenticatedGuest,
}; };
})(WaitingContainer); })(WaitingContainer);

View File

@ -148,6 +148,9 @@ defaultDialAccessNumber=613-555-1234
# #
defaultGuestPolicy=ALWAYS_ACCEPT defaultGuestPolicy=ALWAYS_ACCEPT
# Enables or disables authenticated guest
authenticatedGuest=false
# #
#---------------------------------------------------- #----------------------------------------------------
# Default welcome message to display when the participant joins the web # Default welcome message to display when the participant joins the web

View File

@ -139,6 +139,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="defaultAvatarURL" value="${defaultAvatarURL}"/> <property name="defaultAvatarURL" value="${defaultAvatarURL}"/>
<property name="defaultConfigURL" value="${defaultConfigURL}"/> <property name="defaultConfigURL" value="${defaultConfigURL}"/>
<property name="defaultGuestPolicy" value="${defaultGuestPolicy}"/> <property name="defaultGuestPolicy" value="${defaultGuestPolicy}"/>
<property name="authenticatedGuest" value="${authenticatedGuest}"/>
<property name="meetingExpireIfNoUserJoinedInMinutes" value="${meetingExpireIfNoUserJoinedInMinutes}"/> <property name="meetingExpireIfNoUserJoinedInMinutes" value="${meetingExpireIfNoUserJoinedInMinutes}"/>
<property name="meetingExpireWhenLastUserLeftInMinutes" value="${meetingExpireWhenLastUserLeftInMinutes}"/> <property name="meetingExpireWhenLastUserLeftInMinutes" value="${meetingExpireWhenLastUserLeftInMinutes}"/>
<property name="userInactivityInspectTimerInMinutes" value="${userInactivityInspectTimerInMinutes}"/> <property name="userInactivityInspectTimerInMinutes" value="${userInactivityInspectTimerInMinutes}"/>