@happyvertical/secrets 0.86.4 → 0.88.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.
@@ -0,0 +1,264 @@
1
+ import { KeyObject } from 'node:crypto';
2
+ export type CredentialIssuanceMode = 'ephemeral' | 'durable';
3
+ export type CustodyStage = 'issue' | 'store' | 'retrieve' | 'verify' | 'activate' | 'record' | 'inject' | 'revoke' | 'reconcile';
4
+ export declare class CustodyError extends Error {
5
+ readonly code: string;
6
+ readonly stage: CustodyStage;
7
+ readonly details?: Readonly<Record<string, unknown>>;
8
+ constructor(code: string, stage: CustodyStage, message: string, options?: {
9
+ cause?: unknown;
10
+ details?: Record<string, unknown>;
11
+ });
12
+ toJSON(): Record<string, unknown>;
13
+ }
14
+ export declare class SecretMaterial {
15
+ #private;
16
+ private constructor();
17
+ static fromString(value: string): SecretMaterial;
18
+ get destroyed(): boolean;
19
+ use(operation: (value: string) => void | Promise<void>): Promise<void>;
20
+ destroy(): void;
21
+ toJSON(): string;
22
+ toString(): string;
23
+ }
24
+ export interface CredentialIssueRequest {
25
+ mode: CredentialIssuanceMode;
26
+ subject: string;
27
+ expiresAt?: string;
28
+ metadata?: Readonly<Record<string, string>>;
29
+ }
30
+ export interface IssuedCredential {
31
+ credentialId: string;
32
+ secret: SecretMaterial;
33
+ issuedAt?: string;
34
+ expiresAt?: string;
35
+ }
36
+ export interface CredentialIssuer {
37
+ readonly name: string;
38
+ issue(request: CredentialIssueRequest): Promise<IssuedCredential>;
39
+ /** Must be idempotent so failed custody transitions can be retried. */
40
+ revoke(credentialId: string, reason: string): Promise<void>;
41
+ }
42
+ export interface CredentialVerifier {
43
+ readonly name: string;
44
+ verify(input: {
45
+ credentialId: string;
46
+ secret: SecretMaterial;
47
+ }): Promise<{
48
+ verified: boolean;
49
+ verificationId?: string;
50
+ }>;
51
+ }
52
+ export interface SecretSinkRecord {
53
+ sinkName: string;
54
+ reference: string;
55
+ version: string;
56
+ storedAt: string;
57
+ }
58
+ export interface SecretSinkInventoryEntry extends SecretSinkRecord {
59
+ credentialId: string;
60
+ }
61
+ export interface CredentialSecretSink {
62
+ readonly name: string;
63
+ store(input: {
64
+ credentialId: string;
65
+ secret: SecretMaterial;
66
+ metadata: Readonly<Record<string, string>>;
67
+ }): Promise<SecretSinkRecord>;
68
+ retrieve(record: SecretSinkRecord): Promise<SecretMaterial>;
69
+ /**
70
+ * Removes any write for this credential, including a store that persisted
71
+ * data but failed before returning its record. Must be idempotent.
72
+ */
73
+ removeByCredentialId(credentialId: string, reason: string): Promise<void>;
74
+ /** Must conditionally remove this exact version and be idempotent. */
75
+ remove(record: SecretSinkRecord, reason: string): Promise<void>;
76
+ inventory(): Promise<SecretSinkInventoryEntry[]>;
77
+ }
78
+ export interface CustodyAttribution {
79
+ actor: string;
80
+ runtime: string;
81
+ session: string;
82
+ }
83
+ export interface CustodyReceipt {
84
+ receiptId: string;
85
+ mode: CredentialIssuanceMode;
86
+ credentialId: string;
87
+ subject: string;
88
+ issuer: string;
89
+ verifier: string;
90
+ verificationId?: string;
91
+ verificationState: 'verified';
92
+ issuedAt: string;
93
+ verifiedAt: string;
94
+ expiresAt?: string;
95
+ sink?: SecretSinkRecord;
96
+ replacesReceiptId?: string;
97
+ rotationRootReceiptId: string;
98
+ attribution: CustodyAttribution;
99
+ metadata: Readonly<Record<string, string>>;
100
+ finalizer: string;
101
+ finalizationId: string;
102
+ attestation: CustodyReceiptAttestation;
103
+ }
104
+ export interface CustodyReceiptAttestation {
105
+ algorithm: 'Ed25519';
106
+ attestor: string;
107
+ keyId: string;
108
+ signature: string;
109
+ }
110
+ export interface CredentialReceiptAttestor {
111
+ readonly name: string;
112
+ readonly keyId: string;
113
+ attest(payload: string): Promise<string>;
114
+ }
115
+ export interface CredentialCustodyFinalizer {
116
+ readonly name: string;
117
+ prepare(input: {
118
+ receipt: CustodyReceipt;
119
+ secret: SecretMaterial;
120
+ }): Promise<{
121
+ prepared: boolean;
122
+ }>;
123
+ commit(input: {
124
+ receipt: CustodyReceipt;
125
+ }): Promise<void>;
126
+ abort(input: {
127
+ receipt: CustodyReceipt;
128
+ reason: string;
129
+ }): Promise<void>;
130
+ status(input: {
131
+ receipt: CustodyReceipt;
132
+ }): Promise<'missing' | 'prepared' | 'committed' | 'aborted'>;
133
+ }
134
+ export declare class Ed25519CustodyReceiptAttestor implements CredentialReceiptAttestor {
135
+ #private;
136
+ readonly name: string;
137
+ readonly keyId: string;
138
+ constructor(options: {
139
+ privateKey: KeyObject;
140
+ keyId: string;
141
+ name?: string;
142
+ });
143
+ attest(payload: string): Promise<string>;
144
+ }
145
+ export type CustodyEventType = 'issued' | 'revoked' | 'expired' | 'replaced' | 'rollback-pending' | 'rollback-complete' | 'finalization-pending' | 'retirement-pending' | 'retirement-complete' | 'orphan-detected' | 'orphan-removed';
146
+ export interface CustodyEvent {
147
+ eventId: string;
148
+ type: CustodyEventType;
149
+ occurredAt: string;
150
+ receiptId?: string;
151
+ recoveryId?: string;
152
+ credentialId?: string;
153
+ requiresSink?: boolean;
154
+ finalizationReceipt?: CustodyReceipt;
155
+ recoveryReceipt?: CustodyReceipt;
156
+ replacementReceiptId?: string;
157
+ sinkReference?: string;
158
+ reason?: string;
159
+ }
160
+ export interface CustodyLedger {
161
+ /**
162
+ * Atomically records a receipt and its finalization-pending event.
163
+ * Implementations must reject duplicate receipt IDs, terminal predecessors,
164
+ * a second child for the same replacesReceiptId, and any other event type.
165
+ */
166
+ recordIssuance(receipt: CustodyReceipt, event: CustodyEvent): Promise<void>;
167
+ /**
168
+ * Idempotently appends the issued event and optional retirement-pending
169
+ * followup in one transaction. No other event types are accepted.
170
+ */
171
+ commitIssuance(receiptId: string, event: CustodyEvent, followup?: CustodyEvent): Promise<void>;
172
+ /**
173
+ * Idempotently appends an event by eventId. Replaying the same event must
174
+ * succeed; reusing an eventId for different content must fail closed.
175
+ */
176
+ appendEvent(event: CustodyEvent): Promise<void>;
177
+ listReceipts(): Promise<CustodyReceipt[]>;
178
+ listEvents(): Promise<CustodyEvent[]>;
179
+ }
180
+ export declare class InMemoryCustodyLedger implements CustodyLedger {
181
+ #private;
182
+ recordIssuance(receipt: CustodyReceipt, event: CustodyEvent): Promise<void>;
183
+ appendEvent(event: CustodyEvent): Promise<void>;
184
+ commitIssuance(receiptId: string, event: CustodyEvent, followup?: CustodyEvent): Promise<void>;
185
+ listReceipts(): Promise<CustodyReceipt[]>;
186
+ listEvents(): Promise<CustodyEvent[]>;
187
+ }
188
+ export interface CredentialLease {
189
+ readonly receipt: CustodyReceipt;
190
+ withEnvironment(variableName: string, operation: () => void | Promise<void>): Promise<void>;
191
+ withChildProcess(options: CredentialChildProcessOptions): Promise<CredentialChildProcessResult>;
192
+ revoke(reason?: string): Promise<void>;
193
+ }
194
+ export interface CredentialChildProcessOptions {
195
+ /**
196
+ * Acknowledges that the command and every credential-bearing descendant are
197
+ * trusted to remain in the SDK-owned POSIX process group.
198
+ */
199
+ trust: 'cooperative-process-group';
200
+ command: string;
201
+ args?: readonly string[];
202
+ environmentVariable: string;
203
+ environment?: Readonly<Record<string, string>>;
204
+ cwd?: string;
205
+ timeoutMs?: number;
206
+ maxOutputBytes?: number;
207
+ }
208
+ export interface CredentialChildProcessResult {
209
+ exitCode: number | null;
210
+ signal: NodeJS.Signals | null;
211
+ stdout: string;
212
+ stderr: string;
213
+ timedOut: boolean;
214
+ }
215
+ export interface CustodyReconciliation {
216
+ checkedAt: string;
217
+ orphaned: SecretSinkInventoryEntry[];
218
+ missing: CustodyReceipt[];
219
+ }
220
+ export interface CredentialCustodyOptions {
221
+ issuer: CredentialIssuer;
222
+ verifier: CredentialVerifier;
223
+ ledger: CustodyLedger;
224
+ attestor: CredentialReceiptAttestor;
225
+ finalizer: CredentialCustodyFinalizer;
226
+ sink?: CredentialSecretSink;
227
+ ephemeralTtlMs?: number;
228
+ ephemeralRevokeRetryMs?: number;
229
+ orphanGraceMs?: number;
230
+ finalizationTakeoverMs?: number;
231
+ now?: () => Date;
232
+ onBackgroundError?: (error: CustodyError) => void;
233
+ }
234
+ export interface CustodyIssuanceRequest {
235
+ mode: CredentialIssuanceMode;
236
+ subject: string;
237
+ attribution: CustodyAttribution;
238
+ expiresAt?: string;
239
+ metadata?: Readonly<Record<string, string>>;
240
+ replacesReceiptId?: string;
241
+ }
242
+ export declare class CredentialCustody {
243
+ #private;
244
+ constructor(options: CredentialCustodyOptions);
245
+ issue(request: CustodyIssuanceRequest): Promise<CredentialLease>;
246
+ rotate(receiptId: string, request: Omit<CustodyIssuanceRequest, 'mode' | 'replacesReceiptId'>): Promise<CredentialLease>;
247
+ revoke(receiptId: string, reason?: string): Promise<void>;
248
+ recoverPendingRollbacks(): Promise<void>;
249
+ recoverCredential(credentialId: string, options?: {
250
+ requiresSink?: boolean;
251
+ }): Promise<void>;
252
+ reconcile(): Promise<CustodyReconciliation>;
253
+ recoverOrphans(report: CustodyReconciliation): Promise<void>;
254
+ }
255
+ export declare function withEnvironmentSecret(material: SecretMaterial, variableName: string, operation: () => void | Promise<void>, bounds?: {
256
+ expiresAt?: string;
257
+ }): Promise<void>;
258
+ export declare function runCredentialChildProcess(material: SecretMaterial, options: CredentialChildProcessOptions, bounds?: {
259
+ expiresAt?: string;
260
+ }): Promise<CredentialChildProcessResult>;
261
+ export declare function verifyCustodyReceiptAttestation(receipt: CustodyReceipt, material: SecretMaterial, publicKey: KeyObject): Promise<boolean>;
262
+ export declare function redactCredentialText(input: string, knownSecrets?: readonly string[]): string;
263
+ export declare function redactCredentialValues(value: unknown, knownSecrets?: readonly string[]): unknown;
264
+ //# sourceMappingURL=custody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custody.d.ts","sourceRoot":"","sources":["../../src/shared/custody.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,SAAS,EAIf,MAAM,aAAa,CAAC;AAsDrB,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,SAAS,CAAC;AAC7D,MAAM,MAAM,YAAY,GACpB,O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,CAAC,IAAI,CAAC;IAgQxC,iBAAiB,CACrB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO,GACvC,OAAO,CAAC,IAAI,CAAC;IAUV,SAAS,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAqE3C,cAAc,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CA6mBnE;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,cAAc,EACxB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACrC,MAAM,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,6BAA6B,EACtC,MAAM,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B,OAAO,CAAC,4BAA4B,CAAC,CA6LvC;AAED,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,OAAO,CAAC,CA+BlB;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,YAAY,GAAE,SAAS,MAAM,EAAO,GACnC,MAAM,CASR;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,SAAS,MAAM,EAAO,GACnC,OAAO,CAiBT"}
@@ -34,7 +34,7 @@ export declare function isAzureKeyVaultOptions(opts: GetSecretStoreOptions): opt
34
34
  * });
35
35
  *
36
36
  * // Encrypt a secret
37
- * const envelope = await store.encrypt('tenant-123', 'api-key', 'sk_live_xxx');
37
+ * const envelope = await store.encrypt('tenant-123', 'api-key', 'synthetic-secret');
38
38
  *
39
39
  * // Decrypt
40
40
  * const decrypted = await store.decrypt('tenant-123', envelope);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/secrets",
3
- "version": "0.86.4",
3
+ "version": "0.88.0",
4
4
  "description": "Envelope encryption for per-tenant secret management with pluggable backends",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -27,8 +27,8 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@happyvertical/sql": "0.86.4",
31
- "@happyvertical/utils": "0.86.4"
30
+ "@happyvertical/sql": "0.88.0",
31
+ "@happyvertical/utils": "0.88.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "25.0.10",
package/LICENSE DELETED
@@ -1,7 +0,0 @@
1
- Copyright <2025> <Happy Vertical Corporation>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.