From 29f98abd0046857bf327ed3e93c3183c49fb8398 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 16 Dec 2020 23:32:14 +0100 Subject: [PATCH] root: update swagger --- authentik/admin/tests/test_api.py | 15 +- swagger.yaml | 341 +++++++++++++++--- .../pages/admin-overview/AdminOverviewPage.ts | 2 +- 3 files changed, 302 insertions(+), 56 deletions(-) diff --git a/authentik/admin/tests/test_api.py b/authentik/admin/tests/test_api.py index ae0f0ab68..fbcf762f1 100644 --- a/authentik/admin/tests/test_api.py +++ b/authentik/admin/tests/test_api.py @@ -19,12 +19,19 @@ class TestAdminAPI(TestCase): self.group.save() self.client.force_login(self.user) - def test_overview(self): - """Test Overview API""" - response = self.client.get(reverse("authentik_api:admin_overview-list")) + def test_version(self): + """Test Version API""" + response = self.client.get(reverse("authentik_api:admin_version-list")) self.assertEqual(response.status_code, 200) body = loads(response.content) - self.assertEqual(body["version"], __version__) + self.assertEqual(body["version_current"], __version__) + + def test_workers(self): + """Test Workers API""" + response = self.client.get(reverse("authentik_api:admin_workers-list")) + self.assertEqual(response.status_code, 200) + body = loads(response.content) + self.assertEqual(body["pagination"]["count"], 0) def test_metrics(self): """Test metrics API""" diff --git a/swagger.yaml b/swagger.yaml index 3cd08237b..f19460c08 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -22,11 +22,11 @@ paths: /admin/metrics/: get: operationId: admin_metrics_list - description: Return single instance of AdministrationMetricsSerializer + description: Login Metrics per 1h parameters: [] responses: '200': - description: Overview View + description: Login Metrics per 1h schema: description: '' type: array @@ -35,22 +35,6 @@ paths: tags: - admin parameters: [] - /admin/overview/: - get: - operationId: admin_overview_list - description: Return single instance of AdministrationOverviewSerializer - parameters: [] - responses: - '200': - description: Overview View - schema: - description: '' - type: array - items: - $ref: '#/definitions/AdministrationOverview' - tags: - - admin - parameters: [] /admin/system_tasks/: get: operationId: admin_system_tasks_list @@ -82,6 +66,95 @@ paths: in: path required: true type: string + /admin/version/: + get: + operationId: admin_version_list + description: Get running and latest version. + parameters: + - name: ordering + in: query + description: Which field to use when ordering the results. + required: false + type: string + - name: search + in: query + description: A search term. + required: false + type: string + - name: page + in: query + description: A page number within the paginated result set. + required: false + type: integer + - name: page_size + in: query + description: Number of results to return per page. + required: false + type: integer + responses: + '200': + description: Get running and latest version. + schema: + description: '' + type: array + items: + $ref: '#/definitions/Version' + tags: + - admin + parameters: [] + /admin/workers/: + get: + operationId: admin_workers_list + description: Get currently connected worker count. + parameters: + - name: ordering + in: query + description: Which field to use when ordering the results. + required: false + type: string + - name: search + in: query + description: A search term. + required: false + type: string + - name: page + in: query + description: A page number within the paginated result set. + required: false + type: integer + - name: page_size + in: query + description: Number of results to return per page. + required: false + type: integer + responses: + '200': + description: '' + schema: + required: + - count + - results + type: object + properties: + count: + type: integer + next: + type: string + format: uri + x-nullable: true + previous: + type: string + format: uri + x-nullable: true + results: + type: array + items: + description: '' + type: object + properties: {} + tags: + - admin + parameters: [] /audit/events/: get: operationId: audit_events_list @@ -1062,6 +1135,59 @@ paths: required: true type: string format: uuid + /flows/cached/: + get: + operationId: flows_cached_list + description: Info about cached flows + parameters: + - name: ordering + in: query + description: Which field to use when ordering the results. + required: false + type: string + - name: search + in: query + description: A search term. + required: false + type: string + - name: page + in: query + description: A page number within the paginated result set. + required: false + type: integer + - name: page_size + in: query + description: Number of results to return per page. + required: false + type: integer + responses: + '200': + description: '' + schema: + required: + - count + - results + type: object + properties: + count: + type: integer + next: + type: string + format: uri + x-nullable: true + previous: + type: string + format: uri + x-nullable: true + results: + type: array + items: + description: '' + type: object + properties: {} + tags: + - flows + parameters: [] /flows/instances/: get: operationId: flows_instances_list @@ -1702,6 +1828,16 @@ paths: operationId: policies_all_list description: Policy Viewset parameters: + - name: bindings__isnull + in: query + description: '' + required: false + type: string + - name: promptstage__isnull + in: query + description: '' + required: false + type: string - name: ordering in: query description: Which field to use when ordering the results. @@ -1919,6 +2055,59 @@ paths: required: true type: string format: uuid + /policies/cached/: + get: + operationId: policies_cached_list + description: Info about cached policies + parameters: + - name: ordering + in: query + description: Which field to use when ordering the results. + required: false + type: string + - name: search + in: query + description: A search term. + required: false + type: string + - name: page + in: query + description: A page number within the paginated result set. + required: false + type: integer + - name: page_size + in: query + description: Number of results to return per page. + required: false + type: integer + responses: + '200': + description: '' + schema: + required: + - count + - results + type: object + properties: + count: + type: integer + next: + type: string + format: uri + x-nullable: true + previous: + type: string + format: uri + x-nullable: true + results: + type: array + items: + description: '' + type: object + properties: {} + tags: + - policies + parameters: [] /policies/dummy/: get: operationId: policies_dummy_list @@ -3264,6 +3453,11 @@ paths: operationId: providers_all_list description: Provider Viewset parameters: + - name: application__isnull + in: query + description: '' + required: false + type: string - name: ordering in: query description: Which field to use when ordering the results. @@ -3309,6 +3503,22 @@ paths: $ref: '#/definitions/Provider' tags: - providers + post: + operationId: providers_all_create + description: Provider Viewset + parameters: + - name: data + in: body + required: true + schema: + $ref: '#/definitions/Provider' + responses: + '201': + description: '' + schema: + $ref: '#/definitions/Provider' + tags: + - providers parameters: [] /providers/all/{id}/: get: @@ -3322,6 +3532,47 @@ paths: $ref: '#/definitions/Provider' tags: - providers + put: + operationId: providers_all_update + description: Provider Viewset + parameters: + - name: data + in: body + required: true + schema: + $ref: '#/definitions/Provider' + responses: + '200': + description: '' + schema: + $ref: '#/definitions/Provider' + tags: + - providers + patch: + operationId: providers_all_partial_update + description: Provider Viewset + parameters: + - name: data + in: body + required: true + schema: + $ref: '#/definitions/Provider' + responses: + '200': + description: '' + schema: + $ref: '#/definitions/Provider' + tags: + - providers + delete: + operationId: providers_all_delete + description: Provider Viewset + parameters: [] + responses: + '204': + description: '' + tags: + - providers parameters: - name: id in: path @@ -6421,7 +6672,7 @@ paths: format: uuid definitions: AdministrationMetrics: - description: Overview View + description: Login Metrics per 1h type: object properties: logins_per_1h: @@ -6432,38 +6683,6 @@ definitions: title: Logins failed per 1h type: string readOnly: true - AdministrationOverview: - description: Overview View - type: object - properties: - version: - title: Version - type: string - readOnly: true - version_latest: - title: Version latest - type: string - readOnly: true - worker_count: - title: Worker count - type: integer - readOnly: true - providers_without_application: - title: Providers without application - type: integer - readOnly: true - policies_without_binding: - title: Policies without binding - type: integer - readOnly: true - cached_policies: - title: Cached policies - type: integer - readOnly: true - cached_flows: - title: Cached flows - type: integer - readOnly: true Task: description: Serialize TaskInfo and TaskResult required: @@ -6494,6 +6713,22 @@ definitions: type: array items: type: string + Version: + description: Get running and latest version. + type: object + properties: + version_current: + title: Version current + type: string + readOnly: true + version_latest: + title: Version latest + type: string + readOnly: true + outdated: + title: Outdated + type: boolean + readOnly: true Event: description: Event Serializer required: @@ -7480,6 +7715,7 @@ definitions: description: Provider Serializer required: - name + - application - authorization_flow type: object properties: @@ -7491,6 +7727,9 @@ definitions: title: Name type: string minLength: 1 + application: + title: Application + type: string authorization_flow: title: Authorization flow description: Flow used when authorizing this provider. diff --git a/web/src/pages/admin-overview/AdminOverviewPage.ts b/web/src/pages/admin-overview/AdminOverviewPage.ts index 222da610e..3f0754a62 100644 --- a/web/src/pages/admin-overview/AdminOverviewPage.ts +++ b/web/src/pages/admin-overview/AdminOverviewPage.ts @@ -42,7 +42,7 @@ export class AdminOverviewPage extends LitElement { - +