Added auth to openapi spec

ref #26
This commit is contained in:
Nicolai Ort 2021-02-13 16:24:47 +01:00
parent 454309278e
commit 729f2d7240
2 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,14 @@ export function generateSpec(storage: MetadataArgsStorage, schemas) {
{
components: {
schemas,
"securitySchemes": {
"AuthToken": {
"type": "apiKey",
"in": "query",
"name": "key",
description: "A simple api key. See the README's env section for more details."
}
}
},
info: {
description: "The the API for the LfK! document server.",

View File

@ -11,6 +11,7 @@ import { PdfCreator } from '../PdfCreator';
*/
@JsonController()
@Authorized()
@OpenAPI({ security: [{ "AuthToken": [] }] })
export class PdfController {
private pdf: PdfCreator = new PdfCreator();
private initialized: boolean = false;