Browse Source

improve type

pull/2418/head
Bernd Storath 5 months ago
parent
commit
d57e3bb975
  1. 20
      src/server/utils/firewall.ts

20
src/server/utils/firewall.ts

@ -1,6 +1,7 @@
import debug from 'debug'; import debug from 'debug';
import { isIPv6 } from 'is-ip'; import { isIPv6 } from 'is-ip';
import type { ClientType } from '#db/repositories/client/types';
import type { InterfaceType } from '#db/repositories/interface/types'; import type { InterfaceType } from '#db/repositories/interface/types';
import type { UserConfigType } from '#db/repositories/userConfig/types'; import type { UserConfigType } from '#db/repositories/userConfig/types';
@ -20,15 +21,16 @@ type ParsedEntry = {
proto?: 'tcp' | 'udp' | 'both'; proto?: 'tcp' | 'udp' | 'both';
}; };
type FirewallClient = { type FirewallClient = Pick<
id: number; ClientType,
name: string; | 'id'
ipv4Address: string; | 'name'
ipv6Address: string; | 'ipv4Address'
firewallIps: string[] | null; | 'ipv6Address'
allowedIps: string[] | null; | 'allowedIps'
enabled: boolean; | 'firewallIps'
}; | 'enabled'
>;
/** /**
* Sanitize a client identifier for use in an iptables comment. * Sanitize a client identifier for use in an iptables comment.

Loading…
Cancel
Save