|
@@ -14,7 +14,10 @@
|
|
|
# limitations under the License.
|
|
|
import re
|
|
|
|
|
|
-client_secret_regex = re.compile(r"^[0-9a-zA-Z.=_-]+$")
|
|
|
+# https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-register-email-requesttoken
|
|
|
+# Note: The : character is allowed here for older clients, but will be removed in a
|
|
|
+# future release. Context: https://github.com/matrix-org/sydent/issues/247
|
|
|
+client_secret_regex = re.compile(r"^[0-9a-zA-Z\.\=\_\-\:]+$")
|
|
|
|
|
|
|
|
|
def is_valid_client_secret(client_secret):
|
|
@@ -24,4 +27,4 @@ def is_valid_client_secret(client_secret):
|
|
|
:returns: Whether the client_secret is valid
|
|
|
:rtype: bool
|
|
|
"""
|
|
|
- return client_secret_regex.match(client_secret) is not None
|
|
|
+ return client_secret_regex.match(client_secret) is not None
|