From 12f09f80d8e9d8d4fda24a125fa321baaafce012 Mon Sep 17 00:00:00 2001 From: Rudra deep Biswas Date: Tue, 6 May 2025 16:38:13 +0530 Subject: [PATCH] review --- .../apps-import-export.util.service.ts | 1 - .../guards/external-api-security.guard.ts | 20 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 server/src/modules/apps/util-services/apps-import-export.util.service.ts diff --git a/server/src/modules/apps/util-services/apps-import-export.util.service.ts b/server/src/modules/apps/util-services/apps-import-export.util.service.ts deleted file mode 100644 index 383ade1537..0000000000 --- a/server/src/modules/apps/util-services/apps-import-export.util.service.ts +++ /dev/null @@ -1 +0,0 @@ -//to do ? idk diff --git a/server/src/modules/auth/guards/external-api-security.guard.ts b/server/src/modules/auth/guards/external-api-security.guard.ts index 30918b232b..19b0d197a4 100644 --- a/server/src/modules/auth/guards/external-api-security.guard.ts +++ b/server/src/modules/auth/guards/external-api-security.guard.ts @@ -9,18 +9,18 @@ export class ExternalApiSecurityGuard implements CanActivate { const request = context.switchToHttp().getRequest(); // // Check if external API is enabled - // const isExternalApiEnabled = this.configService.get('ENABLE_EXTERNAL_API') === 'true'; - // if (!isExternalApiEnabled) { - // throw new ForbiddenException('External API is disabled'); - // } + const isExternalApiEnabled = this.configService.get('ENABLE_EXTERNAL_API') === 'true'; + if (!isExternalApiEnabled) { + throw new ForbiddenException('External API is disabled'); + } - // // // Check the authorization header - // const authHeader = request.headers['authorization']; - // const externalApiAccessToken = this.configService.get('EXTERNAL_API_ACCESS_TOKEN'); + // // Check the authorization header + const authHeader = request.headers['authorization']; + const externalApiAccessToken = this.configService.get('EXTERNAL_API_ACCESS_TOKEN'); - // if (!authHeader || authHeader !== `Basic ${externalApiAccessToken}`) { - // throw new ForbiddenException('Unauthorized'); - // } + if (!authHeader || authHeader !== `Basic ${externalApiAccessToken}`) { + throw new ForbiddenException('Unauthorized'); + } return true; }