This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/passbook/channels/out_saml/api.py

53 lines
1.3 KiB
Python
Raw Normal View History

"""SAMLOutlet API Views"""
2019-10-28 16:40:57 +00:00
from rest_framework.serializers import ModelSerializer
from rest_framework.viewsets import ModelViewSet
from passbook.channels.out_saml.models import SAMLOutlet, SAMLPropertyMapping
2019-10-28 16:40:57 +00:00
class SAMLOutletSerializer(ModelSerializer):
"""SAMLOutlet Serializer"""
2019-10-28 16:40:57 +00:00
class Meta:
model = SAMLOutlet
2019-12-31 11:51:16 +00:00
fields = [
"pk",
"name",
"processor_path",
2019-12-31 11:51:16 +00:00
"acs_url",
"audience",
"issuer",
"assertion_valid_not_before",
"assertion_valid_not_on_or_after",
"session_valid_not_on_or_after",
"property_mappings",
"digest_algorithm",
"signature_algorithm",
2020-03-05 16:09:08 +00:00
"signing_kp",
"require_signing",
2019-12-31 11:51:16 +00:00
]
2019-10-28 16:40:57 +00:00
class SAMLOutletViewSet(ModelViewSet):
"""SAMLOutlet Viewset"""
2019-10-28 16:40:57 +00:00
queryset = SAMLOutlet.objects.all()
serializer_class = SAMLOutletSerializer
2019-10-28 16:40:57 +00:00
class SAMLPropertyMappingSerializer(ModelSerializer):
"""SAMLPropertyMapping Serializer"""
class Meta:
model = SAMLPropertyMapping
fields = ["pk", "name", "saml_name", "friendly_name", "expression"]
2019-10-28 16:40:57 +00:00
class SAMLPropertyMappingViewSet(ModelViewSet):
"""SAMLPropertyMapping Viewset"""
queryset = SAMLPropertyMapping.objects.all()
serializer_class = SAMLPropertyMappingSerializer