@push.rocks/smartnftables 1.2.1 → 1.4.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.
- package/changelog.md +37 -0
- package/dist_rust/smartnftables_linux_amd64_musl +0 -0
- package/dist_rust/smartnftables_linux_amd64_musl.tsrust-build.json +14 -0
- package/dist_rust/smartnftables_linux_arm64_musl +0 -0
- package/dist_rust/smartnftables_linux_arm64_musl.tsrust-build.json +14 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.managednftables.d.ts +21 -0
- package/dist_ts/classes.managednftables.js +182 -0
- package/dist_ts/index.d.ts +2 -0
- package/dist_ts/index.js +2 -1
- package/dist_ts/managed.types.d.ts +103 -0
- package/dist_ts/managed.types.js +2 -0
- package/dist_ts/plugins.d.ts +5 -2
- package/dist_ts/plugins.js +6 -3
- package/native-notices/crates/block-buffer-0.10.4/license-apache +201 -0
- package/native-notices/crates/block-buffer-0.10.4/license-mit +25 -0
- package/native-notices/crates/cfg-if-1.0.4/license-apache +201 -0
- package/native-notices/crates/cfg-if-1.0.4/license-mit +25 -0
- package/native-notices/crates/cpufeatures-0.2.17/license-apache +201 -0
- package/native-notices/crates/cpufeatures-0.2.17/license-mit +25 -0
- package/native-notices/crates/crypto-common-0.1.7/license-apache +201 -0
- package/native-notices/crates/crypto-common-0.1.7/license-mit +25 -0
- package/native-notices/crates/digest-0.10.7/license-apache +201 -0
- package/native-notices/crates/digest-0.10.7/license-mit +25 -0
- package/native-notices/crates/generic-array-0.14.7/license +21 -0
- package/native-notices/crates/itoa-1.0.18/license-apache +176 -0
- package/native-notices/crates/itoa-1.0.18/license-mit +23 -0
- package/native-notices/crates/libc-0.2.189/license-apache +176 -0
- package/native-notices/crates/libc-0.2.189/license-mit +25 -0
- package/native-notices/crates/memchr-2.8.3/copying +3 -0
- package/native-notices/crates/memchr-2.8.3/license-mit +21 -0
- package/native-notices/crates/proc-macro2-1.0.107/license-apache +176 -0
- package/native-notices/crates/proc-macro2-1.0.107/license-mit +23 -0
- package/native-notices/crates/quote-1.0.47/license-apache +176 -0
- package/native-notices/crates/quote-1.0.47/license-mit +23 -0
- package/native-notices/crates/serde-1.0.229/license-apache +176 -0
- package/native-notices/crates/serde-1.0.229/license-mit +23 -0
- package/native-notices/crates/serde_core-1.0.229/license-apache +176 -0
- package/native-notices/crates/serde_core-1.0.229/license-mit +23 -0
- package/native-notices/crates/serde_derive-1.0.229/license-apache +176 -0
- package/native-notices/crates/serde_derive-1.0.229/license-mit +23 -0
- package/native-notices/crates/serde_json-1.0.151/license-apache +176 -0
- package/native-notices/crates/serde_json-1.0.151/license-mit +23 -0
- package/native-notices/crates/sha2-0.10.9/license-apache +201 -0
- package/native-notices/crates/sha2-0.10.9/license-mit +27 -0
- package/native-notices/crates/syn-3.0.5/license-apache +176 -0
- package/native-notices/crates/syn-3.0.5/license-mit +23 -0
- package/native-notices/crates/typenum-1.20.1/license +1 -0
- package/native-notices/crates/typenum-1.20.1/license-apache +201 -0
- package/native-notices/crates/typenum-1.20.1/license-mit +21 -0
- package/native-notices/crates/unicode-ident-1.0.24/license-apache +176 -0
- package/native-notices/crates/unicode-ident-1.0.24/license-mit +23 -0
- package/native-notices/crates/unicode-ident-1.0.24/license-unicode +39 -0
- package/native-notices/crates/version_check-0.9.5/license-apache +201 -0
- package/native-notices/crates/version_check-0.9.5/license-mit +19 -0
- package/native-notices/crates/zmij-1.0.23/license-mit +23 -0
- package/native-notices/manifest.json +520 -0
- package/native-notices/readme.md +36 -0
- package/native-notices/rust-standard-library/addr2line-0.25.1-license-apache +201 -0
- package/native-notices/rust-standard-library/addr2line-0.25.1-license-mit +25 -0
- package/native-notices/rust-standard-library/cargo.lock +522 -0
- package/native-notices/rust-standard-library/compiler-builtins-license.txt +275 -0
- package/native-notices/rust-standard-library/dependency-notices.html +9072 -0
- package/native-notices/rust-standard-library/license-apache +176 -0
- package/native-notices/rust-standard-library/license-mit +25 -0
- package/native-notices/rust-standard-library/llvm-libunwind-license.txt +311 -0
- package/native-notices/rust-standard-library/musl-1.2.5-copyright.txt +193 -0
- package/native-notices/rust-standard-library/unicode-license.txt +39 -0
- package/package.json +23 -8
- package/readme.md +160 -2
- package/rust/.cargo/config.toml +2 -0
- package/rust/Cargo.lock +192 -0
- package/rust/Cargo.toml +13 -0
- package/rust/src/main.rs +159 -0
- package/rust/src/namespace.rs +51 -0
- package/rust/src/owner.rs +604 -0
- package/rust/src/owner_namespace_tests.rs +242 -0
- package/rust/src/owner_tests.rs +798 -0
- package/rust/src/policy.rs +427 -0
- package/rust/src/tests.rs +97 -0
- package/rust/src/wire.rs +437 -0
- package/scripts/check-native-notices.mjs +27 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.managednftables.ts +153 -0
- package/ts/index.ts +2 -0
- package/ts/managed.types.ts +91 -0
- package/ts/plugins.ts +6 -0
- /package/{license → license.md} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** The caller owns these workload links and keeps them disabled until apply is confirmed. */
|
|
2
|
+
export interface IManagedNftEndpoint {
|
|
3
|
+
id: string;
|
|
4
|
+
interfaceIndex: number;
|
|
5
|
+
interfaceName: string;
|
|
6
|
+
/** Routed, unbridged veth or L3 TUN; TAP/bridge/uplink interfaces reject. */
|
|
7
|
+
interfaceKind: 'veth' | 'tun';
|
|
8
|
+
sourcePrefixes: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Null selects the actual local host (input/output only), never an unbound forwarding side. */
|
|
12
|
+
export interface IManagedNftRule {
|
|
13
|
+
sourceEndpoint: string | null;
|
|
14
|
+
destinationEndpoint: string | null;
|
|
15
|
+
sourcePrefix: string;
|
|
16
|
+
destinationPrefix: string;
|
|
17
|
+
protocol: 'any' | 'tcp' | 'udp';
|
|
18
|
+
sourcePort: number | null;
|
|
19
|
+
destinationPort: number | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IManagedNftPolicy {
|
|
23
|
+
schemaVersion: 1;
|
|
24
|
+
revision: number;
|
|
25
|
+
endpoints: IManagedNftEndpoint[];
|
|
26
|
+
rules: IManagedNftRule[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IPreparedManagedNftPolicy {
|
|
30
|
+
policy: IManagedNftPolicy;
|
|
31
|
+
digest: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IManagedNftIdentity {
|
|
35
|
+
ownerId: string;
|
|
36
|
+
instanceId: string;
|
|
37
|
+
tableName: string;
|
|
38
|
+
bootId: string;
|
|
39
|
+
namespaceDevice: string;
|
|
40
|
+
namespaceInode: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface IManagedNftReceipt {
|
|
44
|
+
identity: IManagedNftIdentity;
|
|
45
|
+
tableHandle: string;
|
|
46
|
+
revision: number;
|
|
47
|
+
digest: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IAppliedManagedNftPolicy {
|
|
51
|
+
receipt: IManagedNftReceipt;
|
|
52
|
+
prepared: IPreparedManagedNftPolicy;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Persist this complete command before reconcile, then retain its complete result. */
|
|
56
|
+
export interface IManagedNftTransition {
|
|
57
|
+
previous: IAppliedManagedNftPolicy | null;
|
|
58
|
+
target: IPreparedManagedNftPolicy;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface IManagedNftStatus {
|
|
62
|
+
identity: IManagedNftIdentity;
|
|
63
|
+
state: 'idle' | 'applied' | 'failed-owned' | 'released';
|
|
64
|
+
enforced: boolean;
|
|
65
|
+
applied: IAppliedManagedNftPolicy | null;
|
|
66
|
+
pending: IManagedNftTransition | null;
|
|
67
|
+
error: string | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface IManagedNftOptions {
|
|
71
|
+
ownerId: string;
|
|
72
|
+
/** Caller-retained unique operation identity, at least 16 identifier characters. */
|
|
73
|
+
instanceId: string;
|
|
74
|
+
/** Dedicated name beginning snft_; existing foreign tables always reject. */
|
|
75
|
+
tableName: string;
|
|
76
|
+
/** Explicit executable selection for qualified distributions and isolated tests. */
|
|
77
|
+
binaryPath?: string;
|
|
78
|
+
/** Linux network namespace descriptor, owned by the caller and valid through start().
|
|
79
|
+
* The native process enters before readiness or netlink activity. Keep a namespace
|
|
80
|
+
* owner alive for policy lifetime and recovery; this process option is not durable authority. */
|
|
81
|
+
networkNamespaceFd?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type TManagedNftCommands = {
|
|
85
|
+
preparePolicy: { params: IManagedNftPolicy; result: IPreparedManagedNftPolicy };
|
|
86
|
+
openOwner: { params: Pick<IManagedNftOptions, 'ownerId' | 'instanceId' | 'tableName'>; result: IManagedNftStatus };
|
|
87
|
+
reconcilePolicy: { params: IManagedNftTransition; result: IAppliedManagedNftPolicy };
|
|
88
|
+
inspectPolicy: { params: Record<string, never>; result: IManagedNftStatus };
|
|
89
|
+
releasePolicy: { params: IAppliedManagedNftPolicy; result: { released: true } };
|
|
90
|
+
closeOwner: { params: Record<string, never>; result: { released: true } };
|
|
91
|
+
};
|
package/ts/plugins.ts
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
// node native scope
|
|
2
2
|
import * as childProcess from 'node:child_process';
|
|
3
3
|
import * as util from 'node:util';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import * as url from 'node:url';
|
|
4
6
|
|
|
5
7
|
export {
|
|
6
8
|
childProcess,
|
|
7
9
|
util,
|
|
10
|
+
path,
|
|
11
|
+
url,
|
|
8
12
|
};
|
|
9
13
|
|
|
10
14
|
// @push.rocks scope
|
|
11
15
|
import * as smartlog from '@push.rocks/smartlog';
|
|
12
16
|
import * as smartpromise from '@push.rocks/smartpromise';
|
|
17
|
+
import * as smartrust from '@push.rocks/smartrust';
|
|
13
18
|
export {
|
|
14
19
|
smartlog,
|
|
15
20
|
smartpromise,
|
|
21
|
+
smartrust,
|
|
16
22
|
};
|
/package/{license → license.md}
RENAMED
|
File without changes
|