From 3052d0cca71482b19f17bc6b0ad51e8d44ed3c8d Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Thu, 10 Apr 2025 02:52:48 +0800 Subject: [PATCH] scim: Make "id" a string in our responses. In SCIM, this is always a string, even if numerical. While SCIM clients seem to handle our prior behavior, this was a bug nonetheless. --- zerver/lib/scim.py | 2 +- zerver/tests/test_scim.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/lib/scim.py b/zerver/lib/scim.py index d5e81e1064..232073a865 100644 --- a/zerver/lib/scim.py +++ b/zerver/lib/scim.py @@ -102,7 +102,7 @@ class ZulipSCIMUser(SCIMUser): return { "schemas": [scim_constants.SchemaURI.USER], - "id": self.obj.id, + "id": str(self.obj.id), "userName": self.obj.delivery_email, "name": name, "displayName": self.display_name, diff --git a/zerver/tests/test_scim.py b/zerver/tests/test_scim.py index aec99bb930..2540c3aa31 100644 --- a/zerver/tests/test_scim.py +++ b/zerver/tests/test_scim.py @@ -34,7 +34,7 @@ class SCIMTestCase(ZulipTestCase): def generate_user_schema(self, user_profile: UserProfile) -> dict[str, Any]: return { "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], - "id": user_profile.id, + "id": str(user_profile.id), "userName": user_profile.delivery_email, "name": {"formatted": user_profile.full_name}, "displayName": user_profile.full_name,