Added the openapi security header to all routes that need some kind of auth

ref #6
This commit is contained in:
2020-12-18 20:07:05 +01:00
parent e25fc795fe
commit cdfd0e0d64
8 changed files with 10 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
import csv from 'csvtojson';
import { Body, ContentType, Controller, Param, Post, QueryParam, Req, UseBefore } from 'routing-controllers';
import { Authorized, Body, ContentType, Controller, Param, Post, QueryParam, Req, UseBefore } from 'routing-controllers';
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
import { RunnerGroupNeededError } from '../errors/RunnerErrors';
import { RunnerGroupNotFoundError } from '../errors/RunnerGroupErrors';
@@ -9,7 +9,8 @@ import { ResponseRunner } from '../models/responses/ResponseRunner';
import { RunnerController } from './RunnerController';
@Controller()
//@Authorized("IMPORT:read")
@Authorized(["RUNNER:IMPORT", "TEAM:IMPORT"])
@OpenAPI({ security: [{ "AuthToken": [] }] })
export class ImportController {
private runnerController: RunnerController;