Add expiry to TURN password. (#4515)
* Add expiry to TURN password. Defaults to 5m. For backwards compatibility expiry = 0 skips adding it. * fix variable shadowing
This commit is contained in:
@@ -1036,8 +1036,8 @@ func (r *RoomManager) iceServersForParticipant(apiKey string, participant types.
|
||||
urls = append(urls, fmt.Sprintf("turns:%s:443?transport=tcp", r.config.TURN.Domain))
|
||||
}
|
||||
if len(urls) > 0 {
|
||||
username := r.turnAuthHandler.CreateUsername(apiKey, participant.ID(), r.config.TURN.TTLSeconds)
|
||||
password, err := r.turnAuthHandler.CreatePassword(apiKey, participant.ID())
|
||||
username, expiry := r.turnAuthHandler.CreateUsername(apiKey, participant.ID(), r.config.TURN.TTLSeconds)
|
||||
password, err := r.turnAuthHandler.CreatePassword(apiKey, participant.ID(), expiry)
|
||||
if err != nil {
|
||||
participant.GetLogger().Warnw("could not create turn password", err)
|
||||
hasSTUN = false
|
||||
|
||||
Reference in New Issue
Block a user