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 secret_fields = ["credentials"] 31 32 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"] 44 45 46class GoogleEndpointDeviceSerializer(ModelSerializer): 47 """Serializer for Endpoint authenticator devices""" 48 49 class Meta: 50 model = EndpointDevice 51 fields = ["pk", "name"] 52 depth = 2 53 54 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" 69 70 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"]
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 ] 31 secret_fields = ["credentials"]
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 ] 31 secret_fields = ["credentials"]
model =
<class 'authentik.enterprise.stages.authenticator_endpoint_gdtc.models.AuthenticatorEndpointGDTCStage'>
class
AuthenticatorEndpointGDTCStageViewSet(authentik.core.api.used_by.UsedByMixin, rest_framework.viewsets.ModelViewSet):
34class AuthenticatorEndpointGDTCStageViewSet(UsedByMixin, ModelViewSet): 35 """AuthenticatorEndpointGDTCStage Viewset""" 36 37 queryset = AuthenticatorEndpointGDTCStage.objects.all() 38 serializer_class = AuthenticatorEndpointGDTCStageSerializer 39 filterset_fields = [ 40 "name", 41 "configure_flow", 42 ] 43 search_fields = ["name"] 44 ordering = ["name"]
AuthenticatorEndpointGDTCStage Viewset
serializer_class =
<class 'AuthenticatorEndpointGDTCStageSerializer'>
Inherited Members
47class GoogleEndpointDeviceSerializer(ModelSerializer): 48 """Serializer for Endpoint authenticator devices""" 49 50 class Meta: 51 model = EndpointDevice 52 fields = ["pk", "name"] 53 depth = 2
Serializer for Endpoint authenticator devices
class
GoogleEndpointDeviceSerializer.Meta:
class
EndpointDeviceViewSet(rest_framework.mixins.RetrieveModelMixin, rest_framework.mixins.ListModelMixin, authentik.core.api.used_by.UsedByMixin, rest_framework.viewsets.GenericViewSet):
56class EndpointDeviceViewSet( 57 mixins.RetrieveModelMixin, 58 mixins.ListModelMixin, 59 UsedByMixin, 60 GenericViewSet, 61): 62 """Viewset for Endpoint authenticator devices""" 63 64 queryset = EndpointDevice.objects.all() 65 serializer_class = GoogleEndpointDeviceSerializer 66 search_fields = ["name"] 67 filterset_fields = ["name"] 68 ordering = ["name"] 69 owner_field = "user"
Viewset for Endpoint authenticator devices
serializer_class =
<class 'GoogleEndpointDeviceSerializer'>
Inherited Members
class
EndpointAdminDeviceViewSet(rest_framework.viewsets.ModelViewSet):
72class EndpointAdminDeviceViewSet(ModelViewSet): 73 """Viewset for Endpoint authenticator devices (for admins)""" 74 75 permission_classes = [IsAdminUser] 76 queryset = EndpointDevice.objects.all() 77 serializer_class = GoogleEndpointDeviceSerializer 78 search_fields = ["name"] 79 filterset_fields = ["name"] 80 ordering = ["name"]
Viewset for Endpoint authenticator devices (for admins)
serializer_class =
<class 'GoogleEndpointDeviceSerializer'>