mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Refactor ClusterKeyAuthorization to use class reference for cluster key retrieval
This commit is contained in:
@@ -1 +1 @@
|
||||
# Description: Copilot will run this script before we commit the changes to your repository.
|
||||
# Description: Copilot will run this script before we commit the changes to your repository.
|
||||
|
||||
@@ -11,7 +11,7 @@ import BadDataException from "Common/Types/Exception/BadDataException";
|
||||
export default class ClusterKeyAuthorization {
|
||||
public static getClusterKeyHeaders(): Dictionary<string> {
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user