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.
This commit is contained in:
Mateusz Mandera
2025-04-10 02:52:48 +08:00
committed by Tim Abbott
parent 88d1dcaf02
commit 3052d0cca7
2 changed files with 2 additions and 2 deletions

View File

@@ -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,

View File

@@ -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,