sources/plex: add API for user connections
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
065121d280
commit
84c4547005
|
@ -58,7 +58,8 @@ from authentik.providers.saml.api import SAMLPropertyMappingViewSet, SAMLProvide
|
||||||
from authentik.sources.ldap.api import LDAPPropertyMappingViewSet, LDAPSourceViewSet
|
from authentik.sources.ldap.api import LDAPPropertyMappingViewSet, LDAPSourceViewSet
|
||||||
from authentik.sources.oauth.api.source import OAuthSourceViewSet
|
from authentik.sources.oauth.api.source import OAuthSourceViewSet
|
||||||
from authentik.sources.oauth.api.source_connection import UserOAuthSourceConnectionViewSet
|
from authentik.sources.oauth.api.source_connection import UserOAuthSourceConnectionViewSet
|
||||||
from authentik.sources.plex.api import PlexSourceViewSet
|
from authentik.sources.plex.api.source import PlexSourceViewSet
|
||||||
|
from authentik.sources.plex.api.source_connection import PlexSourceConnectionViewSet
|
||||||
from authentik.sources.saml.api import SAMLSourceViewSet
|
from authentik.sources.saml.api import SAMLSourceViewSet
|
||||||
from authentik.stages.authenticator_duo.api import (
|
from authentik.stages.authenticator_duo.api import (
|
||||||
AuthenticatorDuoStageViewSet,
|
AuthenticatorDuoStageViewSet,
|
||||||
|
@ -127,7 +128,8 @@ router.register("events/transports", NotificationTransportViewSet)
|
||||||
router.register("events/rules", NotificationRuleViewSet)
|
router.register("events/rules", NotificationRuleViewSet)
|
||||||
|
|
||||||
router.register("sources/all", SourceViewSet)
|
router.register("sources/all", SourceViewSet)
|
||||||
router.register("sources/oauth_user_connections", UserOAuthSourceConnectionViewSet)
|
router.register("sources/user_connections/oauth", UserOAuthSourceConnectionViewSet)
|
||||||
|
router.register("sources/user_connections/plex", PlexSourceConnectionViewSet)
|
||||||
router.register("sources/ldap", LDAPSourceViewSet)
|
router.register("sources/ldap", LDAPSourceViewSet)
|
||||||
router.register("sources/saml", SAMLSourceViewSet)
|
router.register("sources/saml", SAMLSourceViewSet)
|
||||||
router.register("sources/oauth", OAuthSourceViewSet)
|
router.register("sources/oauth", OAuthSourceViewSet)
|
||||||
|
|
0
authentik/sources/plex/api/__init__.py
Normal file
0
authentik/sources/plex/api/__init__.py
Normal file
41
authentik/sources/plex/api/source_connection.py
Normal file
41
authentik/sources/plex/api/source_connection.py
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
"""Plex Source connection Serializer"""
|
||||||
|
from django_filters.rest_framework import DjangoFilterBackend
|
||||||
|
from rest_framework import mixins
|
||||||
|
from rest_framework.filters import OrderingFilter, SearchFilter
|
||||||
|
from rest_framework.viewsets import GenericViewSet
|
||||||
|
|
||||||
|
from authentik.api.authorization import OwnerFilter, OwnerPermissions
|
||||||
|
from authentik.core.api.sources import SourceSerializer
|
||||||
|
from authentik.core.api.used_by import UsedByMixin
|
||||||
|
from authentik.sources.plex.models import PlexSourceConnection
|
||||||
|
|
||||||
|
|
||||||
|
class PlexSourceConnectionSerializer(SourceSerializer):
|
||||||
|
"""Plex Source connection Serializer"""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = PlexSourceConnection
|
||||||
|
fields = [
|
||||||
|
"pk",
|
||||||
|
"user",
|
||||||
|
"source",
|
||||||
|
"identifier",
|
||||||
|
"plex_token",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class PlexSourceConnectionViewSet(
|
||||||
|
mixins.RetrieveModelMixin,
|
||||||
|
mixins.UpdateModelMixin,
|
||||||
|
mixins.DestroyModelMixin,
|
||||||
|
UsedByMixin,
|
||||||
|
mixins.ListModelMixin,
|
||||||
|
GenericViewSet,
|
||||||
|
):
|
||||||
|
"""Plex Source connection Serializer"""
|
||||||
|
|
||||||
|
queryset = PlexSourceConnection.objects.all()
|
||||||
|
serializer_class = PlexSourceConnectionSerializer
|
||||||
|
filterset_fields = ["source__slug"]
|
||||||
|
permission_classes = [OwnerPermissions]
|
||||||
|
filter_backends = [OwnerFilter, DjangoFilterBackend, OrderingFilter, SearchFilter]
|
|
@ -56,7 +56,7 @@ class PlexSource(Source):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def serializer(self) -> BaseSerializer:
|
def serializer(self) -> BaseSerializer:
|
||||||
from authentik.sources.plex.api import PlexSourceSerializer
|
from authentik.sources.plex.api.source import PlexSourceSerializer
|
||||||
|
|
||||||
return PlexSourceSerializer
|
return PlexSourceSerializer
|
||||||
|
|
||||||
|
|
695
schema.yml
695
schema.yml
|
@ -13197,208 +13197,6 @@ paths:
|
||||||
$ref: '#/components/schemas/ValidationError'
|
$ref: '#/components/schemas/ValidationError'
|
||||||
'403':
|
'403':
|
||||||
$ref: '#/components/schemas/GenericError'
|
$ref: '#/components/schemas/GenericError'
|
||||||
/api/v2beta/sources/oauth_user_connections/:
|
|
||||||
get:
|
|
||||||
operationId: sources_oauth_user_connections_list
|
|
||||||
description: Source Viewset
|
|
||||||
parameters:
|
|
||||||
- name: ordering
|
|
||||||
required: false
|
|
||||||
in: query
|
|
||||||
description: Which field to use when ordering the results.
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
- name: page
|
|
||||||
required: false
|
|
||||||
in: query
|
|
||||||
description: A page number within the paginated result set.
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
- name: page_size
|
|
||||||
required: false
|
|
||||||
in: query
|
|
||||||
description: Number of results to return per page.
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
- name: search
|
|
||||||
required: false
|
|
||||||
in: query
|
|
||||||
description: A search term.
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
- in: query
|
|
||||||
name: source__slug
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
tags:
|
|
||||||
- sources
|
|
||||||
security:
|
|
||||||
- authentik: []
|
|
||||||
- cookieAuth: []
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/PaginatedUserOAuthSourceConnectionList'
|
|
||||||
description: ''
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/schemas/ValidationError'
|
|
||||||
'403':
|
|
||||||
$ref: '#/components/schemas/GenericError'
|
|
||||||
/api/v2beta/sources/oauth_user_connections/{id}/:
|
|
||||||
get:
|
|
||||||
operationId: sources_oauth_user_connections_retrieve
|
|
||||||
description: Source Viewset
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
description: A unique integer value identifying this User OAuth Source Connection.
|
|
||||||
required: true
|
|
||||||
tags:
|
|
||||||
- sources
|
|
||||||
security:
|
|
||||||
- authentik: []
|
|
||||||
- cookieAuth: []
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/UserOAuthSourceConnection'
|
|
||||||
description: ''
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/schemas/ValidationError'
|
|
||||||
'403':
|
|
||||||
$ref: '#/components/schemas/GenericError'
|
|
||||||
put:
|
|
||||||
operationId: sources_oauth_user_connections_update
|
|
||||||
description: Source Viewset
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
description: A unique integer value identifying this User OAuth Source Connection.
|
|
||||||
required: true
|
|
||||||
tags:
|
|
||||||
- sources
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/UserOAuthSourceConnectionRequest'
|
|
||||||
application/x-www-form-urlencoded:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/UserOAuthSourceConnectionRequest'
|
|
||||||
multipart/form-data:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/UserOAuthSourceConnectionRequest'
|
|
||||||
required: true
|
|
||||||
security:
|
|
||||||
- authentik: []
|
|
||||||
- cookieAuth: []
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/UserOAuthSourceConnection'
|
|
||||||
description: ''
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/schemas/ValidationError'
|
|
||||||
'403':
|
|
||||||
$ref: '#/components/schemas/GenericError'
|
|
||||||
patch:
|
|
||||||
operationId: sources_oauth_user_connections_partial_update
|
|
||||||
description: Source Viewset
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
description: A unique integer value identifying this User OAuth Source Connection.
|
|
||||||
required: true
|
|
||||||
tags:
|
|
||||||
- sources
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/PatchedUserOAuthSourceConnectionRequest'
|
|
||||||
application/x-www-form-urlencoded:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/PatchedUserOAuthSourceConnectionRequest'
|
|
||||||
multipart/form-data:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/PatchedUserOAuthSourceConnectionRequest'
|
|
||||||
security:
|
|
||||||
- authentik: []
|
|
||||||
- cookieAuth: []
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/UserOAuthSourceConnection'
|
|
||||||
description: ''
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/schemas/ValidationError'
|
|
||||||
'403':
|
|
||||||
$ref: '#/components/schemas/GenericError'
|
|
||||||
delete:
|
|
||||||
operationId: sources_oauth_user_connections_destroy
|
|
||||||
description: Source Viewset
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
description: A unique integer value identifying this User OAuth Source Connection.
|
|
||||||
required: true
|
|
||||||
tags:
|
|
||||||
- sources
|
|
||||||
security:
|
|
||||||
- authentik: []
|
|
||||||
- cookieAuth: []
|
|
||||||
responses:
|
|
||||||
'204':
|
|
||||||
description: No response body
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/schemas/ValidationError'
|
|
||||||
'403':
|
|
||||||
$ref: '#/components/schemas/GenericError'
|
|
||||||
/api/v2beta/sources/oauth_user_connections/{id}/used_by/:
|
|
||||||
get:
|
|
||||||
operationId: sources_oauth_user_connections_used_by_list
|
|
||||||
description: Get a list of all objects that use this object
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: id
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
description: A unique integer value identifying this User OAuth Source Connection.
|
|
||||||
required: true
|
|
||||||
tags:
|
|
||||||
- sources
|
|
||||||
security:
|
|
||||||
- authentik: []
|
|
||||||
- cookieAuth: []
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/UsedBy'
|
|
||||||
description: ''
|
|
||||||
'400':
|
|
||||||
$ref: '#/components/schemas/ValidationError'
|
|
||||||
'403':
|
|
||||||
$ref: '#/components/schemas/GenericError'
|
|
||||||
/api/v2beta/sources/plex/:
|
/api/v2beta/sources/plex/:
|
||||||
get:
|
get:
|
||||||
operationId: sources_plex_list
|
operationId: sources_plex_list
|
||||||
|
@ -14110,6 +13908,410 @@ paths:
|
||||||
$ref: '#/components/schemas/ValidationError'
|
$ref: '#/components/schemas/ValidationError'
|
||||||
'403':
|
'403':
|
||||||
$ref: '#/components/schemas/GenericError'
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
/api/v2beta/sources/user_connections/oauth/:
|
||||||
|
get:
|
||||||
|
operationId: sources_user_connections_oauth_list
|
||||||
|
description: Source Viewset
|
||||||
|
parameters:
|
||||||
|
- name: ordering
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
description: Which field to use when ordering the results.
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: page
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
description: A page number within the paginated result set.
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
- name: page_size
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
description: Number of results to return per page.
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
- name: search
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
description: A search term.
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: source__slug
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaginatedUserOAuthSourceConnectionList'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
/api/v2beta/sources/user_connections/oauth/{id}/:
|
||||||
|
get:
|
||||||
|
operationId: sources_user_connections_oauth_retrieve
|
||||||
|
description: Source Viewset
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User OAuth Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UserOAuthSourceConnection'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
put:
|
||||||
|
operationId: sources_user_connections_oauth_update
|
||||||
|
description: Source Viewset
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User OAuth Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UserOAuthSourceConnectionRequest'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UserOAuthSourceConnectionRequest'
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UserOAuthSourceConnectionRequest'
|
||||||
|
required: true
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UserOAuthSourceConnection'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
patch:
|
||||||
|
operationId: sources_user_connections_oauth_partial_update
|
||||||
|
description: Source Viewset
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User OAuth Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedUserOAuthSourceConnectionRequest'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedUserOAuthSourceConnectionRequest'
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedUserOAuthSourceConnectionRequest'
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UserOAuthSourceConnection'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
delete:
|
||||||
|
operationId: sources_user_connections_oauth_destroy
|
||||||
|
description: Source Viewset
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User OAuth Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'204':
|
||||||
|
description: No response body
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
/api/v2beta/sources/user_connections/oauth/{id}/used_by/:
|
||||||
|
get:
|
||||||
|
operationId: sources_user_connections_oauth_used_by_list
|
||||||
|
description: Get a list of all objects that use this object
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User OAuth Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/UsedBy'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
/api/v2beta/sources/user_connections/plex/:
|
||||||
|
get:
|
||||||
|
operationId: sources_user_connections_plex_list
|
||||||
|
description: Plex Source connection Serializer
|
||||||
|
parameters:
|
||||||
|
- name: ordering
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
description: Which field to use when ordering the results.
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: page
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
description: A page number within the paginated result set.
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
- name: page_size
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
description: Number of results to return per page.
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
- name: search
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
description: A search term.
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: source__slug
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaginatedPlexSourceConnectionList'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
/api/v2beta/sources/user_connections/plex/{id}/:
|
||||||
|
get:
|
||||||
|
operationId: sources_user_connections_plex_retrieve
|
||||||
|
description: Plex Source connection Serializer
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User Plex Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PlexSourceConnection'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
put:
|
||||||
|
operationId: sources_user_connections_plex_update
|
||||||
|
description: Plex Source connection Serializer
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User Plex Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PlexSourceConnectionRequest'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PlexSourceConnectionRequest'
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PlexSourceConnectionRequest'
|
||||||
|
required: true
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PlexSourceConnection'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
patch:
|
||||||
|
operationId: sources_user_connections_plex_partial_update
|
||||||
|
description: Plex Source connection Serializer
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User Plex Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedPlexSourceConnectionRequest'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedPlexSourceConnectionRequest'
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedPlexSourceConnectionRequest'
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PlexSourceConnection'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
delete:
|
||||||
|
operationId: sources_user_connections_plex_destroy
|
||||||
|
description: Plex Source connection Serializer
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User Plex Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'204':
|
||||||
|
description: No response body
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
|
/api/v2beta/sources/user_connections/plex/{id}/used_by/:
|
||||||
|
get:
|
||||||
|
operationId: sources_user_connections_plex_used_by_list
|
||||||
|
description: Get a list of all objects that use this object
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: A unique integer value identifying this User Plex Source Connection.
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- sources
|
||||||
|
security:
|
||||||
|
- authentik: []
|
||||||
|
- cookieAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/UsedBy'
|
||||||
|
description: ''
|
||||||
|
'400':
|
||||||
|
$ref: '#/components/schemas/ValidationError'
|
||||||
|
'403':
|
||||||
|
$ref: '#/components/schemas/GenericError'
|
||||||
/api/v2beta/stages/all/:
|
/api/v2beta/stages/all/:
|
||||||
get:
|
get:
|
||||||
operationId: stages_all_list
|
operationId: stages_all_list
|
||||||
|
@ -24767,6 +24969,41 @@ components:
|
||||||
required:
|
required:
|
||||||
- pagination
|
- pagination
|
||||||
- results
|
- results
|
||||||
|
PaginatedPlexSourceConnectionList:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
pagination:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
next:
|
||||||
|
type: number
|
||||||
|
previous:
|
||||||
|
type: number
|
||||||
|
count:
|
||||||
|
type: number
|
||||||
|
current:
|
||||||
|
type: number
|
||||||
|
total_pages:
|
||||||
|
type: number
|
||||||
|
start_index:
|
||||||
|
type: number
|
||||||
|
end_index:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- next
|
||||||
|
- previous
|
||||||
|
- count
|
||||||
|
- current
|
||||||
|
- total_pages
|
||||||
|
- start_index
|
||||||
|
- end_index
|
||||||
|
results:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/PlexSourceConnection'
|
||||||
|
required:
|
||||||
|
- pagination
|
||||||
|
- results
|
||||||
PaginatedPlexSourceList:
|
PaginatedPlexSourceList:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
@ -27099,6 +27336,19 @@ components:
|
||||||
minimum: -2147483648
|
minimum: -2147483648
|
||||||
description: How many attempts a user has before the flow is canceled. To
|
description: How many attempts a user has before the flow is canceled. To
|
||||||
lock the user out, use a reputation policy and a user_write stage.
|
lock the user out, use a reputation policy and a user_write stage.
|
||||||
|
PatchedPlexSourceConnectionRequest:
|
||||||
|
type: object
|
||||||
|
description: Plex Source connection Serializer
|
||||||
|
properties:
|
||||||
|
user:
|
||||||
|
type: integer
|
||||||
|
source:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
identifier:
|
||||||
|
type: string
|
||||||
|
plex_token:
|
||||||
|
type: string
|
||||||
PatchedPlexSourceRequest:
|
PatchedPlexSourceRequest:
|
||||||
type: object
|
type: object
|
||||||
description: Plex Source Serializer
|
description: Plex Source Serializer
|
||||||
|
@ -27775,6 +28025,47 @@ components:
|
||||||
- slug
|
- slug
|
||||||
- verbose_name
|
- verbose_name
|
||||||
- verbose_name_plural
|
- verbose_name_plural
|
||||||
|
PlexSourceConnection:
|
||||||
|
type: object
|
||||||
|
description: Plex Source connection Serializer
|
||||||
|
properties:
|
||||||
|
pk:
|
||||||
|
type: integer
|
||||||
|
readOnly: true
|
||||||
|
title: ID
|
||||||
|
user:
|
||||||
|
type: integer
|
||||||
|
source:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
identifier:
|
||||||
|
type: string
|
||||||
|
plex_token:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- identifier
|
||||||
|
- pk
|
||||||
|
- plex_token
|
||||||
|
- source
|
||||||
|
- user
|
||||||
|
PlexSourceConnectionRequest:
|
||||||
|
type: object
|
||||||
|
description: Plex Source connection Serializer
|
||||||
|
properties:
|
||||||
|
user:
|
||||||
|
type: integer
|
||||||
|
source:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
identifier:
|
||||||
|
type: string
|
||||||
|
plex_token:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- identifier
|
||||||
|
- plex_token
|
||||||
|
- source
|
||||||
|
- user
|
||||||
PlexSourceRequest:
|
PlexSourceRequest:
|
||||||
type: object
|
type: object
|
||||||
description: Plex Source Serializer
|
description: Plex Source Serializer
|
||||||
|
|
|
@ -21,7 +21,7 @@ export class SourceSettingsOAuth extends BaseUserSettings {
|
||||||
renderInner(): TemplateResult {
|
renderInner(): TemplateResult {
|
||||||
return html`${until(
|
return html`${until(
|
||||||
new SourcesApi(DEFAULT_CONFIG)
|
new SourcesApi(DEFAULT_CONFIG)
|
||||||
.sourcesOauthUserConnectionsList({
|
.sourcesUserConnectionsOauthList({
|
||||||
sourceSlug: this.objectId,
|
sourceSlug: this.objectId,
|
||||||
})
|
})
|
||||||
.then((connection) => {
|
.then((connection) => {
|
||||||
|
@ -32,7 +32,7 @@ export class SourceSettingsOAuth extends BaseUserSettings {
|
||||||
@click=${() => {
|
@click=${() => {
|
||||||
return new SourcesApi(
|
return new SourcesApi(
|
||||||
DEFAULT_CONFIG,
|
DEFAULT_CONFIG,
|
||||||
).sourcesOauthUserConnectionsDestroy({
|
).sourcesUserConnectionsOauthDestroy({
|
||||||
id: connection.results[0].pk || 0,
|
id: connection.results[0].pk || 0,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
|
Reference in a new issue