-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start endpoint and property mapping stuff
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
- Loading branch information
Showing
11 changed files
with
1,171 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""RAC Provider API Views""" | ||
from rest_framework.viewsets import ModelViewSet | ||
|
||
from authentik.core.api.providers import ProviderSerializer | ||
from authentik.core.api.used_by import UsedByMixin | ||
from authentik.enterprise.providers.rac.models import Endpoint | ||
|
||
|
||
class EndpointSerializer(ProviderSerializer): | ||
"""Endpoint Serializer""" | ||
|
||
class Meta: | ||
model = Endpoint | ||
fields = ["name", "protocol", "host", "settings", "property_mappings"] | ||
extra_kwargs = ProviderSerializer.Meta.extra_kwargs | ||
|
||
|
||
class EndpointViewSet(UsedByMixin, ModelViewSet): | ||
"""Endpoint Viewset""" | ||
|
||
queryset = Endpoint.objects.all() | ||
serializer_class = EndpointSerializer | ||
search_fields = ["name", "protocol"] | ||
ordering = ["name", "protocol"] |
23 changes: 23 additions & 0 deletions
23
authentik/enterprise/providers/rac/api/property_mappings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""RAC Provider API Views""" | ||
from rest_framework.viewsets import ModelViewSet | ||
|
||
from authentik.core.api.propertymappings import PropertyMappingSerializer | ||
from authentik.core.api.used_by import UsedByMixin | ||
from authentik.enterprise.providers.rac.models import RACPropertyMapping | ||
|
||
|
||
class RACPropertyMappingSerializer(PropertyMappingSerializer): | ||
"""RACPropertyMapping Serializer""" | ||
|
||
class Meta: | ||
model = RACPropertyMapping | ||
fields = PropertyMappingSerializer.Meta.fields + [] | ||
|
||
|
||
class RACPropertyMappingViewSet(UsedByMixin, ModelViewSet): | ||
"""RACPropertyMapping Viewset""" | ||
|
||
queryset = RACPropertyMapping.objects.all() | ||
serializer_class = RACPropertyMappingSerializer | ||
search_fields = ["name"] | ||
ordering = ["name"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.