@push.rocks/smartvpn 1.12.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartvpn',
6
- version: '1.12.0',
6
+ version: '1.14.0',
7
7
  description: 'A VPN solution with TypeScript control plane and Rust data plane daemon'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxzQkFBc0I7SUFDNUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHlFQUF5RTtDQUN2RixDQUFBIn0=
@@ -46,6 +46,8 @@ export interface IVpnClientConfig {
46
46
  wgEndpoint?: string;
47
47
  /** WireGuard: allowed IPs (CIDR strings, e.g. ['0.0.0.0/0']) */
48
48
  wgAllowedIps?: string[];
49
+ /** Client-defined tags reported to the server after connection (informational, not for access control) */
50
+ clientDefinedClientTags?: string[];
49
51
  }
50
52
  export interface IVpnClientOptions {
51
53
  transport: TVpnTransportOptions;
@@ -106,6 +108,26 @@ export interface IVpnServerConfig {
106
108
  * tunnel IP as the source address. This allows downstream services (e.g. SmartProxy)
107
109
  * to see the real VPN client identity instead of 127.0.0.1. */
108
110
  socketForwardProxyProtocol?: boolean;
111
+ /** Destination routing policy for VPN client traffic (socket mode).
112
+ * Controls where decrypted traffic goes: allow through, block, or redirect to a target.
113
+ * Default: all traffic passes through (backward compatible). */
114
+ destinationPolicy?: IDestinationPolicy;
115
+ }
116
+ /**
117
+ * Destination routing policy for VPN client traffic.
118
+ * Evaluated per-packet in the NAT engine before per-client ACLs.
119
+ */
120
+ export interface IDestinationPolicy {
121
+ /** Default action for traffic not matching allow/block lists */
122
+ default: 'forceTarget' | 'block' | 'allow';
123
+ /** Target IP address for 'forceTarget' mode (e.g. '127.0.0.1'). Required when default is 'forceTarget'. */
124
+ target?: string;
125
+ /** Destinations that pass through directly — not rewritten, not blocked.
126
+ * Supports: exact IP, CIDR, wildcards (192.168.190.*), ranges. */
127
+ allowList?: string[];
128
+ /** Destinations that are always blocked. Overrides allowList (deny wins).
129
+ * Supports: exact IP, CIDR, wildcards, ranges. */
130
+ blockList?: string[];
109
131
  }
110
132
  export interface IVpnServerOptions {
111
133
  transport: TVpnTransportOptions;
@@ -233,7 +255,11 @@ export interface IClientEntry {
233
255
  priority?: number;
234
256
  /** Whether this client is enabled (default: true) */
235
257
  enabled?: boolean;
236
- /** Tags for grouping (e.g. ["engineering", "office"]) */
258
+ /** Tags assigned by the server admin — trusted, used for access control (e.g. ["engineering", "office"]) */
259
+ serverDefinedClientTags?: string[];
260
+ /** Tags reported by the connecting client — informational only, never used for access control */
261
+ clientDefinedClientTags?: string[];
262
+ /** @deprecated Use serverDefinedClientTags instead. Legacy field kept for backward compatibility. */
237
263
  tags?: string[];
238
264
  /** Optional description */
239
265
  description?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@push.rocks/smartvpn",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "private": false,
5
5
  "description": "A VPN solution with TypeScript control plane and Rust data plane daemon",
6
6
  "type": "module",
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartvpn',
6
- version: '1.12.0',
6
+ version: '1.14.0',
7
7
  description: 'A VPN solution with TypeScript control plane and Rust data plane daemon'
8
8
  }
@@ -57,6 +57,8 @@ export interface IVpnClientConfig {
57
57
  wgEndpoint?: string;
58
58
  /** WireGuard: allowed IPs (CIDR strings, e.g. ['0.0.0.0/0']) */
59
59
  wgAllowedIps?: string[];
60
+ /** Client-defined tags reported to the server after connection (informational, not for access control) */
61
+ clientDefinedClientTags?: string[];
60
62
  }
61
63
 
62
64
  export interface IVpnClientOptions {
@@ -123,6 +125,27 @@ export interface IVpnServerConfig {
123
125
  * tunnel IP as the source address. This allows downstream services (e.g. SmartProxy)
124
126
  * to see the real VPN client identity instead of 127.0.0.1. */
125
127
  socketForwardProxyProtocol?: boolean;
128
+ /** Destination routing policy for VPN client traffic (socket mode).
129
+ * Controls where decrypted traffic goes: allow through, block, or redirect to a target.
130
+ * Default: all traffic passes through (backward compatible). */
131
+ destinationPolicy?: IDestinationPolicy;
132
+ }
133
+
134
+ /**
135
+ * Destination routing policy for VPN client traffic.
136
+ * Evaluated per-packet in the NAT engine before per-client ACLs.
137
+ */
138
+ export interface IDestinationPolicy {
139
+ /** Default action for traffic not matching allow/block lists */
140
+ default: 'forceTarget' | 'block' | 'allow';
141
+ /** Target IP address for 'forceTarget' mode (e.g. '127.0.0.1'). Required when default is 'forceTarget'. */
142
+ target?: string;
143
+ /** Destinations that pass through directly — not rewritten, not blocked.
144
+ * Supports: exact IP, CIDR, wildcards (192.168.190.*), ranges. */
145
+ allowList?: string[];
146
+ /** Destinations that are always blocked. Overrides allowList (deny wins).
147
+ * Supports: exact IP, CIDR, wildcards, ranges. */
148
+ blockList?: string[];
126
149
  }
127
150
 
128
151
  export interface IVpnServerOptions {
@@ -290,7 +313,11 @@ export interface IClientEntry {
290
313
  priority?: number;
291
314
  /** Whether this client is enabled (default: true) */
292
315
  enabled?: boolean;
293
- /** Tags for grouping (e.g. ["engineering", "office"]) */
316
+ /** Tags assigned by the server admin — trusted, used for access control (e.g. ["engineering", "office"]) */
317
+ serverDefinedClientTags?: string[];
318
+ /** Tags reported by the connecting client — informational only, never used for access control */
319
+ clientDefinedClientTags?: string[];
320
+ /** @deprecated Use serverDefinedClientTags instead. Legacy field kept for backward compatibility. */
294
321
  tags?: string[];
295
322
  /** Optional description */
296
323
  description?: string;