Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit 27b14c3

Browse files
committed
Salt meet room name
1 parent 20d1fc4 commit 27b14c3

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

app/settings-dev.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@
241241
"identifier": "",
242242
"iss": "",
243243
"keyid": "",
244-
"sub": ""
244+
"sub": "",
245+
"salt": ""
245246
},
246247

247248
"peer": {

core/modules/meet/server/meet.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import * as jwt from 'jsonwebtoken'
2+
import crypto from 'crypto'
23

34
import { canAccessZone } from '../../../lib/misc'
45

5-
const { randomUUID } = require('crypto')
6-
76
const computeRoomName = (zone) => {
87
check(zone._id, Match.Id)
98

109
log('computeRoomName: start', { zoneId: zone._id })
1110

1211
let { uuid } = zone
1312
if (!uuid) {
14-
uuid = randomUUID()
13+
uuid = crypto.randomUUID()
1514
Zones.update(zone._id, { $set: { uuid } })
1615
}
1716

@@ -104,15 +103,22 @@ Meteor.methods({
104103

105104
log('computeMeetLowLevelRoomName: start', { usersIds })
106105

106+
const salt = Meteor.settings.meet.salt
107107
const meetRoomName = usersIds
108108
.sort((a, b) => a.localeCompare(b))
109109
.join('-')
110110
.toLowerCase()
111-
updateUserRoomName(meetRoomName)
112111

113-
log('computeMeetLowLevelRoomName: end', { meetRoomName })
112+
const hmac = crypto.createHmac('sha1', salt)
113+
hmac.setEncoding('base64')
114+
hmac.write(meetRoomName)
115+
hmac.end()
116+
hashedMeetRoomName = hmac.read().toLowerCase()
117+
118+
updateUserRoomName(hashedMeetRoomName)
119+
log('computeMeetLowLevelRoomName: end', { meetRoomName: hashedMeetRoomName })
114120

115-
return meetRoomName
121+
return hashedMeetRoomName
116122
},
117123
})
118124

0 commit comments

Comments
 (0)