Skip to content

Commit

Permalink
Use tokenLifetimeSeconds property for Xirsys turn requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Nov 21, 2023
1 parent 8b7bc70 commit 28f8d4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sealed interface XirsysResponse<T : Any> {
@JsonInclude(JsonInclude.Include.NON_NULL)
data class TurnRequest(
@JsonFormat(shape = JsonFormat.Shape.STRING)
val expire: Int = 30,
val expire: Long = 30,
) {
val format: String = "urls"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.faforever.icebreaker.service.xirsys

import com.faforever.icebreaker.config.FafProperties
import com.faforever.icebreaker.service.Server
import com.faforever.icebreaker.service.Session
import com.faforever.icebreaker.service.SessionHandler
Expand All @@ -12,6 +13,7 @@ private val LOG: Logger = LoggerFactory.getLogger(XirsysSessionHandler::class.ja
@Singleton
class XirsysSessionHandler(
xirsysProperties: XirsysProperties,
private val fafProperties: FafProperties,
private val xirsysApiAdapter: XirsysApiAdapter,
) : SessionHandler {
companion object {
Expand Down Expand Up @@ -42,7 +44,7 @@ class XirsysSessionHandler(
override fun getIceServersSession(sessionId: String): List<Session.Server> =
xirsysApiAdapter.requestIceServers(
channelName = sessionId,
turnRequest = TurnRequest(),
turnRequest = TurnRequest(expire = fafProperties.tokenLifetimeSeconds()),
).iceServers.let {
listOf(
Session.Server(
Expand Down

0 comments on commit 28f8d4d

Please sign in to comment.