From b1c871381ddc8ea42f20fc731f7b2209d93a7713 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Fri, 26 Apr 2024 14:49:29 -0500 Subject: [PATCH] Add a config flag to allow disabling JitsiXmppStringprep. --- .../src/main/kotlin/org/jitsi/jicofo/xmpp/XmppConfig.kt | 4 ++++ jicofo-selector/src/main/resources/reference.conf | 3 +++ jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/jicofo-common/src/main/kotlin/org/jitsi/jicofo/xmpp/XmppConfig.kt b/jicofo-common/src/main/kotlin/org/jitsi/jicofo/xmpp/XmppConfig.kt index f96abcdc2d..02a21c9a09 100644 --- a/jicofo-common/src/main/kotlin/org/jitsi/jicofo/xmpp/XmppConfig.kt +++ b/jicofo-common/src/main/kotlin/org/jitsi/jicofo/xmpp/XmppConfig.kt @@ -37,6 +37,10 @@ class XmppConfig private constructor() { .convertFrom> { l -> l.map { JidCreate.domainBareFrom(it) } } } + val useJitsiJidValidation: Boolean by config { + "jicofo.xmpp.use-jitsi-jid-validation".from(newConfig) + } + companion object { @JvmField val service = XmppServiceConnectionConfig() diff --git a/jicofo-selector/src/main/resources/reference.conf b/jicofo-selector/src/main/resources/reference.conf index 8699a35f4d..ecd6d4038c 100644 --- a/jicofo-selector/src/main/resources/reference.conf +++ b/jicofo-selector/src/main/resources/reference.conf @@ -389,6 +389,9 @@ jicofo { } xmpp { + // Whether to use JitsiXmppStringprep to validate JIDs. If set to false uses the default validation in Smack. + use-jitsi-jid-validation = true + // The separate XMPP connection used for communication with clients (endpoints). client { enabled = true diff --git a/jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt b/jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt index e00d1e2592..5aeeebea13 100644 --- a/jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt +++ b/jicofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt @@ -54,7 +54,7 @@ import org.jivesoftware.smack.SmackConfiguration import org.jivesoftware.smack.provider.ProviderManager fun initializeSmack() { - org.jitsi.xmpp.Smack.initialize() + org.jitsi.xmpp.Smack.initialize(XmppConfig.config.useJitsiJidValidation) SmackConfiguration.setDefaultReplyTimeout(15000)