openvidu-server secuity exceptions prevention. New browserify scripts

pull/3/head
pabloFuente 2017-04-12 13:42:28 +02:00
parent 9f41599afd
commit a68652cdd4
4 changed files with 22257 additions and 4641 deletions

View File

@ -5,7 +5,8 @@
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
"scripts": { "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", "test": "echo \"Error: no test specified\" && exit 1",
"prepublish": "cd ts && tsc", "prepublish": "cd ts && tsc",
"developing": "cd ts && tsc -w" "developing": "cd ts && tsc -w"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -159,7 +159,9 @@ public class RoomManager {
} }
room.leave(participantId); room.leave(participantId);
if (this.sessionIdTokenRole.get(roomName) != null){
this.sessionIdTokenRole.get(roomName).remove(participant.getName()); this.sessionIdTokenRole.get(roomName).remove(participant.getName());
}
showMap(); showMap();
@ -939,11 +941,31 @@ public class RoomManager {
} }
public boolean isParticipantInRoom(String participantName, String roomName) { 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) { 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(){ public String newSessionId(){