diff --git a/test/index.ts b/test/index.ts index 914025b..e8ff942 100644 --- a/test/index.ts +++ b/test/index.ts @@ -17,27 +17,24 @@ const api = new Server({ enabled: true, folder: './routes', context: context, - security: { - authentication: { - enabled: true, - methods: { - loggedIn: () => undefined, - hasPermission, - needsBot: () => undefined, - cumInAssable: () => undefined, + middleware: { + global: [ + { + name: 'test', + when: 'precors', + handle: async (req, res, next) => { + console.log('this is before anything ever happens!'); + next(); + }, }, + ], + local: { + loggedIn: () => undefined, + hasPermission, + needsBot: () => undefined, + cumInAssable: () => undefined, }, }, - middleware: [ - { - name: 'test', - when: 'precors', - handle: async (req, res, next) => { - console.log('this is before anything ever happens!'); - next(); - }, - }, - ], documentation: { enabled: true, open_api: { diff --git a/test/routes/get.ts b/test/routes/get.ts index 259af4d..6f3c527 100644 --- a/test/routes/get.ts +++ b/test/routes/get.ts @@ -8,14 +8,12 @@ export const configuration: RouteConfig = { public: false, operationId: 'api_root', }, - security: { - authentication: [ - 'loggedIn', - authenticationMethod('hasPermission', { where: (req) => req.query.any as string }), - { - method: 'cumInAssable', - data: 'anything', - }, - ], - }, + middleware: [ + 'loggedIn', + authenticationMethod('hasPermission', { where: (req) => req.query.any as string }), + { + method: 'cumInAssable', + data: 'anything', + }, + ], };