@attest-it/core 0.7.0 → 0.9.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/dist/{chunk-T3NLSO5B.js → chunk-FGYLU2HL.js} +38 -8
- package/dist/chunk-FGYLU2HL.js.map +1 -0
- package/dist/core-alpha.d.ts +58 -18
- package/dist/core-beta.d.ts +58 -18
- package/dist/core-public.d.ts +58 -18
- package/dist/core-unstripped.d.ts +58 -18
- package/dist/crypto-SSL7OBY2.js +3 -0
- package/dist/{crypto-VT6YNHUE.js.map → crypto-SSL7OBY2.js.map} +1 -1
- package/dist/index.cjs +85 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -18
- package/dist/index.d.ts +58 -18
- package/dist/index.js +76 -74
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
- package/dist/chunk-T3NLSO5B.js.map +0 -1
- package/dist/crypto-VT6YNHUE.js +0 -3
package/dist/index.d.cts
CHANGED
|
@@ -34,6 +34,8 @@ interface AttestItSettings {
|
|
|
34
34
|
publicKeyPath: string;
|
|
35
35
|
/** Path to the attestations file */
|
|
36
36
|
attestationsPath: string;
|
|
37
|
+
/** Path to the seals file */
|
|
38
|
+
sealsPath: string;
|
|
37
39
|
/** Default command to execute for attestation (can be overridden per suite) */
|
|
38
40
|
defaultCommand?: string;
|
|
39
41
|
/** Key provider configuration for signing attestations */
|
|
@@ -52,6 +54,8 @@ interface TeamMember {
|
|
|
52
54
|
github?: string | undefined;
|
|
53
55
|
/** Base64-encoded Ed25519 public key */
|
|
54
56
|
publicKey: string;
|
|
57
|
+
/** Public key algorithm (optional, for future-proofing format changes) */
|
|
58
|
+
publicKeyAlgorithm?: 'ed25519' | undefined;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* Fingerprint configuration for gates.
|
|
@@ -189,6 +193,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
189
193
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
190
194
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
191
195
|
attestationsPath: z.ZodDefault<z.ZodString>;
|
|
196
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
192
197
|
defaultCommand: z.ZodOptional<z.ZodString>;
|
|
193
198
|
keyProvider: z.ZodOptional<z.ZodObject<{
|
|
194
199
|
type: z.ZodUnion<[z.ZodEnum<["filesystem", "1password"]>, z.ZodString]>;
|
|
@@ -229,6 +234,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
229
234
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
230
235
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
231
236
|
attestationsPath: z.ZodDefault<z.ZodString>;
|
|
237
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
232
238
|
defaultCommand: z.ZodOptional<z.ZodString>;
|
|
233
239
|
keyProvider: z.ZodOptional<z.ZodObject<{
|
|
234
240
|
type: z.ZodUnion<[z.ZodEnum<["filesystem", "1password"]>, z.ZodString]>;
|
|
@@ -269,6 +275,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
269
275
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
270
276
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
271
277
|
attestationsPath: z.ZodDefault<z.ZodString>;
|
|
278
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
272
279
|
defaultCommand: z.ZodOptional<z.ZodString>;
|
|
273
280
|
keyProvider: z.ZodOptional<z.ZodObject<{
|
|
274
281
|
type: z.ZodUnion<[z.ZodEnum<["filesystem", "1password"]>, z.ZodString]>;
|
|
@@ -311,16 +318,19 @@ declare const configSchema: z.ZodObject<{
|
|
|
311
318
|
email: z.ZodOptional<z.ZodString>;
|
|
312
319
|
github: z.ZodOptional<z.ZodString>;
|
|
313
320
|
publicKey: z.ZodString;
|
|
321
|
+
publicKeyAlgorithm: z.ZodOptional<z.ZodEnum<["ed25519"]>>;
|
|
314
322
|
}, "strict", z.ZodTypeAny, {
|
|
315
323
|
name: string;
|
|
316
324
|
publicKey: string;
|
|
317
325
|
email?: string | undefined;
|
|
318
326
|
github?: string | undefined;
|
|
327
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
319
328
|
}, {
|
|
320
329
|
name: string;
|
|
321
330
|
publicKey: string;
|
|
322
331
|
email?: string | undefined;
|
|
323
332
|
github?: string | undefined;
|
|
333
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
324
334
|
}>>>;
|
|
325
335
|
gates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
326
336
|
name: z.ZodString;
|
|
@@ -441,6 +451,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
441
451
|
maxAgeDays: number;
|
|
442
452
|
publicKeyPath: string;
|
|
443
453
|
attestationsPath: string;
|
|
454
|
+
sealsPath: string;
|
|
444
455
|
defaultCommand?: string | undefined;
|
|
445
456
|
keyProvider?: {
|
|
446
457
|
type: string;
|
|
@@ -471,6 +482,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
471
482
|
publicKey: string;
|
|
472
483
|
email?: string | undefined;
|
|
473
484
|
github?: string | undefined;
|
|
485
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
474
486
|
}> | undefined;
|
|
475
487
|
gates?: Record<string, {
|
|
476
488
|
name: string;
|
|
@@ -501,6 +513,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
501
513
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
502
514
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
503
515
|
attestationsPath: z.ZodDefault<z.ZodString>;
|
|
516
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
504
517
|
defaultCommand: z.ZodOptional<z.ZodString>;
|
|
505
518
|
keyProvider: z.ZodOptional<z.ZodObject<{
|
|
506
519
|
type: z.ZodUnion<[z.ZodEnum<["filesystem", "1password"]>, z.ZodString]>;
|
|
@@ -543,6 +556,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
543
556
|
publicKey: string;
|
|
544
557
|
email?: string | undefined;
|
|
545
558
|
github?: string | undefined;
|
|
559
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
546
560
|
}> | undefined;
|
|
547
561
|
gates?: Record<string, {
|
|
548
562
|
name: string;
|
|
@@ -673,30 +687,36 @@ declare const policySchema: z.ZodObject<{
|
|
|
673
687
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
674
688
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
675
689
|
attestationsPath: z.ZodDefault<z.ZodString>;
|
|
690
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
676
691
|
}, "strict", z.ZodTypeAny, {
|
|
677
692
|
maxAgeDays: number;
|
|
678
693
|
publicKeyPath: string;
|
|
679
694
|
attestationsPath: string;
|
|
695
|
+
sealsPath: string;
|
|
680
696
|
}, {
|
|
681
697
|
maxAgeDays?: number | undefined;
|
|
682
698
|
publicKeyPath?: string | undefined;
|
|
683
699
|
attestationsPath?: string | undefined;
|
|
700
|
+
sealsPath?: string | undefined;
|
|
684
701
|
}>>;
|
|
685
702
|
team: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
686
703
|
name: z.ZodString;
|
|
687
704
|
email: z.ZodOptional<z.ZodString>;
|
|
688
705
|
github: z.ZodOptional<z.ZodString>;
|
|
689
706
|
publicKey: z.ZodString;
|
|
707
|
+
publicKeyAlgorithm: z.ZodOptional<z.ZodLiteral<"ed25519">>;
|
|
690
708
|
}, "strict", z.ZodTypeAny, {
|
|
691
709
|
name: string;
|
|
692
710
|
publicKey: string;
|
|
693
711
|
email?: string | undefined;
|
|
694
712
|
github?: string | undefined;
|
|
713
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
695
714
|
}, {
|
|
696
715
|
name: string;
|
|
697
716
|
publicKey: string;
|
|
698
717
|
email?: string | undefined;
|
|
699
718
|
github?: string | undefined;
|
|
719
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
700
720
|
}>>>;
|
|
701
721
|
gates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
702
722
|
name: z.ZodString;
|
|
@@ -738,12 +758,14 @@ declare const policySchema: z.ZodObject<{
|
|
|
738
758
|
maxAgeDays: number;
|
|
739
759
|
publicKeyPath: string;
|
|
740
760
|
attestationsPath: string;
|
|
761
|
+
sealsPath: string;
|
|
741
762
|
};
|
|
742
763
|
team?: Record<string, {
|
|
743
764
|
name: string;
|
|
744
765
|
publicKey: string;
|
|
745
766
|
email?: string | undefined;
|
|
746
767
|
github?: string | undefined;
|
|
768
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
747
769
|
}> | undefined;
|
|
748
770
|
gates?: Record<string, {
|
|
749
771
|
name: string;
|
|
@@ -761,12 +783,14 @@ declare const policySchema: z.ZodObject<{
|
|
|
761
783
|
maxAgeDays?: number | undefined;
|
|
762
784
|
publicKeyPath?: string | undefined;
|
|
763
785
|
attestationsPath?: string | undefined;
|
|
786
|
+
sealsPath?: string | undefined;
|
|
764
787
|
} | undefined;
|
|
765
788
|
team?: Record<string, {
|
|
766
789
|
name: string;
|
|
767
790
|
publicKey: string;
|
|
768
791
|
email?: string | undefined;
|
|
769
792
|
github?: string | undefined;
|
|
793
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
770
794
|
}> | undefined;
|
|
771
795
|
gates?: Record<string, {
|
|
772
796
|
name: string;
|
|
@@ -1070,7 +1094,7 @@ declare function parseOperationalContent(content: string, format: 'yaml' | 'json
|
|
|
1070
1094
|
* The merge strategy prioritizes security-critical fields from the policy
|
|
1071
1095
|
* configuration while combining operational fields from both sources:
|
|
1072
1096
|
*
|
|
1073
|
-
* - **Policy settings** (maxAgeDays, publicKeyPath, attestationsPath) are used as-is
|
|
1097
|
+
* - **Policy settings** (maxAgeDays, publicKeyPath, attestationsPath, sealsPath) are used as-is
|
|
1074
1098
|
* - **Operational settings** (defaultCommand, keyProvider) are added from operational config
|
|
1075
1099
|
* - **Team and gates** come exclusively from policy config
|
|
1076
1100
|
* - **Suites and groups** come exclusively from operational config
|
|
@@ -1263,6 +1287,8 @@ interface KeyGenerationResult {
|
|
|
1263
1287
|
publicKeyPath: string;
|
|
1264
1288
|
/** Human-readable storage location description */
|
|
1265
1289
|
storageDescription: string;
|
|
1290
|
+
/** Whether the private key is encrypted with a passphrase */
|
|
1291
|
+
encrypted?: boolean;
|
|
1266
1292
|
}
|
|
1267
1293
|
/**
|
|
1268
1294
|
* Options for key generation via provider.
|
|
@@ -1273,6 +1299,8 @@ interface KeygenProviderOptions {
|
|
|
1273
1299
|
publicKeyPath: string;
|
|
1274
1300
|
/** Overwrite existing keys */
|
|
1275
1301
|
force?: boolean;
|
|
1302
|
+
/** Passphrase to encrypt the private key (filesystem provider only) */
|
|
1303
|
+
passphrase?: string;
|
|
1276
1304
|
}
|
|
1277
1305
|
/**
|
|
1278
1306
|
* Abstract interface for key storage providers.
|
|
@@ -1514,6 +1542,8 @@ interface KeygenOptions {
|
|
|
1514
1542
|
publicPath?: string;
|
|
1515
1543
|
/** Overwrite existing keys (default: false) */
|
|
1516
1544
|
force?: boolean;
|
|
1545
|
+
/** Passphrase to encrypt the private key with AES-256 (optional) */
|
|
1546
|
+
passphrase?: string;
|
|
1517
1547
|
}
|
|
1518
1548
|
/**
|
|
1519
1549
|
* Options for signing data.
|
|
@@ -1528,6 +1558,8 @@ interface SignOptions {
|
|
|
1528
1558
|
keyRef?: string;
|
|
1529
1559
|
/** Data to sign (string or Buffer) */
|
|
1530
1560
|
data: string | Buffer;
|
|
1561
|
+
/** Passphrase for encrypted private keys (optional) */
|
|
1562
|
+
passphrase?: string;
|
|
1531
1563
|
}
|
|
1532
1564
|
/**
|
|
1533
1565
|
* Options for verifying signatures.
|
|
@@ -2416,9 +2448,8 @@ declare function getHomePublicKeysDir(): string;
|
|
|
2416
2448
|
/**
|
|
2417
2449
|
* Get the project public keys directory.
|
|
2418
2450
|
*
|
|
2419
|
-
*
|
|
2420
|
-
*
|
|
2421
|
-
* verify attestation seals.
|
|
2451
|
+
* @deprecated Public keys are now stored inline in the team section of config.yaml.
|
|
2452
|
+
* This function is kept for backward compatibility but should not be used in new code.
|
|
2422
2453
|
*
|
|
2423
2454
|
* @param projectRoot - The project root directory (defaults to cwd)
|
|
2424
2455
|
* @returns Path to the project public keys directory
|
|
@@ -2428,6 +2459,9 @@ declare function getProjectPublicKeysDir(projectRoot?: string): string;
|
|
|
2428
2459
|
/**
|
|
2429
2460
|
* Check if a project has attest-it configuration.
|
|
2430
2461
|
*
|
|
2462
|
+
* @deprecated This function is kept for backward compatibility but is no longer used
|
|
2463
|
+
* by the core library. Public keys are now stored inline in config.yaml.
|
|
2464
|
+
*
|
|
2431
2465
|
* @param projectRoot - The project root directory (defaults to cwd)
|
|
2432
2466
|
* @returns True if the project has .attest-it/config.yaml or similar
|
|
2433
2467
|
* @public
|
|
@@ -2444,31 +2478,33 @@ interface SavePublicKeyResult {
|
|
|
2444
2478
|
projectPath?: string;
|
|
2445
2479
|
}
|
|
2446
2480
|
/**
|
|
2447
|
-
* Save a public key to the user's home directory
|
|
2481
|
+
* Save a public key to the user's home directory.
|
|
2448
2482
|
*
|
|
2449
2483
|
* This saves the public key as a base64-encoded string (matching the format in config.yaml)
|
|
2450
|
-
* to
|
|
2451
|
-
*
|
|
2452
|
-
*
|
|
2484
|
+
* to ~/.attest-it/public-keys/<slug>.pem for backup purposes.
|
|
2485
|
+
*
|
|
2486
|
+
* Public keys are now stored inline in the team section of config.yaml and no longer
|
|
2487
|
+
* written to the project directory.
|
|
2453
2488
|
*
|
|
2454
2489
|
* @param slug - The identity slug (used for the filename)
|
|
2455
2490
|
* @param publicKey - The base64-encoded public key
|
|
2456
|
-
* @param projectRoot - The project root directory (
|
|
2491
|
+
* @param projectRoot - The project root directory (deprecated, kept for backward compatibility)
|
|
2457
2492
|
* @returns Paths where the key was saved
|
|
2458
2493
|
* @public
|
|
2459
2494
|
*/
|
|
2460
2495
|
declare function savePublicKey(slug: string, publicKey: string, projectRoot?: string): Promise<SavePublicKeyResult>;
|
|
2461
2496
|
/**
|
|
2462
|
-
* Save a public key to the user's home directory
|
|
2497
|
+
* Save a public key to the user's home directory (sync).
|
|
2463
2498
|
*
|
|
2464
2499
|
* This saves the public key as a base64-encoded string (matching the format in config.yaml)
|
|
2465
|
-
* to
|
|
2466
|
-
*
|
|
2467
|
-
*
|
|
2500
|
+
* to ~/.attest-it/public-keys/<slug>.pem for backup purposes.
|
|
2501
|
+
*
|
|
2502
|
+
* Public keys are now stored inline in the team section of config.yaml and no longer
|
|
2503
|
+
* written to the project directory.
|
|
2468
2504
|
*
|
|
2469
2505
|
* @param slug - The identity slug (used for the filename)
|
|
2470
2506
|
* @param publicKey - The base64-encoded public key
|
|
2471
|
-
* @param projectRoot - The project root directory (
|
|
2507
|
+
* @param projectRoot - The project root directory (deprecated, kept for backward compatibility)
|
|
2472
2508
|
* @returns Paths where the key was saved
|
|
2473
2509
|
* @public
|
|
2474
2510
|
*/
|
|
@@ -2610,38 +2646,42 @@ declare function verifySeal(seal: Seal, config: AttestItConfig): SignatureVerifi
|
|
|
2610
2646
|
* Read seals from the seals.json file (async).
|
|
2611
2647
|
*
|
|
2612
2648
|
* @param dir - Directory containing .attest-it/seals.json
|
|
2649
|
+
* @param sealsPathOverride - Optional explicit path to seals file (from config.settings.sealsPath)
|
|
2613
2650
|
* @returns The seals file contents, or an empty seals file if the file doesn't exist
|
|
2614
2651
|
* @throws Error if file exists but cannot be read or parsed
|
|
2615
2652
|
* @public
|
|
2616
2653
|
*/
|
|
2617
|
-
declare function readSeals(dir: string): Promise<SealsFile>;
|
|
2654
|
+
declare function readSeals(dir: string, sealsPathOverride?: string): Promise<SealsFile>;
|
|
2618
2655
|
/**
|
|
2619
2656
|
* Read seals from the seals.json file (sync).
|
|
2620
2657
|
*
|
|
2621
2658
|
* @param dir - Directory containing .attest-it/seals.json
|
|
2659
|
+
* @param sealsPathOverride - Optional explicit path to seals file (from config.settings.sealsPath)
|
|
2622
2660
|
* @returns The seals file contents, or an empty seals file if the file doesn't exist
|
|
2623
2661
|
* @throws Error if file exists but cannot be read or parsed
|
|
2624
2662
|
* @public
|
|
2625
2663
|
*/
|
|
2626
|
-
declare function readSealsSync(dir: string): SealsFile;
|
|
2664
|
+
declare function readSealsSync(dir: string, sealsPathOverride?: string): SealsFile;
|
|
2627
2665
|
/**
|
|
2628
2666
|
* Write seals to the seals.json file (async).
|
|
2629
2667
|
*
|
|
2630
2668
|
* @param dir - Directory containing .attest-it/seals.json
|
|
2631
2669
|
* @param sealsFile - The seals file to write
|
|
2670
|
+
* @param sealsPathOverride - Optional explicit path to seals file (from config.settings.sealsPath)
|
|
2632
2671
|
* @throws Error if file cannot be written
|
|
2633
2672
|
* @public
|
|
2634
2673
|
*/
|
|
2635
|
-
declare function writeSeals(dir: string, sealsFile: SealsFile): Promise<void>;
|
|
2674
|
+
declare function writeSeals(dir: string, sealsFile: SealsFile, sealsPathOverride?: string): Promise<void>;
|
|
2636
2675
|
/**
|
|
2637
2676
|
* Write seals to the seals.json file (sync).
|
|
2638
2677
|
*
|
|
2639
2678
|
* @param dir - Directory containing .attest-it/seals.json
|
|
2640
2679
|
* @param sealsFile - The seals file to write
|
|
2680
|
+
* @param sealsPathOverride - Optional explicit path to seals file (from config.settings.sealsPath)
|
|
2641
2681
|
* @throws Error if file cannot be written
|
|
2642
2682
|
* @public
|
|
2643
2683
|
*/
|
|
2644
|
-
declare function writeSealsSync(dir: string, sealsFile: SealsFile): void;
|
|
2684
|
+
declare function writeSealsSync(dir: string, sealsFile: SealsFile, sealsPathOverride?: string): void;
|
|
2645
2685
|
|
|
2646
2686
|
/**
|
|
2647
2687
|
* Seal verification logic and states.
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ interface AttestItSettings {
|
|
|
30
30
|
publicKeyPath: string;
|
|
31
31
|
/** Path to the attestations file */
|
|
32
32
|
attestationsPath: string;
|
|
33
|
+
/** Path to the seals file */
|
|
34
|
+
sealsPath: string;
|
|
33
35
|
/** Default command to execute for attestation (can be overridden per suite) */
|
|
34
36
|
defaultCommand?: string;
|
|
35
37
|
/** Key provider configuration for signing attestations */
|
|
@@ -48,6 +50,8 @@ interface TeamMember {
|
|
|
48
50
|
github?: string | undefined;
|
|
49
51
|
/** Base64-encoded Ed25519 public key */
|
|
50
52
|
publicKey: string;
|
|
53
|
+
/** Public key algorithm (optional, for future-proofing format changes) */
|
|
54
|
+
publicKeyAlgorithm?: 'ed25519' | undefined;
|
|
51
55
|
}
|
|
52
56
|
/**
|
|
53
57
|
* Fingerprint configuration for gates.
|
|
@@ -255,6 +259,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
255
259
|
}>>;
|
|
256
260
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
257
261
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
262
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
258
263
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
259
264
|
attestationsPath: z.ZodDefault<z.ZodString>;
|
|
260
265
|
defaultCommand: z.ZodOptional<z.ZodString>;
|
|
@@ -295,6 +300,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
295
300
|
}>>;
|
|
296
301
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
297
302
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
303
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
298
304
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
299
305
|
attestationsPath: z.ZodDefault<z.ZodString>;
|
|
300
306
|
defaultCommand: z.ZodOptional<z.ZodString>;
|
|
@@ -335,6 +341,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
335
341
|
}>>;
|
|
336
342
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
337
343
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
344
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
338
345
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
339
346
|
suites: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
340
347
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -419,16 +426,19 @@ declare const configSchema: z.ZodObject<{
|
|
|
419
426
|
github: z.ZodOptional<z.ZodString>;
|
|
420
427
|
name: z.ZodString;
|
|
421
428
|
publicKey: z.ZodString;
|
|
429
|
+
publicKeyAlgorithm: z.ZodOptional<z.ZodEnum<["ed25519"]>>;
|
|
422
430
|
}, "strict", z.ZodTypeAny, {
|
|
423
431
|
email?: string | undefined;
|
|
424
432
|
github?: string | undefined;
|
|
425
433
|
name: string;
|
|
426
434
|
publicKey: string;
|
|
435
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
427
436
|
}, {
|
|
428
437
|
email?: string | undefined;
|
|
429
438
|
github?: string | undefined;
|
|
430
439
|
name: string;
|
|
431
440
|
publicKey: string;
|
|
441
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
432
442
|
}>>>;
|
|
433
443
|
version: z.ZodLiteral<1>;
|
|
434
444
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -457,6 +467,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
457
467
|
} | undefined;
|
|
458
468
|
maxAgeDays: number;
|
|
459
469
|
publicKeyPath: string;
|
|
470
|
+
sealsPath: string;
|
|
460
471
|
} & { [k: string]: unknown };
|
|
461
472
|
suites: Record<string, {
|
|
462
473
|
command?: string | undefined;
|
|
@@ -475,6 +486,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
475
486
|
github?: string | undefined;
|
|
476
487
|
name: string;
|
|
477
488
|
publicKey: string;
|
|
489
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
478
490
|
}> | undefined;
|
|
479
491
|
version: 1;
|
|
480
492
|
}, {
|
|
@@ -529,6 +541,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
529
541
|
}>>;
|
|
530
542
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
531
543
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
544
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
532
545
|
}, z.ZodTypeAny, "passthrough">;
|
|
533
546
|
suites: Record<string, {
|
|
534
547
|
command?: string | undefined;
|
|
@@ -547,6 +560,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
547
560
|
github?: string | undefined;
|
|
548
561
|
name: string;
|
|
549
562
|
publicKey: string;
|
|
563
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
550
564
|
}> | undefined;
|
|
551
565
|
version: 1;
|
|
552
566
|
}>;
|
|
@@ -700,30 +714,36 @@ declare const policySchema: z.ZodObject<{
|
|
|
700
714
|
attestationsPath: z.ZodDefault<z.ZodString>;
|
|
701
715
|
maxAgeDays: z.ZodDefault<z.ZodNumber>;
|
|
702
716
|
publicKeyPath: z.ZodDefault<z.ZodString>;
|
|
717
|
+
sealsPath: z.ZodDefault<z.ZodString>;
|
|
703
718
|
}, "strict", z.ZodTypeAny, {
|
|
704
719
|
attestationsPath: string;
|
|
705
720
|
maxAgeDays: number;
|
|
706
721
|
publicKeyPath: string;
|
|
722
|
+
sealsPath: string;
|
|
707
723
|
}, {
|
|
708
724
|
attestationsPath?: string | undefined;
|
|
709
725
|
maxAgeDays?: number | undefined;
|
|
710
726
|
publicKeyPath?: string | undefined;
|
|
727
|
+
sealsPath?: string | undefined;
|
|
711
728
|
}>>;
|
|
712
729
|
team: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
713
730
|
email: z.ZodOptional<z.ZodString>;
|
|
714
731
|
github: z.ZodOptional<z.ZodString>;
|
|
715
732
|
name: z.ZodString;
|
|
716
733
|
publicKey: z.ZodString;
|
|
734
|
+
publicKeyAlgorithm: z.ZodOptional<z.ZodLiteral<"ed25519">>;
|
|
717
735
|
}, "strict", z.ZodTypeAny, {
|
|
718
736
|
email?: string | undefined;
|
|
719
737
|
github?: string | undefined;
|
|
720
738
|
name: string;
|
|
721
739
|
publicKey: string;
|
|
740
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
722
741
|
}, {
|
|
723
742
|
email?: string | undefined;
|
|
724
743
|
github?: string | undefined;
|
|
725
744
|
name: string;
|
|
726
745
|
publicKey: string;
|
|
746
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
727
747
|
}>>>;
|
|
728
748
|
version: z.ZodLiteral<1>;
|
|
729
749
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -741,12 +761,14 @@ declare const policySchema: z.ZodObject<{
|
|
|
741
761
|
attestationsPath: string;
|
|
742
762
|
maxAgeDays: number;
|
|
743
763
|
publicKeyPath: string;
|
|
764
|
+
sealsPath: string;
|
|
744
765
|
};
|
|
745
766
|
team?: Record<string, {
|
|
746
767
|
email?: string | undefined;
|
|
747
768
|
github?: string | undefined;
|
|
748
769
|
name: string;
|
|
749
770
|
publicKey: string;
|
|
771
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
750
772
|
}> | undefined;
|
|
751
773
|
version: 1;
|
|
752
774
|
}, {
|
|
@@ -764,12 +786,14 @@ declare const policySchema: z.ZodObject<{
|
|
|
764
786
|
attestationsPath?: string | undefined;
|
|
765
787
|
maxAgeDays?: number | undefined;
|
|
766
788
|
publicKeyPath?: string | undefined;
|
|
789
|
+
sealsPath?: string | undefined;
|
|
767
790
|
} | undefined;
|
|
768
791
|
team?: Record<string, {
|
|
769
792
|
email?: string | undefined;
|
|
770
793
|
github?: string | undefined;
|
|
771
794
|
name: string;
|
|
772
795
|
publicKey: string;
|
|
796
|
+
publicKeyAlgorithm?: "ed25519" | undefined;
|
|
773
797
|
}> | undefined;
|
|
774
798
|
version: 1;
|
|
775
799
|
}>;
|
|
@@ -1064,7 +1088,7 @@ declare function parseOperationalContent(content: string, format: 'json' | 'yaml
|
|
|
1064
1088
|
* The merge strategy prioritizes security-critical fields from the policy
|
|
1065
1089
|
* configuration while combining operational fields from both sources:
|
|
1066
1090
|
*
|
|
1067
|
-
* - **Policy settings** (maxAgeDays, publicKeyPath, attestationsPath) are used as-is
|
|
1091
|
+
* - **Policy settings** (maxAgeDays, publicKeyPath, attestationsPath, sealsPath) are used as-is
|
|
1068
1092
|
* - **Operational settings** (defaultCommand, keyProvider) are added from operational config
|
|
1069
1093
|
* - **Team and gates** come exclusively from policy config
|
|
1070
1094
|
* - **Suites and groups** come exclusively from operational config
|
|
@@ -1257,6 +1281,8 @@ interface KeyGenerationResult {
|
|
|
1257
1281
|
publicKeyPath: string;
|
|
1258
1282
|
/** Human-readable storage location description */
|
|
1259
1283
|
storageDescription: string;
|
|
1284
|
+
/** Whether the private key is encrypted with a passphrase */
|
|
1285
|
+
encrypted?: boolean;
|
|
1260
1286
|
}
|
|
1261
1287
|
/**
|
|
1262
1288
|
* Options for key generation via provider.
|
|
@@ -1267,6 +1293,8 @@ interface KeygenProviderOptions {
|
|
|
1267
1293
|
publicKeyPath: string;
|
|
1268
1294
|
/** Overwrite existing keys */
|
|
1269
1295
|
force?: boolean;
|
|
1296
|
+
/** Passphrase to encrypt the private key (filesystem provider only) */
|
|
1297
|
+
passphrase?: string;
|
|
1270
1298
|
}
|
|
1271
1299
|
/**
|
|
1272
1300
|
* Abstract interface for key storage providers.
|
|
@@ -1508,6 +1536,8 @@ interface KeygenOptions {
|
|
|
1508
1536
|
publicPath?: string;
|
|
1509
1537
|
/** Overwrite existing keys (default: false) */
|
|
1510
1538
|
force?: boolean;
|
|
1539
|
+
/** Passphrase to encrypt the private key with AES-256 (optional) */
|
|
1540
|
+
passphrase?: string;
|
|
1511
1541
|
}
|
|
1512
1542
|
/**
|
|
1513
1543
|
* Options for signing data.
|
|
@@ -1522,6 +1552,8 @@ interface SignOptions {
|
|
|
1522
1552
|
keyRef?: string;
|
|
1523
1553
|
/** Data to sign (string or Buffer) */
|
|
1524
1554
|
data: Buffer | string;
|
|
1555
|
+
/** Passphrase for encrypted private keys (optional) */
|
|
1556
|
+
passphrase?: string;
|
|
1525
1557
|
}
|
|
1526
1558
|
/**
|
|
1527
1559
|
* Options for verifying signatures.
|
|
@@ -2406,9 +2438,8 @@ declare function getHomePublicKeysDir(): string;
|
|
|
2406
2438
|
/**
|
|
2407
2439
|
* Get the project public keys directory.
|
|
2408
2440
|
*
|
|
2409
|
-
*
|
|
2410
|
-
*
|
|
2411
|
-
* verify attestation seals.
|
|
2441
|
+
* @deprecated Public keys are now stored inline in the team section of config.yaml.
|
|
2442
|
+
* This function is kept for backward compatibility but should not be used in new code.
|
|
2412
2443
|
*
|
|
2413
2444
|
* @param projectRoot - The project root directory (defaults to cwd)
|
|
2414
2445
|
* @returns Path to the project public keys directory
|
|
@@ -2418,6 +2449,9 @@ declare function getProjectPublicKeysDir(projectRoot?: string): string;
|
|
|
2418
2449
|
/**
|
|
2419
2450
|
* Check if a project has attest-it configuration.
|
|
2420
2451
|
*
|
|
2452
|
+
* @deprecated This function is kept for backward compatibility but is no longer used
|
|
2453
|
+
* by the core library. Public keys are now stored inline in config.yaml.
|
|
2454
|
+
*
|
|
2421
2455
|
* @param projectRoot - The project root directory (defaults to cwd)
|
|
2422
2456
|
* @returns True if the project has .attest-it/config.yaml or similar
|
|
2423
2457
|
* @public
|
|
@@ -2434,31 +2468,33 @@ interface SavePublicKeyResult {
|
|
|
2434
2468
|
projectPath?: string;
|
|
2435
2469
|
}
|
|
2436
2470
|
/**
|
|
2437
|
-
* Save a public key to the user's home directory
|
|
2471
|
+
* Save a public key to the user's home directory.
|
|
2438
2472
|
*
|
|
2439
2473
|
* This saves the public key as a base64-encoded string (matching the format in config.yaml)
|
|
2440
|
-
* to
|
|
2441
|
-
*
|
|
2442
|
-
*
|
|
2474
|
+
* to ~/.attest-it/public-keys/<slug>.pem for backup purposes.
|
|
2475
|
+
*
|
|
2476
|
+
* Public keys are now stored inline in the team section of config.yaml and no longer
|
|
2477
|
+
* written to the project directory.
|
|
2443
2478
|
*
|
|
2444
2479
|
* @param slug - The identity slug (used for the filename)
|
|
2445
2480
|
* @param publicKey - The base64-encoded public key
|
|
2446
|
-
* @param projectRoot - The project root directory (
|
|
2481
|
+
* @param projectRoot - The project root directory (deprecated, kept for backward compatibility)
|
|
2447
2482
|
* @returns Paths where the key was saved
|
|
2448
2483
|
* @public
|
|
2449
2484
|
*/
|
|
2450
2485
|
declare function savePublicKey(slug: string, publicKey: string, projectRoot?: string): Promise<SavePublicKeyResult>;
|
|
2451
2486
|
/**
|
|
2452
|
-
* Save a public key to the user's home directory
|
|
2487
|
+
* Save a public key to the user's home directory (sync).
|
|
2453
2488
|
*
|
|
2454
2489
|
* This saves the public key as a base64-encoded string (matching the format in config.yaml)
|
|
2455
|
-
* to
|
|
2456
|
-
*
|
|
2457
|
-
*
|
|
2490
|
+
* to ~/.attest-it/public-keys/<slug>.pem for backup purposes.
|
|
2491
|
+
*
|
|
2492
|
+
* Public keys are now stored inline in the team section of config.yaml and no longer
|
|
2493
|
+
* written to the project directory.
|
|
2458
2494
|
*
|
|
2459
2495
|
* @param slug - The identity slug (used for the filename)
|
|
2460
2496
|
* @param publicKey - The base64-encoded public key
|
|
2461
|
-
* @param projectRoot - The project root directory (
|
|
2497
|
+
* @param projectRoot - The project root directory (deprecated, kept for backward compatibility)
|
|
2462
2498
|
* @returns Paths where the key was saved
|
|
2463
2499
|
* @public
|
|
2464
2500
|
*/
|
|
@@ -2600,38 +2636,42 @@ declare function verifySeal(seal: Seal, config: AttestItConfig): SignatureVerifi
|
|
|
2600
2636
|
* Read seals from the seals.json file (async).
|
|
2601
2637
|
*
|
|
2602
2638
|
* @param dir - Directory containing .attest-it/seals.json
|
|
2639
|
+
* @param sealsPathOverride - Optional explicit path to seals file (from config.settings.sealsPath)
|
|
2603
2640
|
* @returns The seals file contents, or an empty seals file if the file doesn't exist
|
|
2604
2641
|
* @throws Error if file exists but cannot be read or parsed
|
|
2605
2642
|
* @public
|
|
2606
2643
|
*/
|
|
2607
|
-
declare function readSeals(dir: string): Promise<SealsFile>;
|
|
2644
|
+
declare function readSeals(dir: string, sealsPathOverride?: string): Promise<SealsFile>;
|
|
2608
2645
|
/**
|
|
2609
2646
|
* Read seals from the seals.json file (sync).
|
|
2610
2647
|
*
|
|
2611
2648
|
* @param dir - Directory containing .attest-it/seals.json
|
|
2649
|
+
* @param sealsPathOverride - Optional explicit path to seals file (from config.settings.sealsPath)
|
|
2612
2650
|
* @returns The seals file contents, or an empty seals file if the file doesn't exist
|
|
2613
2651
|
* @throws Error if file exists but cannot be read or parsed
|
|
2614
2652
|
* @public
|
|
2615
2653
|
*/
|
|
2616
|
-
declare function readSealsSync(dir: string): SealsFile;
|
|
2654
|
+
declare function readSealsSync(dir: string, sealsPathOverride?: string): SealsFile;
|
|
2617
2655
|
/**
|
|
2618
2656
|
* Write seals to the seals.json file (async).
|
|
2619
2657
|
*
|
|
2620
2658
|
* @param dir - Directory containing .attest-it/seals.json
|
|
2621
2659
|
* @param sealsFile - The seals file to write
|
|
2660
|
+
* @param sealsPathOverride - Optional explicit path to seals file (from config.settings.sealsPath)
|
|
2622
2661
|
* @throws Error if file cannot be written
|
|
2623
2662
|
* @public
|
|
2624
2663
|
*/
|
|
2625
|
-
declare function writeSeals(dir: string, sealsFile: SealsFile): Promise<void>;
|
|
2664
|
+
declare function writeSeals(dir: string, sealsFile: SealsFile, sealsPathOverride?: string): Promise<void>;
|
|
2626
2665
|
/**
|
|
2627
2666
|
* Write seals to the seals.json file (sync).
|
|
2628
2667
|
*
|
|
2629
2668
|
* @param dir - Directory containing .attest-it/seals.json
|
|
2630
2669
|
* @param sealsFile - The seals file to write
|
|
2670
|
+
* @param sealsPathOverride - Optional explicit path to seals file (from config.settings.sealsPath)
|
|
2631
2671
|
* @throws Error if file cannot be written
|
|
2632
2672
|
* @public
|
|
2633
2673
|
*/
|
|
2634
|
-
declare function writeSealsSync(dir: string, sealsFile: SealsFile): void;
|
|
2674
|
+
declare function writeSealsSync(dir: string, sealsFile: SealsFile, sealsPathOverride?: string): void;
|
|
2635
2675
|
|
|
2636
2676
|
/**
|
|
2637
2677
|
* Seal verification logic and states.
|