
* api: cleanup owner superuser permissions Signed-off-by: Jens Langhammer <jens@goauthentik.io> * remove remaining owner filters Signed-off-by: Jens Langhammer <jens@goauthentik.io> * re-organise Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix order of filtering Signed-off-by: Jens Langhammer <jens@goauthentik.io> * re-add legacy behaviour for tokens Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix notifications Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
"""Kerberos Source Serializer"""
|
|
|
|
from rest_framework.viewsets import ModelViewSet
|
|
|
|
from authentik.core.api.sources import (
|
|
GroupSourceConnectionSerializer,
|
|
GroupSourceConnectionViewSet,
|
|
UserSourceConnectionSerializer,
|
|
)
|
|
from authentik.core.api.used_by import UsedByMixin
|
|
from authentik.sources.kerberos.models import (
|
|
GroupKerberosSourceConnection,
|
|
UserKerberosSourceConnection,
|
|
)
|
|
|
|
|
|
class UserKerberosSourceConnectionSerializer(UserSourceConnectionSerializer):
|
|
"""Kerberos Source Serializer"""
|
|
|
|
class Meta:
|
|
model = UserKerberosSourceConnection
|
|
fields = UserSourceConnectionSerializer.Meta.fields + ["identifier"]
|
|
|
|
|
|
class UserKerberosSourceConnectionViewSet(UsedByMixin, ModelViewSet):
|
|
"""Source Viewset"""
|
|
|
|
queryset = UserKerberosSourceConnection.objects.all()
|
|
serializer_class = UserKerberosSourceConnectionSerializer
|
|
filterset_fields = ["source__slug"]
|
|
search_fields = ["source__slug"]
|
|
ordering = ["source__slug"]
|
|
owner_field = "user"
|
|
|
|
|
|
class GroupKerberosSourceConnectionSerializer(GroupSourceConnectionSerializer):
|
|
"""OAuth Group-Source connection Serializer"""
|
|
|
|
class Meta(GroupSourceConnectionSerializer.Meta):
|
|
model = GroupKerberosSourceConnection
|
|
|
|
|
|
class GroupKerberosSourceConnectionViewSet(GroupSourceConnectionViewSet):
|
|
"""Group-source connection Viewset"""
|
|
|
|
queryset = GroupKerberosSourceConnection.objects.all()
|
|
serializer_class = GroupKerberosSourceConnectionSerializer
|