authentik.enterprise.stages.authenticator_endpoint_gdtc.api
AuthenticatorEndpointGDTCStage API Views
1"""AuthenticatorEndpointGDTCStage API Views""" 2 3from rest_framework import mixins 4from rest_framework.permissions import IsAdminUser 5from rest_framework.viewsets import GenericViewSet, ModelViewSet 6from structlog.stdlib import get_logger 7 8from authentik.core.api.used_by import UsedByMixin 9from authentik.core.api.utils import ModelSerializer 10from authentik.enterprise.api import EnterpriseRequiredMixin 11from authentik.enterprise.stages.authenticator_endpoint_gdtc.models import ( 12 AuthenticatorEndpointGDTCStage, 13 EndpointDevice, 14) 15from authentik.flows.api.stages import StageSerializer 16 17LOGGER = get_logger() 18 19 20class AuthenticatorEndpointGDTCStageSerializer(EnterpriseRequiredMixin, StageSerializer): 21 """AuthenticatorEndpointGDTCStage Serializer""" 22 23 class Meta: 24 model = AuthenticatorEndpointGDTCStage 25 fields = StageSerializer.Meta.fields + [ 26 "configure_flow", 27 "friendly_name", 28 "credentials", 29 ] 30 31 32class AuthenticatorEndpointGDTCStageViewSet(UsedByMixin, ModelViewSet): 33 """AuthenticatorEndpointGDTCStage Viewset""" 34 35 queryset = AuthenticatorEndpointGDTCStage.objects.all() 36 serializer_class = AuthenticatorEndpointGDTCStageSerializer 37 filterset_fields = [ 38 "name", 39 "configure_flow", 40 ] 41 search_fields = ["name"] 42 ordering = ["name"] 43 44 45class GoogleEndpointDeviceSerializer(ModelSerializer): 46 """Serializer for Endpoint authenticator devices""" 47 48 class Meta: 49 model = EndpointDevice 50 fields = ["pk", "name"] 51 depth = 2 52 53 54class EndpointDeviceViewSet( 55 mixins.RetrieveModelMixin, 56 mixins.ListModelMixin, 57 UsedByMixin, 58 GenericViewSet, 59): 60 """Viewset for Endpoint authenticator devices""" 61 62 queryset = EndpointDevice.objects.all() 63 serializer_class = GoogleEndpointDeviceSerializer 64 search_fields = ["name"] 65 filterset_fields = ["name"] 66 ordering = ["name"] 67 owner_field = "user" 68 69 70class EndpointAdminDeviceViewSet(ModelViewSet): 71 """Viewset for Endpoint authenticator devices (for admins)""" 72 73 permission_classes = [IsAdminUser] 74 queryset = EndpointDevice.objects.all() 75 serializer_class = GoogleEndpointDeviceSerializer 76 search_fields = ["name"] 77 filterset_fields = ["name"] 78 ordering = ["name"]
LOGGER =
<BoundLoggerLazyProxy(logger=None, wrapper_class=None, processors=None, context_class=None, initial_values={}, logger_factory_args=())>
class
AuthenticatorEndpointGDTCStageSerializer(authentik.enterprise.api.EnterpriseRequiredMixin, authentik.flows.api.stages.StageSerializer):
21class AuthenticatorEndpointGDTCStageSerializer(EnterpriseRequiredMixin, StageSerializer): 22 """AuthenticatorEndpointGDTCStage Serializer""" 23 24 class Meta: 25 model = AuthenticatorEndpointGDTCStage 26 fields = StageSerializer.Meta.fields + [ 27 "configure_flow", 28 "friendly_name", 29 "credentials", 30 ]
AuthenticatorEndpointGDTCStage Serializer
Inherited Members
class
AuthenticatorEndpointGDTCStageSerializer.Meta:
24 class Meta: 25 model = AuthenticatorEndpointGDTCStage 26 fields = StageSerializer.Meta.fields + [ 27 "configure_flow", 28 "friendly_name", 29 "credentials", 30 ]
class
AuthenticatorEndpointGDTCStageViewSet(authentik.core.api.used_by.UsedByMixin, rest_framework.viewsets.ModelViewSet):
33class AuthenticatorEndpointGDTCStageViewSet(UsedByMixin, ModelViewSet): 34 """AuthenticatorEndpointGDTCStage Viewset""" 35 36 queryset = AuthenticatorEndpointGDTCStage.objects.all() 37 serializer_class = AuthenticatorEndpointGDTCStageSerializer 38 filterset_fields = [ 39 "name", 40 "configure_flow", 41 ] 42 search_fields = ["name"] 43 ordering = ["name"]
AuthenticatorEndpointGDTCStage Viewset
serializer_class =
<class 'AuthenticatorEndpointGDTCStageSerializer'>
Inherited Members
46class GoogleEndpointDeviceSerializer(ModelSerializer): 47 """Serializer for Endpoint authenticator devices""" 48 49 class Meta: 50 model = EndpointDevice 51 fields = ["pk", "name"] 52 depth = 2
Serializer for Endpoint authenticator devices
Inherited Members
class
GoogleEndpointDeviceSerializer.Meta:
class
EndpointDeviceViewSet(rest_framework.mixins.RetrieveModelMixin, rest_framework.mixins.ListModelMixin, authentik.core.api.used_by.UsedByMixin, rest_framework.viewsets.GenericViewSet):
55class EndpointDeviceViewSet( 56 mixins.RetrieveModelMixin, 57 mixins.ListModelMixin, 58 UsedByMixin, 59 GenericViewSet, 60): 61 """Viewset for Endpoint authenticator devices""" 62 63 queryset = EndpointDevice.objects.all() 64 serializer_class = GoogleEndpointDeviceSerializer 65 search_fields = ["name"] 66 filterset_fields = ["name"] 67 ordering = ["name"] 68 owner_field = "user"
Viewset for Endpoint authenticator devices
serializer_class =
<class 'GoogleEndpointDeviceSerializer'>
Inherited Members
class
EndpointAdminDeviceViewSet(rest_framework.viewsets.ModelViewSet):
71class EndpointAdminDeviceViewSet(ModelViewSet): 72 """Viewset for Endpoint authenticator devices (for admins)""" 73 74 permission_classes = [IsAdminUser] 75 queryset = EndpointDevice.objects.all() 76 serializer_class = GoogleEndpointDeviceSerializer 77 search_fields = ["name"] 78 filterset_fields = ["name"] 79 ordering = ["name"]
Viewset for Endpoint authenticator devices (for admins)
serializer_class =
<class 'GoogleEndpointDeviceSerializer'>