Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tokenLifetimeSeconds property for Xirsys turn requests #6

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading