root: update swagger

This commit is contained in:
Jens Langhammer 2020-12-16 23:32:14 +01:00
parent 7b5ce4e98a
commit 29f98abd00
3 changed files with 302 additions and 56 deletions

View File

@ -19,12 +19,19 @@ class TestAdminAPI(TestCase):
self.group.save() self.group.save()
self.client.force_login(self.user) self.client.force_login(self.user)
def test_overview(self): def test_version(self):
"""Test Overview API""" """Test Version API"""
response = self.client.get(reverse("authentik_api:admin_overview-list")) response = self.client.get(reverse("authentik_api:admin_version-list"))
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
body = loads(response.content) 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): def test_metrics(self):
"""Test metrics API""" """Test metrics API"""

View File

@ -22,11 +22,11 @@ paths:
/admin/metrics/: /admin/metrics/:
get: get:
operationId: admin_metrics_list operationId: admin_metrics_list
description: Return single instance of AdministrationMetricsSerializer description: Login Metrics per 1h
parameters: [] parameters: []
responses: responses:
'200': '200':
description: Overview View description: Login Metrics per 1h
schema: schema:
description: '' description: ''
type: array type: array
@ -35,22 +35,6 @@ paths:
tags: tags:
- admin - admin
parameters: [] 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/: /admin/system_tasks/:
get: get:
operationId: admin_system_tasks_list operationId: admin_system_tasks_list
@ -82,6 +66,95 @@ paths:
in: path in: path
required: true required: true
type: string 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/: /audit/events/:
get: get:
operationId: audit_events_list operationId: audit_events_list
@ -1062,6 +1135,59 @@ paths:
required: true required: true
type: string type: string
format: uuid 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/: /flows/instances/:
get: get:
operationId: flows_instances_list operationId: flows_instances_list
@ -1702,6 +1828,16 @@ paths:
operationId: policies_all_list operationId: policies_all_list
description: Policy Viewset description: Policy Viewset
parameters: parameters:
- name: bindings__isnull
in: query
description: ''
required: false
type: string
- name: promptstage__isnull
in: query
description: ''
required: false
type: string
- name: ordering - name: ordering
in: query in: query
description: Which field to use when ordering the results. description: Which field to use when ordering the results.
@ -1919,6 +2055,59 @@ paths:
required: true required: true
type: string type: string
format: uuid 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/: /policies/dummy/:
get: get:
operationId: policies_dummy_list operationId: policies_dummy_list
@ -3264,6 +3453,11 @@ paths:
operationId: providers_all_list operationId: providers_all_list
description: Provider Viewset description: Provider Viewset
parameters: parameters:
- name: application__isnull
in: query
description: ''
required: false
type: string
- name: ordering - name: ordering
in: query in: query
description: Which field to use when ordering the results. description: Which field to use when ordering the results.
@ -3309,6 +3503,22 @@ paths:
$ref: '#/definitions/Provider' $ref: '#/definitions/Provider'
tags: tags:
- providers - 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: [] parameters: []
/providers/all/{id}/: /providers/all/{id}/:
get: get:
@ -3322,6 +3532,47 @@ paths:
$ref: '#/definitions/Provider' $ref: '#/definitions/Provider'
tags: tags:
- providers - 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: parameters:
- name: id - name: id
in: path in: path
@ -6421,7 +6672,7 @@ paths:
format: uuid format: uuid
definitions: definitions:
AdministrationMetrics: AdministrationMetrics:
description: Overview View description: Login Metrics per 1h
type: object type: object
properties: properties:
logins_per_1h: logins_per_1h:
@ -6432,38 +6683,6 @@ definitions:
title: Logins failed per 1h title: Logins failed per 1h
type: string type: string
readOnly: true 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: Task:
description: Serialize TaskInfo and TaskResult description: Serialize TaskInfo and TaskResult
required: required:
@ -6494,6 +6713,22 @@ definitions:
type: array type: array
items: items:
type: string 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: Event:
description: Event Serializer description: Event Serializer
required: required:
@ -7480,6 +7715,7 @@ definitions:
description: Provider Serializer description: Provider Serializer
required: required:
- name - name
- application
- authorization_flow - authorization_flow
type: object type: object
properties: properties:
@ -7491,6 +7727,9 @@ definitions:
title: Name title: Name
type: string type: string
minLength: 1 minLength: 1
application:
title: Application
type: string
authorization_flow: authorization_flow:
title: Authorization flow title: Authorization flow
description: Flow used when authorizing this provider. description: Flow used when authorizing this provider.

View File

@ -42,7 +42,7 @@ export class AdminOverviewPage extends LitElement {
</ak-admin-status-card-policy-unbound> </ak-admin-status-card-policy-unbound>
<ak-admin-status-card-user-count class="pf-l-gallery__item pf-m-4-col" icon="pf-icon pf-icon-user" header="Users" headerLink="#/administration/users/"> <ak-admin-status-card-user-count class="pf-l-gallery__item pf-m-4-col" icon="pf-icon pf-icon-user" header="Users" headerLink="#/administration/users/">
</ak-admin-status-card-user-count> </ak-admin-status-card-user-count>
<ak-admin-status-version class="pf-l-gallery__item pf-m-4-col" icon="pf-icon pf-icon-bundle" header="Version"> <ak-admin-status-version class="pf-l-gallery__item pf-m-4-col" icon="pf-icon pf-icon-bundle" header="Version" headerLink="https://github.com/BeryJu/authentik/releases">
</ak-admin-status-version> </ak-admin-status-version>
<ak-admin-status-card-workers class="pf-l-gallery__item pf-m-4-col" icon="pf-icon pf-icon-server" header="Workers"> <ak-admin-status-card-workers class="pf-l-gallery__item pf-m-4-col" icon="pf-icon pf-icon-server" header="Workers">
</ak-admin-status-card-workers> </ak-admin-status-card-workers>