mitol-django-scim 2025.5.23__py3-none-any.whl → 2025.5.30.1__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,21 @@ and this project uses date-based versioning.
6
6
 
7
7
  <!-- scriv-insert-here -->
8
8
 
9
+ <a id='changelog-2025.5.30.1'></a>
10
+ ## [2025.5.30.1] - 2025-05-30
11
+
12
+ ### Fixed
13
+
14
+ - Fixed a duplicate user on sync error
15
+
16
+ <a id='changelog-2025.5.30'></a>
17
+ ## [2025.5.30] - 2025-05-30
18
+
19
+ ### Fixed
20
+
21
+ - Fixed status code handling for batch operations
22
+ - Fixed email case sensitivity issue with scim sync
23
+
9
24
  <a id='changelog-2025.5.23'></a>
10
25
  ## [2025.5.23] - 2025-05-23
11
26
 
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.1"
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:
@@ -156,7 +162,8 @@ def _get_sync_operations(
156
162
  for user_resource in found_users:
157
163
  user = user_resource.user
158
164
 
159
- missing_users.remove(user)
165
+ if user in missing_users:
166
+ missing_users.remove(user)
160
167
 
161
168
  yield user_resource
162
169
 
@@ -232,7 +239,7 @@ def _perform_sync_operations(
232
239
  bulk_id = operation["bulkId"]
233
240
  user = users_by_bulk_id[bulk_id]
234
241
 
235
- if operation["status"] != str(http.HTTPStatus.CREATED):
242
+ if int(operation["status"]) != http.HTTPStatus.CREATED:
236
243
  log.error(
237
244
  "Unable to perform operation for user: %s, response: %s",
238
245
  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.1
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=9gS_J7L8ojAVtqvYrizptJ8vQpOqa-89tJXdW6GhNjM,916
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=yCb3SH9hvwXO3zAWW5_t4F6atrVKqAOv6vrtiITChMw,137
6
6
  mitol/scim/adapters.py,sha256=_NCi3tyDepq5oi5DscoERaW4V67soUjiLcv8nPvk59U,7729
7
- mitol/scim/api.py,sha256=tSn5i3ZPFVntxD6rHpKSac2ztKr_tIQs8mgCIoPxiGU,7601
7
+ mitol/scim/api.py,sha256=dO1kJNDGEGi3bG70CLutMqSPMIV_qfNLiDq15W09bvc,7915
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.1.dist-info/METADATA,sha256=6ndPfCHpSqoUjlRVzlIj8m3uec0utSc0gO5Ed1AVr6M,2182
25
+ mitol_django_scim-2025.5.30.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
+ mitol_django_scim-2025.5.30.1.dist-info/RECORD,,