fix(FN-4871): reject empty bearer/apiKey on inbound sync
Fusion-Task-Id: FN-4871 Fusion-Task-Lineage: afa2af88-9c7d-4809-bf8f-2aa6cf79ce40
This commit is contained in:
committed by
gsxdsm
parent
6aee8923db
commit
1ea7a93aa4
@@ -36,6 +36,14 @@ export const registerSettingsSyncInboundRoutes: ApiRouteRegistrar = (ctx) => {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Local node not configured");
|
||||
}
|
||||
if (token.length === 0) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Missing or invalid Authorization header");
|
||||
}
|
||||
if (!localNode.apiKey) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Invalid apiKey");
|
||||
}
|
||||
if (localNode.apiKey !== token) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Invalid apiKey");
|
||||
@@ -105,6 +113,14 @@ export const registerSettingsSyncInboundRoutes: ApiRouteRegistrar = (ctx) => {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Local node not configured");
|
||||
}
|
||||
if (token.length === 0) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Missing or invalid Authorization header");
|
||||
}
|
||||
if (!localNode.apiKey) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Invalid apiKey");
|
||||
}
|
||||
if (localNode.apiKey !== token) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Invalid apiKey");
|
||||
@@ -194,6 +210,14 @@ export const registerSettingsSyncInboundRoutes: ApiRouteRegistrar = (ctx) => {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Local node not configured");
|
||||
}
|
||||
if (token.length === 0) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Missing or invalid Authorization header");
|
||||
}
|
||||
if (!localNode.apiKey) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Invalid apiKey");
|
||||
}
|
||||
if (localNode.apiKey !== token) {
|
||||
await central.close();
|
||||
throw new ApiError(401, "Invalid apiKey");
|
||||
|
||||
Reference in New Issue
Block a user