mitol-django-scim 2025.5.30.2__py3-none-any.whl → 2025.6.10.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 +18 -0
- mitol/scim/__init__.py +1 -1
- mitol/scim/management/commands/{scim_push.py → scim_sync.py} +13 -1
- mitol/scim/tasks.py +18 -4
- {mitol_django_scim-2025.5.30.2.dist-info → mitol_django_scim-2025.6.10.1.dist-info}/METADATA +1 -1
- {mitol_django_scim-2025.5.30.2.dist-info → mitol_django_scim-2025.6.10.1.dist-info}/RECORD +7 -7
- {mitol_django_scim-2025.5.30.2.dist-info → mitol_django_scim-2025.6.10.1.dist-info}/WHEEL +0 -0
CHANGELOG.md
CHANGED
@@ -6,6 +6,24 @@ and this project uses date-based versioning.
|
|
6
6
|
|
7
7
|
<!-- scriv-insert-here -->
|
8
8
|
|
9
|
+
<a id='changelog-2025.6.10.1'></a>
|
10
|
+
## [2025.6.10.1] - 2025-06-10
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- Removed errant `type=` argument passed to scim_scim arg setup.
|
15
|
+
|
16
|
+
<a id='changelog-2025.6.10'></a>
|
17
|
+
## [2025.6.10] - 2025-06-10
|
18
|
+
|
19
|
+
### Added
|
20
|
+
|
21
|
+
- Added `--never-synced-only` option to `scim_sync` command.
|
22
|
+
|
23
|
+
### Changed
|
24
|
+
|
25
|
+
- Renamed `scim_push` command to `scim_sync`.
|
26
|
+
|
9
27
|
<a id='changelog-2025.5.30.2'></a>
|
10
28
|
## [2025.5.30.2] - 2025-05-30
|
11
29
|
|
mitol/scim/__init__.py
CHANGED
@@ -8,11 +8,23 @@ class Command(BaseCommand):
|
|
8
8
|
|
9
9
|
help = "Sync users with SCIM to the remote"
|
10
10
|
|
11
|
+
def add_arguments(self, parser) -> None:
|
12
|
+
parser.add_argument(
|
13
|
+
"--never-synced-only",
|
14
|
+
action="store_true",
|
15
|
+
default=False,
|
16
|
+
help="Only sync users who have never been synced",
|
17
|
+
)
|
18
|
+
|
11
19
|
def handle(self, *args, **options): # noqa: ARG002
|
12
20
|
"""Sync users with SCIM to the remote"""
|
13
21
|
from mitol.scim import tasks
|
14
22
|
|
15
|
-
|
23
|
+
never_synced_only = options["never-synced-only"]
|
24
|
+
|
25
|
+
task = tasks.sync_all_users_to_scim_remote.delay(
|
26
|
+
never_synced_only=never_synced_only
|
27
|
+
)
|
16
28
|
|
17
29
|
task.get()
|
18
30
|
|
mitol/scim/tasks.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
import logging
|
2
|
+
|
1
3
|
import celery
|
2
4
|
from django.contrib.auth import get_user_model
|
5
|
+
from django.db.models import Q
|
3
6
|
|
4
7
|
from mitol.common.utils.celery import get_celery_app
|
5
8
|
from mitol.common.utils.collections import chunks
|
@@ -9,6 +12,9 @@ User = get_user_model()
|
|
9
12
|
app = get_celery_app()
|
10
13
|
|
11
14
|
|
15
|
+
log = logging.getLogger()
|
16
|
+
|
17
|
+
|
12
18
|
@app.task(acks_late=True)
|
13
19
|
def sync_users_to_scim_remote_batch(*, user_ids: list[int]):
|
14
20
|
"""Sync a set of users to the scim remote"""
|
@@ -17,14 +23,22 @@ def sync_users_to_scim_remote_batch(*, user_ids: list[int]):
|
|
17
23
|
|
18
24
|
|
19
25
|
@app.task(bind=True, acks_late=True)
|
20
|
-
def sync_all_users_to_scim_remote(self):
|
26
|
+
def sync_all_users_to_scim_remote(self, *, never_synced_only: bool = False):
|
27
|
+
user_q = (
|
28
|
+
User.objects.values_list("id", flat=True).filter(is_active=True).order_by("id")
|
29
|
+
)
|
30
|
+
|
31
|
+
if never_synced_only:
|
32
|
+
user_q = user_q.filter(Q(global_id="") | Q(scim_external_id=None))
|
33
|
+
|
34
|
+
msg = f"Syncing {user_q.count()} users to SCIM remote"
|
35
|
+
log.info(msg)
|
36
|
+
|
21
37
|
return self.replace(
|
22
38
|
celery.group(
|
23
39
|
sync_users_to_scim_remote_batch.si(user_ids=user_ids)
|
24
40
|
for user_ids in chunks(
|
25
|
-
|
26
|
-
.filter(is_active=True)
|
27
|
-
.order_by("id"),
|
41
|
+
user_q,
|
28
42
|
chunk_size=1000,
|
29
43
|
)
|
30
44
|
)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
CHANGELOG.md,sha256=
|
1
|
+
CHANGELOG.md,sha256=gV35s2t03b7zLelvuRyunzd9IXA1lUVoDYUzzJeNAE0,1370
|
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=
|
5
|
+
mitol/scim/__init__.py,sha256=V1HVB4BYW2o_127kqKPjtrLf1ULtThDRubJm5oXdVrw,137
|
6
6
|
mitol/scim/adapters.py,sha256=_NCi3tyDepq5oi5DscoERaW4V67soUjiLcv8nPvk59U,7729
|
7
7
|
mitol/scim/api.py,sha256=KTkXsrxSS9wK6txHGVJT7oFUmp9Ai6Cayud8L-Ne2Hk,8044
|
8
8
|
mitol/scim/apps.py,sha256=wsvBGEASCFfFereo7p_CKkynibUlayTSIu0aM0LyMN4,399
|
@@ -12,15 +12,15 @@ mitol/scim/filters.py,sha256=ITUBoowqZ_XeJWIST5iBePWrmyfUVGzBJu1zQtDuGeo,3441
|
|
12
12
|
mitol/scim/forms.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
mitol/scim/parser.py,sha256=_WwX2cTjQ4jwfyShssWeNJMOxUBd3W6IhNUD7Vnpu3Q,4983
|
14
14
|
mitol/scim/requests.py,sha256=c42YcD03YmiqbrkI654E_FzIZZ6d-auAmIPr3eMeUOw,1468
|
15
|
-
mitol/scim/tasks.py,sha256=
|
15
|
+
mitol/scim/tasks.py,sha256=PWKf4v2c3zikBk4wMK3EihPZfrs9P_clH0CG3qV5l6k,1200
|
16
16
|
mitol/scim/urls.py,sha256=nUpDZekb_lcNKMu8MztxtYf4FoBUmE_8L2dWYuOlM_Q,451
|
17
17
|
mitol/scim/utils.py,sha256=opvgKLZT3CLMTfZlV-v6lIy0ABCYAtgvwsYybwJSF4M,173
|
18
18
|
mitol/scim/views.py,sha256=e_SClGVwlLLiO9qR32jDjFDWk8ApSgzTjdIhFNvD_88,6499
|
19
19
|
mitol/scim/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
20
|
mitol/scim/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
|
-
mitol/scim/management/commands/
|
21
|
+
mitol/scim/management/commands/scim_sync.py,sha256=ZSrbaR3_KZVncPJ7uz7MTofM2_dj5uPTorFQQDZd1_E,872
|
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.
|
25
|
-
mitol_django_scim-2025.
|
26
|
-
mitol_django_scim-2025.
|
24
|
+
mitol_django_scim-2025.6.10.1.dist-info/METADATA,sha256=K7e3-Sa9c_VMlKmMfZlNNCMuo29eirYx8D0NPFoBcVg,2182
|
25
|
+
mitol_django_scim-2025.6.10.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
26
|
+
mitol_django_scim-2025.6.10.1.dist-info/RECORD,,
|
File without changes
|