a6d0c8c26c
* providers/saml: add basic metadata parser * providers/saml: add importer for Singing certificate, validate signature, add tests * providers/saml: add provider name to form, * web: don't use trailing slash for spa URLs * providers/saml: formatting fixes * sources/*: add verbose_name to source serializers * admin: add button launch import modal
35 lines
947 B
Python
35 lines
947 B
Python
"""SAMLSource API Views"""
|
|
from rest_framework.serializers import ModelSerializer
|
|
from rest_framework.viewsets import ModelViewSet
|
|
|
|
from authentik.admin.forms.source import SOURCE_FORM_FIELDS
|
|
from authentik.core.api.utils import MetaNameSerializer
|
|
from authentik.sources.saml.models import SAMLSource
|
|
|
|
|
|
class SAMLSourceSerializer(ModelSerializer, MetaNameSerializer):
|
|
"""SAMLSource Serializer"""
|
|
|
|
class Meta:
|
|
|
|
model = SAMLSource
|
|
fields = SOURCE_FORM_FIELDS + [
|
|
"issuer",
|
|
"sso_url",
|
|
"slo_url",
|
|
"allow_idp_initiated",
|
|
"name_id_policy",
|
|
"binding_type",
|
|
"signing_kp",
|
|
"digest_algorithm",
|
|
"signature_algorithm",
|
|
"temporary_user_delete_after",
|
|
]
|
|
|
|
|
|
class SAMLSourceViewSet(ModelViewSet):
|
|
"""SAMLSource Viewset"""
|
|
|
|
queryset = SAMLSource.objects.all()
|
|
serializer_class = SAMLSourceSerializer
|