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.
2020-05-16 14:02:42 +00:00
|
|
|
"""OpenIDProvider API Views"""
|
2019-10-28 16:40:57 +00:00
|
|
|
from oidc_provider.models import Client
|
|
|
|
from rest_framework.serializers import ModelSerializer
|
|
|
|
from rest_framework.viewsets import ModelViewSet
|
|
|
|
|
2020-05-16 14:02:42 +00:00
|
|
|
# from passbook.providers.oidc.models import OpenIDProvider
|
2019-10-28 16:40:57 +00:00
|
|
|
|
|
|
|
|
2020-05-16 14:02:42 +00:00
|
|
|
class OpenIDProviderSerializer(ModelSerializer):
|
|
|
|
"""OpenIDProvider Serializer"""
|
2019-10-28 16:40:57 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
|
|
|
model = Client
|
2019-12-31 11:51:16 +00:00
|
|
|
fields = [
|
|
|
|
"pk",
|
|
|
|
"name",
|
|
|
|
"client_type",
|
|
|
|
"client_id",
|
|
|
|
"client_secret",
|
|
|
|
"response_types",
|
|
|
|
"jwt_alg",
|
|
|
|
"reuse_consent",
|
|
|
|
"require_consent",
|
|
|
|
"_redirect_uris",
|
|
|
|
"_scope",
|
|
|
|
]
|
|
|
|
|
2019-10-28 16:40:57 +00:00
|
|
|
|
2020-05-16 14:02:42 +00:00
|
|
|
class OpenIDProviderViewSet(ModelViewSet):
|
|
|
|
"""OpenIDProvider Viewset"""
|
2019-10-28 16:40:57 +00:00
|
|
|
|
|
|
|
queryset = Client.objects.all()
|
2020-05-16 14:02:42 +00:00
|
|
|
serializer_class = OpenIDProviderSerializer
|