From c94ac75a6fa56aef7bae298299d1678b20d578f7 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Wed, 20 Nov 2024 15:14:34 +0000 Subject: [PATCH] Refactor ClusterKeyAuthorization to use class reference for cluster key retrieval --- .oneuptime/scripts/on-before-commit.sh | 2 +- Common/Server/Middleware/ClusterKeyAuthorization.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.oneuptime/scripts/on-before-commit.sh b/.oneuptime/scripts/on-before-commit.sh index 903e8d4822..ea2ccc6dbc 100644 --- a/.oneuptime/scripts/on-before-commit.sh +++ b/.oneuptime/scripts/on-before-commit.sh @@ -1 +1 @@ -# Description: Copilot will run this script before we commit the changes to your repository. \ No newline at end of file +# Description: Copilot will run this script before we commit the changes to your repository. diff --git a/Common/Server/Middleware/ClusterKeyAuthorization.ts b/Common/Server/Middleware/ClusterKeyAuthorization.ts index 445538fb6a..acb24ff16b 100644 --- a/Common/Server/Middleware/ClusterKeyAuthorization.ts +++ b/Common/Server/Middleware/ClusterKeyAuthorization.ts @@ -11,7 +11,7 @@ import BadDataException from "Common/Types/Exception/BadDataException"; export default class ClusterKeyAuthorization { public static getClusterKeyHeaders(): Dictionary { return { - clusterkey: this.getClusterKey(), + clusterkey: ClusterKeyAuthorization.getClusterKey(), }; } @@ -44,7 +44,7 @@ export default class ClusterKeyAuthorization { } const isAuthorized: boolean = - clusterKey.toString() === this.getClusterKey(); + clusterKey.toString() === ClusterKeyAuthorization.getClusterKey(); if (!isAuthorized) { return Response.sendErrorResponse(