mitol-django-scim 2025.5.23__py3-none-any.whl → 2025.5.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ and this project uses date-based versioning.
6
6
 
7
7
  <!-- scriv-insert-here -->
8
8
 
9
+ <a id='changelog-2025.5.30'></a>
10
+ ## [2025.5.30] - 2025-05-30
11
+
12
+ ### Fixed
13
+
14
+ - Fixed status code handling for batch operations
15
+ - Fixed email case sensitivity issue with scim sync
16
+
9
17
  <a id='changelog-2025.5.23'></a>
10
18
  ## [2025.5.23] - 2025-05-23
11
19
 
mitol/scim/__init__.py CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  default_app_config = "mitol.scim.apps.ScimApp"
4
4
 
5
- __version__ = "2025.5.23"
5
+ __version__ = "2025.5.30"
6
6
  __distributionname__ = "mitol-django-scim"
mitol/scim/api.py CHANGED
@@ -95,7 +95,7 @@ def _user_search_by_email(
95
95
  session: OAuth2Session, users: list["User"]
96
96
  ) -> StateOrOperationGenerator:
97
97
  """Perform a search for a set of users by email"""
98
- users_by_email = {user.email: user for user in users}
98
+ users_by_email = {user.email.lower(): user for user in users}
99
99
 
100
100
  payload = {
101
101
  "schemas": [SchemaURI.SERACH_REQUEST], # typo in upstream lib
@@ -127,12 +127,18 @@ def _user_search_by_email(
127
127
  for resource in resources:
128
128
  email = first(
129
129
  [
130
- email["value"]
130
+ email["value"].lower()
131
131
  for email in resource.get("emails", [])
132
132
  if email.get("primary", False)
133
133
  ]
134
134
  )
135
- if email is not None:
135
+ if email is None:
136
+ log.error("Unexpected user result with no email")
137
+ elif email not in users_by_email:
138
+ log.error(
139
+ "Received an email in search results that does not match: %s", email
140
+ )
141
+ else:
136
142
  yield UserState(users_by_email[email], resource["id"])
137
143
 
138
144
  if not resources:
@@ -232,7 +238,7 @@ def _perform_sync_operations(
232
238
  bulk_id = operation["bulkId"]
233
239
  user = users_by_bulk_id[bulk_id]
234
240
 
235
- if operation["status"] != str(http.HTTPStatus.CREATED):
241
+ if int(operation["status"]) != http.HTTPStatus.CREATED:
236
242
  log.error(
237
243
  "Unable to perform operation for user: %s, response: %s",
238
244
  str(user),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mitol-django-scim
3
- Version: 2025.5.23
3
+ Version: 2025.5.30
4
4
  Summary: Django application for SCIM integrations
5
5
  License-Expression: BSD-3-Clause
6
6
  Requires-Python: >=3.10
@@ -1,10 +1,10 @@
1
- CHANGELOG.md,sha256=lFnwuj3OyZD3EwrDs0XeKXVYSn7yMucYb0bjDQzMAsI,623
1
+ CHANGELOG.md,sha256=e42OVkkfycDr-80GiQE0dPKktQVhAMeLOmqheK4lT00,799
2
2
  README.md,sha256=BtRLbXiY3j5At4nfZdxnlHBgrTq4TeyBj3R0fDxNkQw,1599
3
3
  mitol/__init__.py,sha256=q3JNmHn0CMPtEqkMR40lkjKQzuWUtT39xIFUYJ-MKIE,56
4
4
  mitol/scim/README.md,sha256=d3fHo_YbqpNcjksOLoQC-6ZCOBuKKUermGbtnYgxGVI,1502
5
- mitol/scim/__init__.py,sha256=gHM_Mg6sOn8X5JWo6RAwijsDib1GZ0OUAKTXPAs9F9g,135
5
+ mitol/scim/__init__.py,sha256=sSJWXSeO90OuJrvP916Izt-byBQIB2XCCHAL7s4PBy0,135
6
6
  mitol/scim/adapters.py,sha256=_NCi3tyDepq5oi5DscoERaW4V67soUjiLcv8nPvk59U,7729
7
- mitol/scim/api.py,sha256=tSn5i3ZPFVntxD6rHpKSac2ztKr_tIQs8mgCIoPxiGU,7601
7
+ mitol/scim/api.py,sha256=gKwqcNf93jdlxYghR9aT--kQCwLjrVzy4NuUuaqeCJQ,7877
8
8
  mitol/scim/apps.py,sha256=wsvBGEASCFfFereo7p_CKkynibUlayTSIu0aM0LyMN4,399
9
9
  mitol/scim/config.py,sha256=vMGOGgeU4QXXJF9yzxucscelN6ETH6NfW_TYBYackkE,328
10
10
  mitol/scim/constants.py,sha256=Di1Vmy26_dm0con_gP2lBf_O79ucI5jOpQdl6SB-LEs,393
@@ -21,6 +21,6 @@ mitol/scim/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
21
21
  mitol/scim/management/commands/scim_push.py,sha256=hzrIdCU93uptv2S0jyJUi7hV0had30SDbdm0Po0sJR8,514
22
22
  mitol/scim/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  mitol/scim/settings/scim.py,sha256=szxU7WZXSbNXvGNIm3Lyy-cXFdPUPevjmicGIYQyR-Y,1876
24
- mitol_django_scim-2025.5.23.dist-info/METADATA,sha256=OBj7yo9Kme6dIodPL4bBQc1OztG1_bo_ilokqx4E1jw,2180
25
- mitol_django_scim-2025.5.23.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
- mitol_django_scim-2025.5.23.dist-info/RECORD,,
24
+ mitol_django_scim-2025.5.30.dist-info/METADATA,sha256=VTfMPNsfh3v5jh7szM69t_O6tlSQ__TIdX-o8-A9_hY,2180
25
+ mitol_django_scim-2025.5.30.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
+ mitol_django_scim-2025.5.30.dist-info/RECORD,,