Skip to content

Commit

Permalink
Add session id to cloudflare CredentialRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Nov 29, 2024
1 parent f0700bd commit 6da196f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient
@Consumes(MediaType.APPLICATION_JSON)
interface CloudflareApiClient {

data class CredentialRequest(val ttl: Long)
data class CredentialRequest(val ttl: Long, val customIdentifier: String?)
data class CredentialResponse(val iceServers: IceServers) {
data class IceServers(val urls: List<String>, val username: String, val credential: String)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class CloudflareSessionHandler(

override fun getIceServersSession(sessionId: String): List<Session.Server> =
cloudflareApiAdapter.requestIceServers(
credentialRequest = CloudflareApiClient.CredentialRequest(ttl = fafProperties.tokenLifetimeSeconds()),
credentialRequest = CloudflareApiClient.CredentialRequest(
ttl = fafProperties.tokenLifetimeSeconds(),
customIdentifier = sessionId,
),
).let {
listOf(
Session.Server(
Expand Down

0 comments on commit 6da196f

Please sign in to comment.