SEBSERV-148 fixed JS API by switch to version 1.9.0

This commit is contained in:
anhefti 2021-04-01 15:13:41 +02:00
parent 749cbea287
commit 1f2aff5084
2 changed files with 141 additions and 13 deletions

View file

@ -42,17 +42,17 @@ public class ZoomWindowScriptResolver implements ProctoringWindowScriptResolver
"<html>\n"
+ " <head>\n"
+ " <meta charset=\"utf-8\" />\n"
+ " <link type=\"text/css\" rel=\"stylesheet\" href=\"https://source.zoom.us/1.8.1/css/bootstrap.css\" />\n"
+ " <link type=\"text/css\" rel=\"stylesheet\" href=\"https://source.zoom.us/1.8.1/css/react-select.css\" />\n"
+ " <link type=\"text/css\" rel=\"stylesheet\" href=\"https://source.zoom.us/1.9.0/css/bootstrap.css\" />\n"
+ " <link type=\"text/css\" rel=\"stylesheet\" href=\"https://source.zoom.us/1.9.0/css/react-select.css\" />\n"
+ " </head>\n"
+ " <body>\n"
+ " <script src=\"https://source.zoom.us/1.8.1/lib/vendor/react.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.8.1/lib/vendor/react-dom.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.8.1/lib/vendor/redux.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.8.1/lib/vendor/redux-thunk.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.8.1/lib/vendor/jquery.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.8.1/lib/vendor/lodash.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/zoom-meeting-1.8.1.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/react.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/react-dom.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/redux.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/redux-thunk.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/jquery.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/lodash.min.js\"></script>\n"
+ " <script src=\"https://source.zoom.us/zoom-meeting-1.9.0.min.js\"></script>\n"
+ " <script src=\"https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9/crypto-js.min.js\"></script>\n"
+ " <script type=\"text/javascript\">\n"
+ "\n"
@ -60,7 +60,7 @@ public class ZoomWindowScriptResolver implements ProctoringWindowScriptResolver
+ " console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));\n"
+ "\n"
+ " console.log(\"Initializing Zoom...\");\n"
+ " ZoomMtg.setZoomJSLib('https://source.zoom.us/1.8.1/lib', '/av');\n"
+ " ZoomMtg.setZoomJSLib('https://source.zoom.us/1.9.0/lib', '/av');\n"
+ " ZoomMtg.preLoadWasm();\n"
+ " ZoomMtg.prepareJssdk();\n"
+ "\n"
@ -145,6 +145,134 @@ public class ZoomWindowScriptResolver implements ProctoringWindowScriptResolver
+ "</html>";
// @formatter:on
// // @formatter:off
// private static final String TEST_ZOOM_WINDOW_HTML =
// "<html>\n"
// + " <head>\n"
// + " <meta charset=\"utf-8\" />\n"
// + " <link type=\"text/css\" rel=\"stylesheet\" href=\"https://source.zoom.us/1.9.0/css/bootstrap.css\" />\n"
// + " <link type=\"text/css\" rel=\"stylesheet\" href=\"https://source.zoom.us/1.9.0/css/react-select.css\" />\n"
// + " </head>\n"
// + " <body>\n"
// + " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/react.min.js\"></script>\n"
// + " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/react-dom.min.js\"></script>\n"
// + " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/redux.min.js\"></script>\n"
// + " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/redux-thunk.min.js\"></script>\n"
// + " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/jquery.min.js\"></script>\n"
// + " <script src=\"https://source.zoom.us/1.9.0/lib/vendor/lodash.min.js\"></script>\n"
// + " <script src=\"https://source.zoom.us/zoom-meeting-1.9.0.min.js\"></script>\n"
// + " <script src=\"https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9/crypto-js.min.js\"></script>\n"
// + " <script type=\"text/javascript\">\n"
// + "\n"
// + " console.log(\"Checking system requirements...\");\n"
// + " console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));\n"
// + "\n"
// + " console.log(\"Initializing Zoom...\");\n"
// + " ZoomMtg.setZoomJSLib('https://source.zoom.us/1.9.0/lib', '/av');\n"
// + " ZoomMtg.preLoadWasm();\n"
// + " ZoomMtg.prepareJssdk();\n"
// + "\n"
// + "const API_KEY = \"wX6KmZetQgeYqJix3W7Vtw\";\r\n"
// + "const API_SECRET = \"PoxjA08IGIO5X3m8iDxZcti0c0VtQL9DenZU\";\r\n"
// + "\r\n"
// + "console.log(\"Checking system requirements...\");\r\n"
// + "console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));\r\n"
// + "\r\n"
// + "console.log(\"Initializing Zoom...\");\r\n"
// + "ZoomMtg.setZoomJSLib('https://source.zoom.us/1.9.0/lib', '/av');\r\n"
// + "ZoomMtg.preLoadWasm();\r\n"
// + "ZoomMtg.prepareJssdk();\r\n"
// + "\r\n"
// + "const config = {\r\n"
// + " meetingNumber: %%_" + ATTR_ROOM_NAME + "_%%,\r\n"
// + " leaveUrl: 'https://google.ch',\r\n"
// + " userName: 'Firstname Lastname',\r\n"
// + " userEmail: 'firstname.lastname@yoursite.com',\r\n"
// + " /* passWord: 'password', // if required */\r\n"
// + " role: 0 // 1 for host; 0 for attendee\r\n"
// + "};\r\n"
// + "\r\n"
// + "const signature = ZoomMtg.generateSignature({\r\n"
// + " meetingNumber: config.meetingNumber,\r\n"
// + " apiKey: API_KEY,\r\n"
// + " apiSecret: API_SECRET,\r\n"
// + " role: config.role,\r\n"
// + " error: function (res) {\r\n"
// + " console.error(\"FAILED TO GENERATE SIGNATURE: \" + res)\r\n"
// + " },\r\n"
// + " success: function (res) {\r\n"
// + " console.log(\"Successfully generated signature.\");\r\n"
// + " console.log(res.result);\r\n"
// + " },\r\n"
// + "});\r\n"
// + "\r\n"
// + "console.log(\"Initializing meeting...\");\r\n"
// + "console.log(\"signature: \" + signature);\r\n"
// + "\r\n"
// + "// See documentation: https://zoom.github.io/sample-app-web/ZoomMtg.html#init\r\n"
// + "ZoomMtg.init({\r\n"
// + " debug: true, //optional\r\n"
// + " leaveUrl: config.leaveUrl, //required\r\n"
// + " // webEndpoint: 'PSO web domain', // PSO option\r\n"
// + " showMeetingHeader: true, //option\r\n"
// + " disableInvite: false, //optional\r\n"
// + " disableCallOut: false, //optional\r\n"
// + " disableRecord: false, //optional\r\n"
// + " disableJoinAudio: false, //optional\r\n"
// + " audioPanelAlwaysOpen: true, //optional\r\n"
// + " showPureSharingContent: false, //optional\r\n"
// + " isSupportAV: true, //optional,\r\n"
// + " isSupportChat: false, //optional,\r\n"
// + " isSupportQA: true, //optional,\r\n"
// + " isSupportCC: true, //optional,\r\n"
// + " screenShare: true, //optional,\r\n"
// + " rwcBackup: '', //optional,\r\n"
// + " videoDrag: true, //optional,\r\n"
// + " sharingMode: 'both', //optional,\r\n"
// + " videoHeader: true, //optional,\r\n"
// + " isLockBottom: true, // optional,\r\n"
// + " isSupportNonverbal: true, // optional,\r\n"
// + " isShowJoiningErrorDialog: true, // optional,\r\n"
// + " inviteUrlFormat: '', // optional\r\n"
// + " loginWindow: { // optional,\r\n"
// + " width: 400,\r\n"
// + " height: 380\r\n"
// + " },\r\n"
// + " // meetingInfo: [ // optional\r\n"
// + " // 'topic',\r\n"
// + " // 'host',\r\n"
// + " // 'mn',\r\n"
// + " // 'pwd',\r\n"
// + " // 'telPwd',\r\n"
// + " // 'invite',\r\n"
// + " // 'participant',\r\n"
// + " // 'dc'\r\n"
// + " // ],\r\n"
// + " disableVoIP: false, // optional\r\n"
// + " disableReport: false, // optional\r\n"
// + " error: function(res) {\r\n"
// + " console.warn(\"INIT ERROR\")\r\n"
// + " console.log(res)\r\n"
// + " },\r\n"
// + " success: function() {\r\n"
// + " ZoomMtg.join({\r\n"
// + " signature: signature,\r\n"
// + " apiKey: API_KEY,\r\n"
// + " meetingNumber: config.meetingNumber,\r\n"
// + " userName: config.userName,\r\n"
// + " passWord: '%%_" + ATTR_ROOM_KEY + "_%%',\r\n"
// + " error(res) {\r\n"
// + " console.warn(\"JOIN ERROR\")\r\n"
// + " console.log(res)\r\n"
// + " }\r\n"
// + " })\r\n"
// + " }\r\n"
// + "})\n"
// + " </script>\n"
// + " </body>\n"
// + "</html>";
// // @formatter:on
@Override
public boolean applies(final ProctoringWindowData data) {
try {

View file

@ -156,7 +156,7 @@ public class ZoomProctoringService implements ExamProctoringService {
final ClientCredentials credentials = new ClientCredentials(
proctoringSettings.appKey,
this.cryptor.decrypt(proctoringSettings.appSecret));
this.cryptor.encrypt(proctoringSettings.appSecret));
final ResponseEntity<String> result = this.zoomRestTemplate
.testServiceConnection(
@ -179,7 +179,7 @@ public class ZoomProctoringService implements ExamProctoringService {
proctoringSettings.serverURL,
proctoringSettings.collectingRoomSize,
proctoringSettings.appKey,
this.cryptor.decrypt(proctoringSettings.appSecret));
this.cryptor.encrypt(proctoringSettings.appSecret));
disposeServiceRoomsForExam(
proctoringSettings.examId,
@ -425,7 +425,7 @@ public class ZoomProctoringService implements ExamProctoringService {
return Result.tryCatch(() -> {
final ClientCredentials credentials = new ClientCredentials(
proctoringSettings.appKey,
this.cryptor.decrypt(proctoringSettings.appSecret));
proctoringSettings.appSecret);
// First create a new user/host for the new room
final ResponseEntity<String> createUser = this.zoomRestTemplate.createUser(