2019-11-07 16:02:56 +00:00
|
|
|
"""SAMLSource API Views"""
|
|
|
|
from rest_framework.serializers import ModelSerializer
|
|
|
|
from rest_framework.viewsets import ModelViewSet
|
|
|
|
|
2020-06-24 20:27:14 +00:00
|
|
|
from passbook.admin.forms.source import SOURCE_FORM_FIELDS
|
2019-11-07 16:02:56 +00:00
|
|
|
from passbook.sources.saml.models import SAMLSource
|
|
|
|
|
|
|
|
|
|
|
|
class SAMLSourceSerializer(ModelSerializer):
|
|
|
|
"""SAMLSource Serializer"""
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
|
|
|
model = SAMLSource
|
2020-06-24 20:27:14 +00:00
|
|
|
fields = SOURCE_FORM_FIELDS + [
|
2020-02-20 20:33:45 +00:00
|
|
|
"issuer",
|
2020-06-24 20:27:14 +00:00
|
|
|
"sso_url",
|
2020-09-11 22:53:38 +00:00
|
|
|
"slo_url",
|
|
|
|
"allow_idp_initiated",
|
2020-07-08 14:18:02 +00:00
|
|
|
"name_id_policy",
|
2020-06-24 20:27:14 +00:00
|
|
|
"binding_type",
|
|
|
|
"temporary_user_delete_after",
|
2020-03-03 22:35:38 +00:00
|
|
|
"signing_kp",
|
2019-12-31 11:51:16 +00:00
|
|
|
]
|
2019-11-07 16:02:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SAMLSourceViewSet(ModelViewSet):
|
|
|
|
"""SAMLSource Viewset"""
|
|
|
|
|
|
|
|
queryset = SAMLSource.objects.all()
|
|
|
|
serializer_class = SAMLSourceSerializer
|