Revert replacing the deprecated shaHex DigestUtils by sha1Hex and updated API controller.

This commit is contained in:
Ghazi Triki 2016-10-12 21:53:05 +01:00
parent bf5de153a0
commit 054037c6d6
5 changed files with 14 additions and 26 deletions

View File

@ -286,19 +286,9 @@ class ApiController {
return
}
Boolean isBreakoutRoom = false
if(!StringUtils.isEmpty(params.isBreakout)) {
isBreakoutRoom = new Boolean(StringUtils.strip(params.isBreakout))
}
// Everything is good so far. Translate the external meeting id to an internal meeting id. If
// we can't find the meeting, complain.
String internalMeetingId = paramsProcessorUtil.convertToInternalMeetingId(externalMeetingId);
if (isBreakoutRoom) {
// This is a join request for a breakout room. Use the passed meetingId to find the meeting.
internalMeetingId = externalMeetingId
log.info("Join request for breakout room " + internalMeetingId)
}
log.info("Retrieving meeting ${internalMeetingId}")
Meeting meeting = meetingService.getMeeting(internalMeetingId);
@ -869,7 +859,9 @@ class ApiController {
meeting {
meetingID() { mkp.yield(m.getExternalId()) }
internalMeetingID() { mkp.yield(m.getInternalId()) }
parentMeetingID() { mkp.yield(m.getParentMeetingId()) }
if (m.isBreakout()) {
parentMeetingID() { mkp.yield(m.getParentMeetingId()) }
}
isBreakout() { mkp.yield(m.isBreakout()) }
meetingName() { mkp.yield(m.getName()) }
createTime(m.getCreateTime())
@ -2137,7 +2129,9 @@ class ApiController {
isBreakout() { mkp.yield(meeting.isBreakout()) }
meetingID() { mkp.yield(meeting.getExternalId()) }
internalMeetingID(meeting.getInternalId())
parentMeetingID() { mkp.yield(meeting.getParentMeetingId()) }
if (m.isBreakout()) {
parentMeetingID() { mkp.yield(meeting.getParentMeetingId()) }
}
createTime(meeting.getCreateTime())
createDate(formatPrettyDate(meeting.getCreateTime()))
voiceBridge() { mkp.yield(meeting.getTelVoice()) }

View File

@ -367,15 +367,9 @@ public class MeetingService implements MessageListener {
public Meeting getMeeting(String meetingId) {
if (meetingId == null)
return null;
int dashes = meetingId.split("-", -1).length - 1;
for (String key : meetings.keySet()) {
int keyDashes = key.split("-", -1).length - 1;
if (dashes == 2
&& key.equals(meetingId)
|| (dashes < 2 && keyDashes < 2 && key
.startsWith(meetingId))) {
if (key.startsWith(meetingId))
return (Meeting) meetings.get(key);
}
}
return null;

View File

@ -370,7 +370,7 @@ public class ParamsProcessorUtil {
// We rebuild the the external meeting using the has of the parent
// meeting, the shared timestamp and the sequence number
String timeStamp = StringUtils.substringAfter(internalMeetingId, "-");
String externalHash = DigestUtils.sha1Hex(parentMeetingId.concat("-").concat(timeStamp.toString()).concat("-").concat(params.get("sequence")));
String externalHash = DigestUtils.shaHex(parentMeetingId.concat("-").concat(timeStamp.toString()).concat("-").concat(params.get("sequence")));
externalMeetingId = externalHash.concat("-").concat(timeStamp);
}
@ -466,7 +466,7 @@ public class ParamsProcessorUtil {
}
public String convertToInternalMeetingId(String extMeetingId) {
return DigestUtils.sha1Hex(extMeetingId);
return DigestUtils.shaHex(extMeetingId);
}
public String processPassword(String pass) {
@ -561,7 +561,7 @@ public class ParamsProcessorUtil {
return true;
}
String cs = DigestUtils.sha1Hex(meetingID + configXML + securitySalt);
String cs = DigestUtils.shaHex(meetingID + configXML + securitySalt);
if (cs == null || cs.equals(checksum) == false) {
log.info("checksumError: configXML checksum. our: [{}], client: [{}]", cs, checksum);
@ -586,7 +586,7 @@ public class ParamsProcessorUtil {
queryString = queryString.replace("checksum=" + checksum, "");
}
String cs = DigestUtils.sha1Hex(apiCall + queryString + securitySalt);
String cs = DigestUtils.shaHex(apiCall + queryString + securitySalt);
if (cs == null || cs.equals(checksum) == false) {
log.info("query string after checksum removed: [{}]", queryString);
@ -646,7 +646,7 @@ public class ParamsProcessorUtil {
csbuf.append(securitySalt);
String baseString = csbuf.toString();
String cs = DigestUtils.sha1Hex(baseString);
String cs = DigestUtils.shaHex(baseString);
if (cs == null || cs.equals(checksum) == false) {
log.info("POST basestring = [" + baseString + "]");

View File

@ -7,7 +7,7 @@ public final class Util {
public static String generatePresentationId(String name) {
long timestamp = System.currentTimeMillis();
return DigestUtils.sha1Hex(name) + "-" + timestamp;
return DigestUtils.shaHex(name) + "-" + timestamp;
}
public static String createNewFilename(String presId, String fileExt) {

View File

@ -105,7 +105,7 @@ public class PresentationUrlDownloadService {
public String generatePresentationId(String name) {
long timestamp = System.currentTimeMillis();
return DigestUtils.sha1Hex(name) + "-" + timestamp;
return DigestUtils.shaHex(name) + "-" + timestamp;
}
public File createPresentationDirectory(String meetingId,