mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: common identifiers format
parent
68e88f21db
commit
2cbdcb9251
|
@ -368,12 +368,14 @@ public abstract class SessionManager {
|
|||
public Participant newParticipant(String sessionId, String participantPrivatetId, Token token,
|
||||
String clientMetadata, GeoLocation location, String platform, String finalUserId) {
|
||||
if (this.sessionidParticipantpublicidParticipant.get(sessionId) != null) {
|
||||
String participantPublicId = RandomStringUtils.randomAlphanumeric(16).toLowerCase();
|
||||
String participantPublicId = "con_" + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||
+ RandomStringUtils.randomAlphanumeric(9);
|
||||
Participant p = new Participant(finalUserId, participantPrivatetId, participantPublicId, sessionId, token,
|
||||
clientMetadata, location, platform, EndpointType.WEBRTC_ENDPOINT, null);
|
||||
while (this.sessionidParticipantpublicidParticipant.get(sessionId).putIfAbsent(participantPublicId,
|
||||
p) != null) {
|
||||
participantPublicId = RandomStringUtils.randomAlphanumeric(16).toLowerCase();
|
||||
participantPublicId = "con_" + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||
+ RandomStringUtils.randomAlphanumeric(9);
|
||||
p.setParticipantPublicId(participantPublicId);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,8 @@ public class TokenGeneratorDefault implements TokenGenerator {
|
|||
KurentoTokenOptions kurentoTokenOptions) {
|
||||
String token = OpenViduServer.wsUrl;
|
||||
token += "?sessionId=" + sessionId;
|
||||
token += "&token=" + RandomStringUtils.randomAlphanumeric(16).toLowerCase();
|
||||
token += "&token=" + "tok_" + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||
+ RandomStringUtils.randomAlphanumeric(15);
|
||||
token += "&role=" + role.name();
|
||||
token += "&version=" + openviduConfig.getOpenViduServerVersion();
|
||||
TurnCredentials turnCredentials = null;
|
||||
|
|
|
@ -100,9 +100,10 @@ public class KurentoParticipant extends Participant {
|
|||
}
|
||||
|
||||
public void createPublishingEndpoint(MediaOptions mediaOptions) {
|
||||
final String publisherStreamId = this.getParticipantPublicId() + "_"
|
||||
+ (mediaOptions.hasVideo() ? mediaOptions.getTypeOfVideo() : "MICRO") + "_"
|
||||
+ RandomStringUtils.random(5, true, false).toUpperCase();
|
||||
String type = mediaOptions.hasVideo() ? mediaOptions.getTypeOfVideo() : "MICRO";
|
||||
final String publisherStreamId = "str_" + type.substring(0, Math.min(type.length(), 3)) + "_"
|
||||
+ RandomStringUtils.randomAlphabetic(1).toUpperCase() + RandomStringUtils.randomAlphanumeric(3) + "_"
|
||||
+ this.getParticipantPublicId().substring(4, this.getParticipantPublicId().length());
|
||||
publisher.setStreamId(publisherStreamId);
|
||||
publisher.setEndpointName(publisherStreamId);
|
||||
publisher.setMediaOptions(mediaOptions);
|
||||
|
|
|
@ -899,13 +899,14 @@ public class KurentoSessionManager extends SessionManager {
|
|||
location = null;
|
||||
}
|
||||
|
||||
final String rtspConnectionId = kMediaOptions.getTypeOfVideo() + "-" + protocol + "-"
|
||||
final String rtspConnectionId = "ipc_" + kMediaOptions.getTypeOfVideo() + "-" + protocol + "-"
|
||||
+ RandomStringUtils.randomAlphanumeric(4).toLowerCase() + "-" + url.getAuthority()
|
||||
+ url.getPath().replaceAll("/", "-").replaceAll("_", "-");
|
||||
|
||||
// Store a "fake" participant for the IpCam connection
|
||||
this.newInsecureParticipant(rtspConnectionId);
|
||||
String token = RandomStringUtils.randomAlphanumeric(16).toLowerCase();
|
||||
String token = "tok_" + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||
+ RandomStringUtils.randomAlphanumeric(15);
|
||||
Token tokenObj = null;
|
||||
if (this.isTokenValidInSession(token, sessionId, rtspConnectionId, serverMetadata)) {
|
||||
tokenObj = this.consumeToken(sessionId, rtspConnectionId, token);
|
||||
|
|
|
@ -60,7 +60,8 @@ public class FixedOneKmsManager extends KmsManager {
|
|||
try {
|
||||
List<KmsProperties> kmsProps = new ArrayList<>();
|
||||
for (String kmsUri : this.openviduConfig.getKmsUris()) {
|
||||
String kmsId = "kms-" + RandomStringUtils.randomAlphanumeric(6).toUpperCase();
|
||||
String kmsId = "kms_" + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||
+ RandomStringUtils.randomAlphanumeric(7);
|
||||
kmsProps.add(new KmsProperties(kmsId, kmsUri));
|
||||
}
|
||||
this.initializeKurentoClients(kmsProps, true, false);
|
||||
|
|
|
@ -159,7 +159,8 @@ public class SessionRestController {
|
|||
}
|
||||
sessionId = customSessionId;
|
||||
} else {
|
||||
sessionId = RandomStringUtils.randomAlphanumeric(16).toLowerCase();
|
||||
sessionId = "ses_" + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||
+ RandomStringUtils.randomAlphanumeric(9);
|
||||
}
|
||||
|
||||
Session sessionNotActive = sessionManager.storeSessionNotActive(sessionId, sessionProperties);
|
||||
|
|
|
@ -231,7 +231,8 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
|||
|
||||
if (openviduConfig.isOpenViduSecret(secret)) {
|
||||
sessionManager.newInsecureParticipant(participantPrivatetId);
|
||||
token = RandomStringUtils.randomAlphanumeric(16).toLowerCase();
|
||||
token = "tok_" + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||
+ RandomStringUtils.randomAlphanumeric(15);
|
||||
if (recorder) {
|
||||
generateRecorderParticipant = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue