openvidu-server secuity exceptions prevention. New browserify scripts
This commit is contained in:
parent
9f41599afd
commit
a68652cdd4
@ -5,7 +5,8 @@
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"scripts": {
|
||||
"browserify": "cd ts && watchify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/OpenVidu.js -v",
|
||||
"browserify1": "cd ts/OpenVidu && browserify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../../static/js/OpenVidu.js -v",
|
||||
"browserify2": "cd ts/OpenViduTokBox && browserify Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../../static/js/OpenViduTokBox.js -v",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"prepublish": "cd ts && tsc",
|
||||
"developing": "cd ts && tsc -w"
|
||||
|
||||
File diff suppressed because one or more lines are too long
16906
openvidu-browser/src/main/resources/static/js/OpenViduTokBox.js
Normal file
16906
openvidu-browser/src/main/resources/static/js/OpenViduTokBox.js
Normal file
File diff suppressed because one or more lines are too long
@ -159,7 +159,9 @@ public class RoomManager {
|
||||
}
|
||||
room.leave(participantId);
|
||||
|
||||
this.sessionIdTokenRole.get(roomName).remove(participant.getName());
|
||||
if (this.sessionIdTokenRole.get(roomName) != null){
|
||||
this.sessionIdTokenRole.get(roomName).remove(participant.getName());
|
||||
}
|
||||
|
||||
showMap();
|
||||
|
||||
@ -939,11 +941,31 @@ public class RoomManager {
|
||||
}
|
||||
|
||||
public boolean isParticipantInRoom(String participantName, String roomName) {
|
||||
return (this.sessionIdTokenRole.get(roomName).containsKey(participantName) || !SECURITY_ENABLED );
|
||||
if (SECURITY_ENABLED) {
|
||||
if (this.sessionIdTokenRole.get(roomName) != null) {
|
||||
return this.sessionIdTokenRole.get(roomName).containsKey(participantName);
|
||||
} else{
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPublisherInRoom(String participantName, String roomName) {
|
||||
return (this.sessionIdTokenRole.get(roomName).get(participantName).equals(ParticipantRole.PUBLISHER) || !SECURITY_ENABLED );
|
||||
if (SECURITY_ENABLED) {
|
||||
if (this.sessionIdTokenRole.get(roomName) != null){
|
||||
if (this.sessionIdTokenRole.get(roomName).get(participantName) != null){
|
||||
return (this.sessionIdTokenRole.get(roomName).get(participantName).equals(ParticipantRole.PUBLISHER));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else{
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public String newSessionId(){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user