@zincapp/zn-vault-agent 1.6.13 → 1.6.15
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/README.md +196 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +15 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/lib/config.d.ts +3 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/health.d.ts +14 -3
- package/dist/lib/health.d.ts.map +1 -1
- package/dist/lib/health.js +115 -94
- package/dist/lib/health.js.map +1 -1
- package/dist/lib/websocket.d.ts.map +1 -1
- package/dist/lib/websocket.js +109 -2
- package/dist/lib/websocket.js.map +1 -1
- package/dist/plugins/context.d.ts +17 -0
- package/dist/plugins/context.d.ts.map +1 -0
- package/dist/plugins/context.js +175 -0
- package/dist/plugins/context.js.map +1 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +9 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/loader.d.ts +116 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +399 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/storage.d.ts +18 -0
- package/dist/plugins/storage.d.ts.map +1 -0
- package/dist/plugins/storage.js +166 -0
- package/dist/plugins/storage.js.map +1 -0
- package/dist/plugins/types.d.ts +341 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +12 -0
- package/dist/plugins/types.js.map +1 -0
- package/package.json +13 -1
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import type { FastifyInstance } from 'fastify';
|
|
2
|
+
import type { Logger } from 'pino';
|
|
3
|
+
import type { AgentConfig, CertTarget, SecretTarget } from '../lib/config.js';
|
|
4
|
+
import type { ChildProcessState } from '../services/child-process-manager.js';
|
|
5
|
+
/**
|
|
6
|
+
* Plugin metadata and lifecycle hooks
|
|
7
|
+
*/
|
|
8
|
+
export interface AgentPlugin {
|
|
9
|
+
/** Unique plugin name (e.g., 'payara', 'kubernetes') */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Semver version */
|
|
12
|
+
version: string;
|
|
13
|
+
/** Optional description */
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Called once when plugin is loaded, before daemon starts.
|
|
17
|
+
* Use for initialization, validation, setting up state.
|
|
18
|
+
*/
|
|
19
|
+
onInit?(ctx: PluginContext): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Called when daemon is starting, after WebSocket is connected.
|
|
22
|
+
* Use for startup tasks like checking external service health.
|
|
23
|
+
*/
|
|
24
|
+
onStart?(ctx: PluginContext): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Called when daemon is shutting down.
|
|
27
|
+
* Use for cleanup, closing connections, etc.
|
|
28
|
+
*/
|
|
29
|
+
onStop?(ctx: PluginContext): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Register HTTP routes on the health server (port 9100).
|
|
32
|
+
* Use for custom endpoints like /deploy, /status, etc.
|
|
33
|
+
* Routes will be registered under /plugins/<name>/
|
|
34
|
+
*/
|
|
35
|
+
routes?(fastify: FastifyInstance, ctx: PluginContext): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* React to certificate deployment events.
|
|
38
|
+
* Called AFTER successful deployment.
|
|
39
|
+
*/
|
|
40
|
+
onCertificateDeployed?(event: CertificateDeployedEvent, ctx: PluginContext): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* React to secret deployment events.
|
|
43
|
+
* Called AFTER successful deployment.
|
|
44
|
+
*/
|
|
45
|
+
onSecretDeployed?(event: SecretDeployedEvent, ctx: PluginContext): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* React to API key rotation events.
|
|
48
|
+
* Called AFTER key is rotated and config updated.
|
|
49
|
+
*/
|
|
50
|
+
onKeyRotated?(event: KeyRotatedEvent, ctx: PluginContext): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* React to child process lifecycle events (exec mode).
|
|
53
|
+
*/
|
|
54
|
+
onChildProcessEvent?(event: ChildProcessEvent, ctx: PluginContext): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Contribute to health check response.
|
|
57
|
+
* Return status object that will be merged into /health response.
|
|
58
|
+
*/
|
|
59
|
+
healthCheck?(ctx: PluginContext): Promise<PluginHealthStatus>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Factory function signature for configurable plugins
|
|
63
|
+
*/
|
|
64
|
+
export type PluginFactory<TConfig = Record<string, unknown>> = (config: TConfig) => AgentPlugin;
|
|
65
|
+
/**
|
|
66
|
+
* Plugin configuration in agent config.json
|
|
67
|
+
*/
|
|
68
|
+
export interface PluginConfig {
|
|
69
|
+
/** npm package name (e.g., '@zincapp/znvault-plugin-payara') */
|
|
70
|
+
package?: string;
|
|
71
|
+
/** Local file path (alternative to package) */
|
|
72
|
+
path?: string;
|
|
73
|
+
/** Plugin-specific configuration passed to factory */
|
|
74
|
+
config?: Record<string, unknown>;
|
|
75
|
+
/** Enable/disable plugin (default: true) */
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Context provided to plugins - safe access to agent internals
|
|
80
|
+
*/
|
|
81
|
+
export interface PluginContext {
|
|
82
|
+
/** Pino logger scoped to plugin name */
|
|
83
|
+
logger: Logger;
|
|
84
|
+
/** Agent configuration (read-only snapshot) */
|
|
85
|
+
config: Readonly<AgentConfig>;
|
|
86
|
+
/** Vault URL */
|
|
87
|
+
vaultUrl: string;
|
|
88
|
+
/** Current tenant ID */
|
|
89
|
+
tenantId: string;
|
|
90
|
+
/**
|
|
91
|
+
* Fetch a secret from vault by alias or ID.
|
|
92
|
+
* Returns decrypted value.
|
|
93
|
+
*/
|
|
94
|
+
getSecret(aliasOrId: string): Promise<SecretValue>;
|
|
95
|
+
/**
|
|
96
|
+
* Get certificate content by ID or name.
|
|
97
|
+
*/
|
|
98
|
+
getCertificate(certIdOrName: string): Promise<CertificateContent>;
|
|
99
|
+
/**
|
|
100
|
+
* Get configured certificate targets
|
|
101
|
+
*/
|
|
102
|
+
getCertTargets(): CertTarget[];
|
|
103
|
+
/**
|
|
104
|
+
* Get configured secret targets
|
|
105
|
+
*/
|
|
106
|
+
getSecretTargets(): SecretTarget[];
|
|
107
|
+
/**
|
|
108
|
+
* Request child process restart (exec mode only).
|
|
109
|
+
* No-op if not in exec mode.
|
|
110
|
+
* @param reason Human-readable reason for restart
|
|
111
|
+
*/
|
|
112
|
+
restartChild(reason: string): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Get current child process state (exec mode only).
|
|
115
|
+
* Returns null if not in exec mode.
|
|
116
|
+
*/
|
|
117
|
+
getChildState(): ChildProcessState | null;
|
|
118
|
+
/**
|
|
119
|
+
* Emit custom event to other plugins.
|
|
120
|
+
* @param event Event name
|
|
121
|
+
* @param data Event payload
|
|
122
|
+
*/
|
|
123
|
+
emit(event: string, data: unknown): void;
|
|
124
|
+
/**
|
|
125
|
+
* Listen for custom events from other plugins.
|
|
126
|
+
* @param event Event name
|
|
127
|
+
* @param handler Event handler
|
|
128
|
+
*/
|
|
129
|
+
on(event: string, handler: (data: unknown) => void): void;
|
|
130
|
+
/**
|
|
131
|
+
* Remove event listener
|
|
132
|
+
* @param event Event name
|
|
133
|
+
* @param handler Handler to remove
|
|
134
|
+
*/
|
|
135
|
+
off(event: string, handler: (data: unknown) => void): void;
|
|
136
|
+
/**
|
|
137
|
+
* Plugin-specific persistent storage (JSON file in config dir).
|
|
138
|
+
*/
|
|
139
|
+
storage: PluginStorage;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Secret value returned by getSecret
|
|
143
|
+
*/
|
|
144
|
+
export interface SecretValue {
|
|
145
|
+
/** Secret ID */
|
|
146
|
+
id: string;
|
|
147
|
+
/** Secret alias (if any) */
|
|
148
|
+
alias?: string;
|
|
149
|
+
/** Decrypted secret data */
|
|
150
|
+
data: Record<string, unknown>;
|
|
151
|
+
/** Secret version */
|
|
152
|
+
version: number;
|
|
153
|
+
/** Secret type */
|
|
154
|
+
type: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Certificate content returned by getCertificate
|
|
158
|
+
*/
|
|
159
|
+
export interface CertificateContent {
|
|
160
|
+
/** Certificate ID */
|
|
161
|
+
id: string;
|
|
162
|
+
/** Certificate name */
|
|
163
|
+
name: string;
|
|
164
|
+
/** PEM-encoded certificate */
|
|
165
|
+
certificate: string;
|
|
166
|
+
/** PEM-encoded private key */
|
|
167
|
+
privateKey: string;
|
|
168
|
+
/** PEM-encoded CA chain */
|
|
169
|
+
chain?: string;
|
|
170
|
+
/** Full chain (cert + chain) */
|
|
171
|
+
fullchain?: string;
|
|
172
|
+
/** Certificate fingerprint (SHA-256) */
|
|
173
|
+
fingerprint: string;
|
|
174
|
+
/** Expiration date */
|
|
175
|
+
expiresAt: string;
|
|
176
|
+
/** Subject common name */
|
|
177
|
+
commonName: string;
|
|
178
|
+
/** Subject alternative names */
|
|
179
|
+
subjectAltNames?: string[];
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Simple key-value storage for plugins
|
|
183
|
+
*/
|
|
184
|
+
export interface PluginStorage {
|
|
185
|
+
/**
|
|
186
|
+
* Get a value from storage
|
|
187
|
+
* @param key Storage key
|
|
188
|
+
* @returns Value or undefined if not found
|
|
189
|
+
*/
|
|
190
|
+
get<T>(key: string): T | undefined;
|
|
191
|
+
/**
|
|
192
|
+
* Set a value in storage
|
|
193
|
+
* @param key Storage key
|
|
194
|
+
* @param value Value to store (must be JSON-serializable)
|
|
195
|
+
*/
|
|
196
|
+
set<T>(key: string, value: T): void;
|
|
197
|
+
/**
|
|
198
|
+
* Delete a value from storage
|
|
199
|
+
* @param key Storage key
|
|
200
|
+
*/
|
|
201
|
+
delete(key: string): void;
|
|
202
|
+
/**
|
|
203
|
+
* Clear all storage for this plugin
|
|
204
|
+
*/
|
|
205
|
+
clear(): void;
|
|
206
|
+
/**
|
|
207
|
+
* Check if a key exists
|
|
208
|
+
* @param key Storage key
|
|
209
|
+
*/
|
|
210
|
+
has(key: string): boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Get all keys
|
|
213
|
+
*/
|
|
214
|
+
keys(): string[];
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Emitted after a certificate is successfully deployed to disk
|
|
218
|
+
*/
|
|
219
|
+
export interface CertificateDeployedEvent {
|
|
220
|
+
/** Certificate ID */
|
|
221
|
+
certId: string;
|
|
222
|
+
/** Certificate name */
|
|
223
|
+
name: string;
|
|
224
|
+
/** Output paths where certificate components were written */
|
|
225
|
+
paths: {
|
|
226
|
+
/** Combined cert+key path (for HAProxy) */
|
|
227
|
+
combined?: string;
|
|
228
|
+
/** Certificate-only path */
|
|
229
|
+
cert?: string;
|
|
230
|
+
/** Private key path */
|
|
231
|
+
key?: string;
|
|
232
|
+
/** CA chain path */
|
|
233
|
+
chain?: string;
|
|
234
|
+
/** Full chain path (cert + chain) */
|
|
235
|
+
fullchain?: string;
|
|
236
|
+
};
|
|
237
|
+
/** Certificate fingerprint (SHA-256) */
|
|
238
|
+
fingerprint: string;
|
|
239
|
+
/** Expiration date (ISO timestamp) */
|
|
240
|
+
expiresAt: string;
|
|
241
|
+
/** Common name from certificate */
|
|
242
|
+
commonName: string;
|
|
243
|
+
/** Whether this was an update (true) or initial sync (false) */
|
|
244
|
+
isUpdate: boolean;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Emitted after a secret is successfully deployed to disk
|
|
248
|
+
*/
|
|
249
|
+
export interface SecretDeployedEvent {
|
|
250
|
+
/** Secret ID */
|
|
251
|
+
secretId: string;
|
|
252
|
+
/** Secret alias */
|
|
253
|
+
alias?: string;
|
|
254
|
+
/** Secret name (from target config) */
|
|
255
|
+
name: string;
|
|
256
|
+
/** Output file path */
|
|
257
|
+
path: string;
|
|
258
|
+
/** Output format used */
|
|
259
|
+
format: 'env' | 'json' | 'yaml' | 'raw' | 'template';
|
|
260
|
+
/** Secret version */
|
|
261
|
+
version: number;
|
|
262
|
+
/** Whether this was an update (true) or initial sync (false) */
|
|
263
|
+
isUpdate: boolean;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Emitted after managed API key is rotated
|
|
267
|
+
*/
|
|
268
|
+
export interface KeyRotatedEvent {
|
|
269
|
+
/** Managed key name */
|
|
270
|
+
keyName: string;
|
|
271
|
+
/** New key prefix (first 10 chars + ...) for logging */
|
|
272
|
+
newPrefix: string;
|
|
273
|
+
/** When grace period expires (ISO timestamp) */
|
|
274
|
+
graceExpiresAt?: string;
|
|
275
|
+
/** Next rotation time (ISO timestamp) */
|
|
276
|
+
nextRotationAt?: string;
|
|
277
|
+
/** Rotation mode */
|
|
278
|
+
rotationMode: 'scheduled' | 'on-use' | 'on-bind';
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Emitted on child process lifecycle events (exec mode)
|
|
282
|
+
*/
|
|
283
|
+
export interface ChildProcessEvent {
|
|
284
|
+
/** Event type */
|
|
285
|
+
type: 'started' | 'stopped' | 'restarting' | 'crashed' | 'max_restarts';
|
|
286
|
+
/** Process ID (for 'started') */
|
|
287
|
+
pid?: number;
|
|
288
|
+
/** Exit code (for 'stopped', 'crashed') */
|
|
289
|
+
exitCode?: number;
|
|
290
|
+
/** Signal that killed process (for 'stopped', 'crashed') */
|
|
291
|
+
signal?: string;
|
|
292
|
+
/** Reason for restart (for 'restarting') */
|
|
293
|
+
reason?: string;
|
|
294
|
+
/** Restart count (for 'max_restarts') */
|
|
295
|
+
restartCount?: number;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Plugin health status for /health endpoint
|
|
299
|
+
*/
|
|
300
|
+
export interface PluginHealthStatus {
|
|
301
|
+
/** Plugin name */
|
|
302
|
+
name: string;
|
|
303
|
+
/** Health status */
|
|
304
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
305
|
+
/** Human-readable message */
|
|
306
|
+
message?: string;
|
|
307
|
+
/** Additional details */
|
|
308
|
+
details?: Record<string, unknown>;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Loaded plugin state (internal)
|
|
312
|
+
*/
|
|
313
|
+
export interface LoadedPlugin {
|
|
314
|
+
/** Plugin instance */
|
|
315
|
+
plugin: AgentPlugin;
|
|
316
|
+
/** Plugin configuration */
|
|
317
|
+
config?: Record<string, unknown>;
|
|
318
|
+
/** Plugin status */
|
|
319
|
+
status: 'loaded' | 'initialized' | 'running' | 'stopped' | 'error';
|
|
320
|
+
/** Error if status is 'error' */
|
|
321
|
+
error?: Error;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Plugin event type mapping for dispatcher
|
|
325
|
+
*/
|
|
326
|
+
export type PluginEventMap = {
|
|
327
|
+
certificateDeployed: CertificateDeployedEvent;
|
|
328
|
+
secretDeployed: SecretDeployedEvent;
|
|
329
|
+
keyRotated: KeyRotatedEvent;
|
|
330
|
+
childProcess: ChildProcessEvent;
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Plugin event handler names
|
|
334
|
+
*/
|
|
335
|
+
export declare const PLUGIN_EVENT_HANDLERS: {
|
|
336
|
+
readonly certificateDeployed: "onCertificateDeployed";
|
|
337
|
+
readonly secretDeployed: "onSecretDeployed";
|
|
338
|
+
readonly keyRotated: "onKeyRotated";
|
|
339
|
+
readonly childProcess: "onChildProcessEvent";
|
|
340
|
+
};
|
|
341
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACn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,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,oBAAoB;IACpB,MAAM,EAAE,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACnE,iCAAiC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,mBAAmB,EAAE,wBAAwB,CAAC;IAC9C,cAAc,EAAE,mBAAmB,CAAC;IACpC,UAAU,EAAE,eAAe,CAAC;IAC5B,YAAY,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Path: src/plugins/types.ts
|
|
2
|
+
// Plugin system type definitions for zn-vault-agent
|
|
3
|
+
/**
|
|
4
|
+
* Plugin event handler names
|
|
5
|
+
*/
|
|
6
|
+
export const PLUGIN_EVENT_HANDLERS = {
|
|
7
|
+
certificateDeployed: 'onCertificateDeployed',
|
|
8
|
+
secretDeployed: 'onSecretDeployed',
|
|
9
|
+
keyRotated: 'onKeyRotated',
|
|
10
|
+
childProcess: 'onChildProcessEvent',
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,oDAAoD;AAsYpD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB,EAAE,uBAAuB;IAC5C,cAAc,EAAE,kBAAkB;IAClC,UAAU,EAAE,cAAc;IAC1B,YAAY,EAAE,qBAAqB;CAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zincapp/zn-vault-agent",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.15",
|
|
4
4
|
"description": "ZN-Vault Certificate Agent - Real-time certificate and secret distribution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"zn-vault-agent": "./dist/index.js"
|
|
9
9
|
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./plugins": {
|
|
16
|
+
"import": "./dist/plugins/index.js",
|
|
17
|
+
"types": "./dist/plugins/index.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
10
20
|
"files": [
|
|
11
21
|
"dist/",
|
|
12
22
|
"!dist/**/*.test.js",
|
|
@@ -57,9 +67,11 @@
|
|
|
57
67
|
},
|
|
58
68
|
"homepage": "https://github.com/vidaldiego/zn-vault-agent#readme",
|
|
59
69
|
"dependencies": {
|
|
70
|
+
"@zincapp/znvault-plugin-payara": "^1.0.6",
|
|
60
71
|
"chalk": "^5.3.0",
|
|
61
72
|
"commander": "^12.1.0",
|
|
62
73
|
"conf": "^13.0.1",
|
|
74
|
+
"fastify": "^5.2.1",
|
|
63
75
|
"inquirer": "^9.3.7",
|
|
64
76
|
"ora": "^8.1.1",
|
|
65
77
|
"pino": "^9.0.0",
|