fix "network" property in allowedPrivateNetworks

This commit is contained in:
Hazelnoot 2025-05-13 22:24:48 -04:00
parent ebd4ccdd55
commit e914be3694

View file

@ -154,7 +154,7 @@ type Source = {
} }
}; };
export type PrivateNetworkSource = string | { ip?: string, ports?: number[] }; export type PrivateNetworkSource = string | { network?: string, ports?: number[] };
export type PrivateNetwork = { export type PrivateNetwork = {
/** /**
@ -184,8 +184,8 @@ export function parsePrivateNetworks(patterns: PrivateNetworkSource[] | undefine
if (cidr) { if (cidr) {
return { cidr } satisfies PrivateNetwork; return { cidr } satisfies PrivateNetwork;
} }
} else if (e.ip) { } else if (e.network) {
const cidr = parseIpOrMask(e.ip); const cidr = parseIpOrMask(e.network);
if (cidr) { if (cidr) {
return { cidr, ports: e.ports } satisfies PrivateNetwork; return { cidr, ports: e.ports } satisfies PrivateNetwork;
} }