Skip to content

Commit

Permalink
Add config toggle to disable Xirsys turn servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Jan 21, 2024
1 parent 73d1bc5 commit 17349a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.smallrye.config.ConfigMapping
@ConfigMapping(prefix = "xirsys")
interface XirsysProperties {
fun enabled(): Boolean
fun turnEnabled(): Boolean
fun baseUrl(): String
fun ident(): String
fun secret(): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class XirsysSessionHandler(
}

override val active = xirsysProperties.enabled()
private val turnEnabled = xirsysProperties.turnEnabled()

override fun createSession(id: String) {
LOG.debug("Creating session id $id")
Expand Down Expand Up @@ -48,7 +49,7 @@ class XirsysSessionHandler(
// The java URI class fails to read host and port due to the missing // after the :
// Thus we "normalize" the uri, even though it is technically valid
url.replaceFirst(":", "://")
},
}.filter { url -> turnEnabled || !url.startsWith("turn") },
),
)
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ xirsys:
ident: ${XIRSYS_IDENT}
secret: ${XIRSYS_SECRET}
channel-namespace: "faf"
turn-enabled: ${XIRSYS_TURN_ENABLED:true}
smallrye:
jwt:
sign:
Expand Down

0 comments on commit 17349a9

Please sign in to comment.