@camstack/system 1.2.386 → 1.2.388
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/dist/builtins/system-config/mesh-actions.d.ts +12 -0
- package/dist/builtins/system-config/system-config.addon.d.ts +25 -5
- package/dist/builtins/system-config/system-config.addon.js +303 -59
- package/dist/builtins/system-config/system-config.addon.mjs +296 -61
- package/dist/index.js +9 -0
- package/dist/index.mjs +2 -2
- package/dist/kernel/index.d.ts +2 -0
- package/dist/kernel/moleculer/agent-ui-unlock.d.ts +52 -0
- package/dist/kernel/moleculer/mesh-mtls/tls-tcp-transporter.d.ts +16 -3
- package/package.json +1 -1
package/dist/kernel/index.d.ts
CHANGED
|
@@ -69,6 +69,8 @@ export type { MeshJoinAuthenticateParams, MeshJoinAuthenticateResult, MeshJoinCh
|
|
|
69
69
|
export { getProcessMeshAuthMode, getProcessMeshAuthStatus, isMeshAuthMode, MESH_AUTH_MODE_FIELD, parseMeshAuthMode, requestProcessMeshEnforcement, setProcessMeshAuthMode, setProcessMeshAuthStatusSource, setProcessMeshEnforcer, } from './moleculer/mesh-auth-mode.js';
|
|
70
70
|
export { decideMeshAutoEnforce, MESH_AUTO_ENFORCE_GRACE_MS, } from './moleculer/mesh-auto-enforce.js';
|
|
71
71
|
export type { MeshAutoEnforceDecision, MeshAutoEnforceInput, } from './moleculer/mesh-auto-enforce.js';
|
|
72
|
+
export { AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_UI_UNLOCK_DOMAIN, AGENT_UI_UNLOCK_TTL_MS, AGENT_UI_UNLOCK_VERSION, isAllowedAgentDashboardReturnTo, mintAgentUiUnlockTicket, parseAgentDashboardOrigins, UnlockTicketJtiStore, verifyAgentUiUnlockTicket, } from './moleculer/agent-ui-unlock.js';
|
|
73
|
+
export type { AgentUiUnlockPayload, MintAgentUiUnlockTicketInput, VerifyAgentUiUnlockTicketOptions, } from './moleculer/agent-ui-unlock.js';
|
|
72
74
|
export type { MeshAuthMode, MeshAuthStatus, MeshEnforcer, MeshNodeAuthEntry, MeshNodeAuthState, } from './moleculer/mesh-auth-mode.js';
|
|
73
75
|
export { serializeTypedArrays } from './moleculer/typed-array-serde.js';
|
|
74
76
|
export { createReadinessService, createReadinessServiceForRegistry, AGENT_READINESS_SERVICE_NAME, } from './moleculer/readiness-service.js';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const AGENT_UI_UNLOCK_DOMAIN = "camstack-agent-ui-unlock/v1";
|
|
2
|
+
export declare const AGENT_UI_UNLOCK_VERSION: 1;
|
|
3
|
+
/** Ticket lifetime — long enough for a redirect hop, short enough to steal poorly. */
|
|
4
|
+
export declare const AGENT_UI_UNLOCK_TTL_MS: number;
|
|
5
|
+
/**
|
|
6
|
+
* Cluster settings key: extra origins allowed as `returnTo` for Continue-with-hub
|
|
7
|
+
* (NPM hostnames that are not `:4444` on a LAN IP). Comma-separated origins.
|
|
8
|
+
*/
|
|
9
|
+
export declare const AGENT_DASHBOARD_ORIGINS_FIELD = "agentDashboardOrigins";
|
|
10
|
+
export interface AgentUiUnlockPayload {
|
|
11
|
+
readonly v: typeof AGENT_UI_UNLOCK_VERSION;
|
|
12
|
+
readonly nodeId: string;
|
|
13
|
+
/** Epoch ms. */
|
|
14
|
+
readonly exp: number;
|
|
15
|
+
readonly jti: string;
|
|
16
|
+
}
|
|
17
|
+
/** In-memory spent `jti` until `exp` (ms). */
|
|
18
|
+
export declare class UnlockTicketJtiStore {
|
|
19
|
+
private readonly spent;
|
|
20
|
+
isSpent(jti: string, nowMs?: number): boolean;
|
|
21
|
+
/** Record a jti as used until `exp`. Returns false if already spent. */
|
|
22
|
+
consume(jti: string, exp: number, nowMs?: number): boolean;
|
|
23
|
+
/** Test helper. */
|
|
24
|
+
size(): number;
|
|
25
|
+
private gc;
|
|
26
|
+
}
|
|
27
|
+
export interface MintAgentUiUnlockTicketInput {
|
|
28
|
+
/** `hashClusterSecret(secret)` — never the raw secret. */
|
|
29
|
+
readonly secretHash: string;
|
|
30
|
+
readonly nodeId: string;
|
|
31
|
+
readonly ttlMs?: number;
|
|
32
|
+
readonly nowMs?: number;
|
|
33
|
+
readonly jti?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function mintAgentUiUnlockTicket(input: MintAgentUiUnlockTicketInput): string;
|
|
36
|
+
export interface VerifyAgentUiUnlockTicketOptions {
|
|
37
|
+
readonly expectedNodeId: string;
|
|
38
|
+
readonly nowMs?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Verify a ticket under `secretHash`. Returns the payload, or `null` when the
|
|
42
|
+
* signature, shape, expiry or nodeId fails (no reason string — refuse quietly).
|
|
43
|
+
*/
|
|
44
|
+
export declare function verifyAgentUiUnlockTicket(secretHash: string, ticket: string, options: VerifyAgentUiUnlockTicketOptions): AgentUiUnlockPayload | null;
|
|
45
|
+
/**
|
|
46
|
+
* True when `returnTo` may receive a ticket redirect. Default: any http(s)
|
|
47
|
+
* origin whose port is 4444. Extra origins come from
|
|
48
|
+
* {@link AGENT_DASHBOARD_ORIGINS_FIELD} (exact origin match).
|
|
49
|
+
*/
|
|
50
|
+
export declare function isAllowedAgentDashboardReturnTo(returnTo: string, extraOrigins?: readonly string[]): boolean;
|
|
51
|
+
/** Parse a stored comma/whitespace-separated origins list. */
|
|
52
|
+
export declare function parseAgentDashboardOrigins(stored: unknown): readonly string[];
|
|
@@ -77,17 +77,30 @@ export declare class TlsTcpTransporter extends TlsTcpTransporter_base {
|
|
|
77
77
|
/** Node id (certificate CN) → serial of every peer that completed a mutual-TLS handshake. */
|
|
78
78
|
private readonly tlsPeers;
|
|
79
79
|
private clearDisabled;
|
|
80
|
+
/** Clear-text `TcpWriter.connect` captured once before the TLS wrap (A→B). */
|
|
81
|
+
private clearWriterConnect;
|
|
82
|
+
private writerTlsPatched;
|
|
80
83
|
constructor(opts?: TlsTcpTransporterOptions);
|
|
81
84
|
startTcpServer(): Promise<number>;
|
|
82
85
|
connect(): Promise<void>;
|
|
83
86
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
87
|
+
* Outbound dial uses mTLS when the peer is already known on TLS (inbound
|
|
88
|
+
* handshake), or when dialling the hub node id (agent → hub). Everyone else
|
|
89
|
+
* (runners, unenrolled agents) stays on the clear writer — the hub must not
|
|
90
|
+
* TLS-wrap every `connect` after deferred `enableMeshTls`.
|
|
91
|
+
*/
|
|
92
|
+
private shouldDialPeerWithTls;
|
|
93
|
+
private peerTlsDialPort;
|
|
94
|
+
/**
|
|
95
|
+
* Wrap `TcpWriter.connect` so TLS peers are dialed with mutual TLS on the
|
|
96
|
+
* well-known mesh TLS port (default 6443). Idempotent: the clear connect is
|
|
97
|
+
* captured once; material refresh rebinds the wrapper.
|
|
86
98
|
*/
|
|
87
99
|
private patchWriterForTlsClient;
|
|
88
100
|
/**
|
|
89
101
|
* Enable (or refresh) the TLS listener once the mesh CA / hub leaf are ready.
|
|
90
|
-
* Safe to call after connect — starts listening on `tlsPort` alongside clear
|
|
102
|
+
* Safe to call after connect — starts listening on `tlsPort` alongside clear
|
|
103
|
+
* and patches the writer so hub→agent dials use mTLS (Release A→B).
|
|
91
104
|
*/
|
|
92
105
|
enableMeshTls(material: MeshTlsMaterial): Promise<void>;
|
|
93
106
|
/**
|