From 85b6bfbe5f9da84185bdf857307a1b3e97c2ba1f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 14 May 2022 21:26:02 +0200 Subject: [PATCH] sources: fix parent serializer for user connections Signed-off-by: Jens Langhammer --- .../sources/oauth/api/source_connection.py | 4 ++-- .../sources/plex/api/source_connection.py | 4 ++-- schema.yml | 24 +++++-------------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/authentik/sources/oauth/api/source_connection.py b/authentik/sources/oauth/api/source_connection.py index 268089adb..c44edeeeb 100644 --- a/authentik/sources/oauth/api/source_connection.py +++ b/authentik/sources/oauth/api/source_connection.py @@ -4,12 +4,12 @@ from rest_framework.filters import OrderingFilter, SearchFilter from rest_framework.viewsets import ModelViewSet from authentik.api.authorization import OwnerFilter, OwnerSuperuserPermissions -from authentik.core.api.sources import SourceSerializer +from authentik.core.api.sources import UserSourceConnectionSerializer from authentik.core.api.used_by import UsedByMixin from authentik.sources.oauth.models import UserOAuthSourceConnection -class UserOAuthSourceConnectionSerializer(SourceSerializer): +class UserOAuthSourceConnectionSerializer(UserSourceConnectionSerializer): """OAuth Source Serializer""" class Meta: diff --git a/authentik/sources/plex/api/source_connection.py b/authentik/sources/plex/api/source_connection.py index 0368adec8..32847dcb4 100644 --- a/authentik/sources/plex/api/source_connection.py +++ b/authentik/sources/plex/api/source_connection.py @@ -4,12 +4,12 @@ from rest_framework.filters import OrderingFilter, SearchFilter from rest_framework.viewsets import ModelViewSet from authentik.api.authorization import OwnerFilter, OwnerSuperuserPermissions -from authentik.core.api.sources import SourceSerializer +from authentik.core.api.sources import UserSourceConnectionSerializer from authentik.core.api.used_by import UsedByMixin from authentik.sources.plex.models import PlexSourceConnection -class PlexSourceConnectionSerializer(SourceSerializer): +class PlexSourceConnectionSerializer(UserSourceConnectionSerializer): """Plex Source connection Serializer""" class Meta: diff --git a/schema.yml b/schema.yml index b296ff830..1a4608ca2 100644 --- a/schema.yml +++ b/schema.yml @@ -27782,9 +27782,6 @@ components: type: object description: Plex Source connection Serializer properties: - source: - type: string - format: uuid identifier: type: string minLength: 1 @@ -28364,9 +28361,6 @@ components: properties: user: type: integer - source: - type: string - format: uuid identifier: type: string minLength: 1 @@ -28566,8 +28560,9 @@ components: type: integer readOnly: true source: - type: string - format: uuid + allOf: + - $ref: '#/components/schemas/Source' + readOnly: true identifier: type: string plex_token: @@ -28582,9 +28577,6 @@ components: type: object description: Plex Source connection Serializer properties: - source: - type: string - format: uuid identifier: type: string minLength: 1 @@ -28594,7 +28586,6 @@ components: required: - identifier - plex_token - - source PlexSourceRequest: type: object description: Plex Source Serializer @@ -31201,8 +31192,9 @@ components: user: type: integer source: - type: string - format: uuid + allOf: + - $ref: '#/components/schemas/Source' + readOnly: true identifier: type: string maxLength: 255 @@ -31217,9 +31209,6 @@ components: properties: user: type: integer - source: - type: string - format: uuid identifier: type: string minLength: 1 @@ -31230,7 +31219,6 @@ components: nullable: true required: - identifier - - source - user UserPasswordSetRequest: type: object