-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sources/scim: add property mappings (#10650)
* sources/scim: add property mappings Signed-off-by: Marc 'risson' Schmitt <[email protected]> * fix filterset Signed-off-by: Marc 'risson' Schmitt <[email protected]> * fix doc link Signed-off-by: Marc 'risson' Schmitt <[email protected]> * lint Signed-off-by: Marc 'risson' Schmitt <[email protected]> --------- Signed-off-by: Marc 'risson' Schmitt <[email protected]>
- Loading branch information
Showing
16 changed files
with
862 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""SCIM source property mappings API""" | ||
|
||
from rest_framework.viewsets import ModelViewSet | ||
|
||
from authentik.core.api.property_mappings import PropertyMappingFilterSet, PropertyMappingSerializer | ||
from authentik.core.api.used_by import UsedByMixin | ||
from authentik.sources.scim.models import SCIMSourcePropertyMapping | ||
|
||
|
||
class SCIMSourcePropertyMappingSerializer(PropertyMappingSerializer): | ||
"""SCIMSourcePropertyMapping Serializer""" | ||
|
||
class Meta: | ||
model = SCIMSourcePropertyMapping | ||
fields = PropertyMappingSerializer.Meta.fields | ||
|
||
|
||
class SCIMSourcePropertyMappingFilter(PropertyMappingFilterSet): | ||
"""Filter for SCIMSourcePropertyMapping""" | ||
|
||
class Meta(PropertyMappingFilterSet.Meta): | ||
model = SCIMSourcePropertyMapping | ||
|
||
|
||
class SCIMSourcePropertyMappingViewSet(UsedByMixin, ModelViewSet): | ||
"""SCIMSourcePropertyMapping Viewset""" | ||
|
||
queryset = SCIMSourcePropertyMapping.objects.all() | ||
serializer_class = SCIMSourcePropertyMappingSerializer | ||
filterset_class = SCIMSourcePropertyMappingFilter | ||
search_fields = ["name"] | ||
ordering = ["name"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
authentik/sources/scim/migrations/0002_scimsourcepropertymapping.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Generated by Django 5.0.7 on 2024-07-26 13:19 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("authentik_core", "0037_remove_source_property_mappings"), | ||
("authentik_sources_scim", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="SCIMSourcePropertyMapping", | ||
fields=[ | ||
( | ||
"propertymapping_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="authentik_core.propertymapping", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "SCIM Source Property Mapping", | ||
"verbose_name_plural": "SCIM Source Property Mappings", | ||
}, | ||
bases=("authentik_core.propertymapping",), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.