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.
authentik/authentik/policies/event_matcher/api.py
Jens Langhammer 54c50f6446 policies: add test API
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2021-03-29 23:40:36 +02:00

25 lines
678 B
Python

"""Event Matcher Policy API"""
from rest_framework.viewsets import ModelViewSet
from authentik.policies.api.policies import PolicySerializer
from authentik.policies.event_matcher.models import EventMatcherPolicy
class EventMatcherPolicySerializer(PolicySerializer):
"""Event Matcher Policy Serializer"""
class Meta:
model = EventMatcherPolicy
fields = PolicySerializer.Meta.fields + [
"action",
"client_ip",
"app",
]
class EventMatcherPolicyViewSet(ModelViewSet):
"""Event Matcher Policy Viewset"""
queryset = EventMatcherPolicy.objects.all()
serializer_class = EventMatcherPolicySerializer