authentik.providers.saml.api.property_mappings

SAML Property mappings API Views

 1"""SAML Property mappings API Views"""
 2
 3from rest_framework.viewsets import ModelViewSet
 4
 5from authentik.core.api.property_mappings import PropertyMappingFilterSet, PropertyMappingSerializer
 6from authentik.core.api.used_by import UsedByMixin
 7from authentik.providers.saml.models import SAMLPropertyMapping
 8
 9
10class SAMLPropertyMappingSerializer(PropertyMappingSerializer):
11    """SAMLPropertyMapping Serializer"""
12
13    class Meta:
14        model = SAMLPropertyMapping
15        fields = PropertyMappingSerializer.Meta.fields + [
16            "saml_name",
17            "friendly_name",
18        ]
19
20
21class SAMLPropertyMappingFilter(PropertyMappingFilterSet):
22    """Filter for SAMLPropertyMapping"""
23
24    class Meta(PropertyMappingFilterSet.Meta):
25        model = SAMLPropertyMapping
26        fields = PropertyMappingFilterSet.Meta.fields + ["saml_name", "friendly_name"]
27
28
29class SAMLPropertyMappingViewSet(UsedByMixin, ModelViewSet):
30    """SAMLPropertyMapping Viewset"""
31
32    queryset = SAMLPropertyMapping.objects.all()
33    serializer_class = SAMLPropertyMappingSerializer
34    filterset_class = SAMLPropertyMappingFilter
35    search_fields = ["name"]
36    ordering = ["name"]
class SAMLPropertyMappingSerializer(authentik.core.api.property_mappings.PropertyMappingSerializer):
11class SAMLPropertyMappingSerializer(PropertyMappingSerializer):
12    """SAMLPropertyMapping Serializer"""
13
14    class Meta:
15        model = SAMLPropertyMapping
16        fields = PropertyMappingSerializer.Meta.fields + [
17            "saml_name",
18            "friendly_name",
19        ]

SAMLPropertyMapping Serializer

class SAMLPropertyMappingSerializer.Meta:
14    class Meta:
15        model = SAMLPropertyMapping
16        fields = PropertyMappingSerializer.Meta.fields + [
17            "saml_name",
18            "friendly_name",
19        ]
fields = ['pk', 'managed', 'name', 'expression', 'component', 'verbose_name', 'verbose_name_plural', 'meta_model_name', 'saml_name', 'friendly_name']
class SAMLPropertyMappingFilter(authentik.core.api.property_mappings.PropertyMappingFilterSet):
22class SAMLPropertyMappingFilter(PropertyMappingFilterSet):
23    """Filter for SAMLPropertyMapping"""
24
25    class Meta(PropertyMappingFilterSet.Meta):
26        model = SAMLPropertyMapping
27        fields = PropertyMappingFilterSet.Meta.fields + ["saml_name", "friendly_name"]

Filter for SAMLPropertyMapping

declared_filters = OrderedDict({'managed': <django_filters.filters.AllValuesMultipleFilter object>, 'managed__isnull': <django_filters.filters.BooleanFilter object>})
base_filters = OrderedDict({'name': <django_filters.filters.CharFilter object>, 'managed': <django_filters.filters.AllValuesMultipleFilter object>, 'saml_name': <django_filters.filters.CharFilter object>, 'friendly_name': <django_filters.filters.CharFilter object>, 'managed__isnull': <django_filters.filters.BooleanFilter object>})
class SAMLPropertyMappingFilter.Meta(authentik.core.api.property_mappings.PropertyMappingFilterSet.Meta):
25    class Meta(PropertyMappingFilterSet.Meta):
26        model = SAMLPropertyMapping
27        fields = PropertyMappingFilterSet.Meta.fields + ["saml_name", "friendly_name"]
fields = ['name', 'managed', 'saml_name', 'friendly_name']
class SAMLPropertyMappingViewSet(authentik.core.api.used_by.UsedByMixin, rest_framework.viewsets.ModelViewSet):
30class SAMLPropertyMappingViewSet(UsedByMixin, ModelViewSet):
31    """SAMLPropertyMapping Viewset"""
32
33    queryset = SAMLPropertyMapping.objects.all()
34    serializer_class = SAMLPropertyMappingSerializer
35    filterset_class = SAMLPropertyMappingFilter
36    search_fields = ["name"]
37    ordering = ["name"]

SAMLPropertyMapping Viewset

queryset = <InheritanceQuerySet []>
serializer_class = <class 'SAMLPropertyMappingSerializer'>
filterset_class = <class 'SAMLPropertyMappingFilter'>
search_fields = ['name']
ordering = ['name']
name = None
description = None
suffix = None
detail = None
basename = None