From 75bfdfcee17bffa938ddd2e41b00a73267ee9a15 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 28 Oct 2024 23:45:15 +0530 Subject: [PATCH] feat: x-api-key security --- server/src/swagger/config.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/src/swagger/config.ts b/server/src/swagger/config.ts index d32a68fc..6c15d9d0 100644 --- a/server/src/swagger/config.ts +++ b/server/src/swagger/config.ts @@ -9,6 +9,21 @@ const options = { version: '1.0.0', description: 'API documentation for robot management', }, + components: { + securitySchemes: { + ApiKeyAuth: { + type: 'apiKey', + in: 'header', + name: 'x-api-key', + description: 'API key for authorization. You can find your API key in the "API Key" section on Maxun Dashboard.', + }, + }, + }, + security: [ + { + ApiKeyAuth: [], // Apply this security scheme globally + }, + ], }, apis: [path.join(__dirname, '../api/*.ts')], };