fix(gateway): resolve CI TypeScript errors and address review feedback
This commit is contained in:
parent
dfce4052dc
commit
cb4d03bb86
@ -203,8 +203,9 @@ export function isNodeCommandAllowed(params: {
|
||||
if (!params.allowlist.has(command)) {
|
||||
return { ok: false, reason: "command not allowlisted" };
|
||||
}
|
||||
if (Array.isArray(params.declaredCommands) && params.declaredCommands.length > 0) {
|
||||
if (!params.declaredCommands.includes(command)) {
|
||||
const { declaredCommands } = params;
|
||||
if (Array.isArray(declaredCommands) && declaredCommands.length > 0) {
|
||||
if (!declaredCommands.includes(command)) {
|
||||
return { ok: false, reason: "command not declared by node" };
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -1003,15 +1003,16 @@ export const nodeHandlers: GatewayRequestHandlers = {
|
||||
`node wake done node=${nodeId} req=${wakeReqId} connected=true totalMs=${totalDurationMs}`,
|
||||
);
|
||||
}
|
||||
const session = nodeSession;
|
||||
const cfg = loadConfig();
|
||||
const allowlist = resolveNodeCommandAllowlist(cfg, nodeSession);
|
||||
const allowlist = resolveNodeCommandAllowlist(cfg, session);
|
||||
const allowed = isNodeCommandAllowed({
|
||||
command,
|
||||
declaredCommands: nodeSession.commands,
|
||||
declaredCommands: session.commands,
|
||||
allowlist,
|
||||
});
|
||||
if (!allowed.ok) {
|
||||
const hint = buildNodeCommandRejectionHint(allowed.reason, command, nodeSession);
|
||||
const hint = buildNodeCommandRejectionHint(allowed.reason, command, session);
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
|
||||
@ -123,7 +123,7 @@ export function ensureGlobalUndiciStreamTimeouts(opts?: { timeoutMs?: number }):
|
||||
const connect = resolveConnectOptions(autoSelectFamily);
|
||||
try {
|
||||
if (kind === "env-proxy") {
|
||||
const proxyConnect = { keepAlive: false, ...connect };
|
||||
const proxyConnect = { ...connect, keepAlive: false };
|
||||
const proxyOptions = {
|
||||
bodyTimeout: timeoutMs,
|
||||
headersTimeout: timeoutMs,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user