From d38fd603dd47d3b030b1abb53bdf66ca2fc1211e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 16 May 2021 18:38:19 +0200 Subject: [PATCH] web: fix more special API Calls Signed-off-by: Jens Langhammer --- authentik/api/v2/urls.py | 1 - schema.yml | 242 ------------------ .../charts/OutpostStatusChart.ts | 2 +- web/src/pages/events/TransportListPage.ts | 2 +- web/src/pages/flows/FlowDiagram.ts | 2 +- web/src/pages/flows/FlowImportForm.ts | 2 +- web/src/pages/flows/FlowListPage.ts | 2 +- web/src/pages/flows/FlowViewPage.ts | 2 +- web/src/pages/groups/GroupForm.ts | 6 +- web/src/pages/outposts/OutpostForm.ts | 6 +- web/src/pages/outposts/OutpostHealth.ts | 2 +- web/src/pages/outposts/OutpostListPage.ts | 4 +- .../outposts/ServiceConnectionListPage.ts | 4 +- .../event_matcher/EventMatcherPolicyForm.ts | 2 +- .../PropertyMappingListPage.ts | 4 +- .../oauth2/OAuth2ProviderViewPage.ts | 2 +- web/src/pages/sources/SourcesListPage.ts | 2 +- .../pages/sources/oauth/OAuthSourceForm.ts | 2 +- web/src/pages/stages/email/EmailStageForm.ts | 4 +- 19 files changed, 25 insertions(+), 268 deletions(-) diff --git a/authentik/api/v2/urls.py b/authentik/api/v2/urls.py index b9a43be1e..9517bd879 100644 --- a/authentik/api/v2/urls.py +++ b/authentik/api/v2/urls.py @@ -107,7 +107,6 @@ router.register("core/users", UserViewSet) router.register("core/user_consent", UserConsentViewSet) router.register("core/tokens", TokenViewSet) -router.register("outposts/outposts", OutpostViewSet) router.register("outposts/instances", OutpostViewSet) router.register("outposts/service_connections/all", ServiceConnectionViewSet) router.register("outposts/service_connections/docker", DockerServiceConnectionViewSet) diff --git a/schema.yml b/schema.yml index 749e05217..6cb8a97dd 100644 --- a/schema.yml +++ b/schema.yml @@ -4061,248 +4061,6 @@ paths: schema: $ref: '#/components/schemas/LDAPOutpostConfig' description: '' - /api/v2beta/outposts/outposts/: - get: - operationId: outposts_outposts_list - description: Outpost 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 - - in: query - name: providers__isnull - schema: - type: boolean - - name: search - required: false - in: query - description: A search term. - schema: - type: string - tags: - - outposts - security: - - authentik: [] - - cookieAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedOutpostList' - description: '' - post: - operationId: outposts_outposts_create - description: Outpost Viewset - tags: - - outposts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OutpostRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/OutpostRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/OutpostRequest' - required: true - security: - - authentik: [] - - cookieAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Outpost' - description: '' - /api/v2beta/outposts/outposts/{uuid}/: - get: - operationId: outposts_outposts_retrieve - description: Outpost Viewset - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - description: A UUID string identifying this outpost. - required: true - tags: - - outposts - security: - - authentik: [] - - cookieAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Outpost' - description: '' - put: - operationId: outposts_outposts_update - description: Outpost Viewset - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - description: A UUID string identifying this outpost. - required: true - tags: - - outposts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OutpostRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/OutpostRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/OutpostRequest' - required: true - security: - - authentik: [] - - cookieAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Outpost' - description: '' - patch: - operationId: outposts_outposts_partial_update - description: Outpost Viewset - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - description: A UUID string identifying this outpost. - required: true - tags: - - outposts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedOutpostRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedOutpostRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedOutpostRequest' - security: - - authentik: [] - - cookieAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Outpost' - description: '' - delete: - operationId: outposts_outposts_destroy - description: Outpost Viewset - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - description: A UUID string identifying this outpost. - required: true - tags: - - outposts - security: - - authentik: [] - - cookieAuth: [] - responses: - '204': - description: No response body - /api/v2beta/outposts/outposts/{uuid}/health/: - get: - operationId: outposts_outposts_health_list - description: Get outposts current health - parameters: - - name: ordering - required: false - in: query - description: Which field to use when ordering the results. - schema: - type: string - - in: query - name: providers__isnull - schema: - type: boolean - - name: search - required: false - in: query - description: A search term. - schema: - type: string - - in: path - name: uuid - schema: - type: string - format: uuid - description: A UUID string identifying this outpost. - required: true - tags: - - outposts - security: - - authentik: [] - - cookieAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/OutpostHealth' - description: '' - /api/v2beta/outposts/outposts/default_settings/: - get: - operationId: outposts_outposts_default_settings_retrieve - description: Global default outpost config - tags: - - outposts - security: - - authentik: [] - - cookieAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OutpostDefaultConfig' - description: '' /api/v2beta/outposts/proxy/: get: operationId: outposts_proxy_list diff --git a/web/src/pages/admin-overview/charts/OutpostStatusChart.ts b/web/src/pages/admin-overview/charts/OutpostStatusChart.ts index 1168a62d0..de8681f6f 100644 --- a/web/src/pages/admin-overview/charts/OutpostStatusChart.ts +++ b/web/src/pages/admin-overview/charts/OutpostStatusChart.ts @@ -37,7 +37,7 @@ export class OutpostStatusChart extends AKChart { let outdated = 0; let unhealthy = 0; await Promise.all(outposts.results.map(async (element) => { - const health = await api.outpostsOutpostsHealthList({ + const health = await api.outpostsInstancesHealthList({ uuid: element.pk || "", }); if (health.length === 0) { diff --git a/web/src/pages/events/TransportListPage.ts b/web/src/pages/events/TransportListPage.ts index 870149347..5a45546f1 100644 --- a/web/src/pages/events/TransportListPage.ts +++ b/web/src/pages/events/TransportListPage.ts @@ -55,7 +55,7 @@ export class TransportListPage extends TablePage { html` { - return new EventsApi(DEFAULT_CONFIG).eventsTransportsTest({ + return new EventsApi(DEFAULT_CONFIG).eventsTransportsTestCreate({ uuid: item.pk || "", }); }}> diff --git a/web/src/pages/flows/FlowDiagram.ts b/web/src/pages/flows/FlowDiagram.ts index b6970b061..eceea91ea 100644 --- a/web/src/pages/flows/FlowDiagram.ts +++ b/web/src/pages/flows/FlowDiagram.ts @@ -18,7 +18,7 @@ export class FlowDiagram extends LitElement { @property() set flowSlug(value: string) { this._flowSlug = value; - new FlowsApi(DEFAULT_CONFIG).flowsInstancesDiagram({ + new FlowsApi(DEFAULT_CONFIG).flowsInstancesDiagramRetrieve({ slug: value, }).then((data) => { this.diagram = FlowChart.parse(data.diagram || ""); diff --git a/web/src/pages/flows/FlowImportForm.ts b/web/src/pages/flows/FlowImportForm.ts index 9b35f5646..7e14c3f71 100644 --- a/web/src/pages/flows/FlowImportForm.ts +++ b/web/src/pages/flows/FlowImportForm.ts @@ -19,7 +19,7 @@ export class FlowImportForm extends Form { if (!file) { throw new Error("No form data"); } - return new FlowsApi(DEFAULT_CONFIG).flowsInstancesImportFlow({ + return new FlowsApi(DEFAULT_CONFIG).flowsInstancesImportFlowCreate({ file: file }); }; diff --git a/web/src/pages/flows/FlowListPage.ts b/web/src/pages/flows/FlowListPage.ts index 741097e25..64066c1bb 100644 --- a/web/src/pages/flows/FlowListPage.ts +++ b/web/src/pages/flows/FlowListPage.ts @@ -89,7 +89,7 @@ export class FlowListPage extends TablePage {