@clef-sh/core 0.1.27 → 0.2.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/README.md +1 -2
- package/dist/artifact/packer.d.ts +4 -3
- package/dist/artifact/packer.d.ts.map +1 -1
- package/dist/artifact/resolve.d.ts +3 -2
- package/dist/artifact/resolve.d.ts.map +1 -1
- package/dist/compliance/run.d.ts.map +1 -1
- package/dist/diff/engine.d.ts +18 -8
- package/dist/diff/engine.d.ts.map +1 -1
- package/dist/import/index.d.ts +5 -5
- package/dist/import/index.d.ts.map +1 -1
- package/dist/index.d.mts +14 -12
- package/dist/index.d.ts +14 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1225 -872
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +1213 -848
- package/dist/index.mjs.map +4 -4
- package/dist/kms/aws-arn.d.ts +29 -0
- package/dist/kms/aws-arn.d.ts.map +1 -0
- package/dist/kms/index.d.ts +2 -0
- package/dist/kms/index.d.ts.map +1 -1
- package/dist/lint/runner.d.ts +7 -7
- package/dist/lint/runner.d.ts.map +1 -1
- package/dist/manifest/io.d.ts +6 -0
- package/dist/manifest/io.d.ts.map +1 -1
- package/dist/manifest/parser.d.ts.map +1 -1
- package/dist/matrix/manager.d.ts +4 -16
- package/dist/matrix/manager.d.ts.map +1 -1
- package/dist/merge/driver.d.ts +2 -2
- package/dist/merge/driver.d.ts.map +1 -1
- package/dist/merge/metadata-driver.d.ts +5 -4
- package/dist/merge/metadata-driver.d.ts.map +1 -1
- package/dist/migration/backend.d.ts +10 -7
- package/dist/migration/backend.d.ts.map +1 -1
- package/dist/pack/backends/json-envelope.d.ts.map +1 -1
- package/dist/pack/types.d.ts +9 -3
- package/dist/pack/types.d.ts.map +1 -1
- package/dist/pending/metadata.d.ts +1 -3
- package/dist/pending/metadata.d.ts.map +1 -1
- package/dist/recipients/index.d.ts +4 -3
- package/dist/recipients/index.d.ts.map +1 -1
- package/dist/report/generator.d.ts +4 -3
- package/dist/report/generator.d.ts.map +1 -1
- package/dist/reset/manager.d.ts +21 -3
- package/dist/reset/manager.d.ts.map +1 -1
- package/dist/service-identity/manager.d.ts +6 -3
- package/dist/service-identity/manager.d.ts.map +1 -1
- package/dist/sops/client.d.ts +80 -55
- package/dist/sops/client.d.ts.map +1 -1
- package/dist/sops/linux-stdin-fifo.d.ts +31 -0
- package/dist/sops/linux-stdin-fifo.d.ts.map +1 -0
- package/dist/source/compose.d.ts +10 -0
- package/dist/source/compose.d.ts.map +1 -0
- package/dist/source/default-bulk.d.ts +12 -0
- package/dist/source/default-bulk.d.ts.map +1 -0
- package/dist/source/encryption-backend.d.ts +85 -0
- package/dist/source/encryption-backend.d.ts.map +1 -0
- package/dist/source/errors.d.ts +19 -0
- package/dist/source/errors.d.ts.map +1 -0
- package/dist/source/filesystem-storage-backend.d.ts +26 -0
- package/dist/source/filesystem-storage-backend.d.ts.map +1 -0
- package/dist/source/guards.d.ts +14 -0
- package/dist/source/guards.d.ts.map +1 -0
- package/dist/source/index.d.ts +10 -0
- package/dist/source/index.d.ts.map +1 -0
- package/dist/source/mock-source.d.ts +89 -0
- package/dist/source/mock-source.d.ts.map +1 -0
- package/dist/source/storage-backend.d.ts +61 -0
- package/dist/source/storage-backend.d.ts.map +1 -0
- package/dist/source/types.d.ts +212 -0
- package/dist/source/types.d.ts.map +1 -0
- package/dist/structure/manager.d.ts +17 -3
- package/dist/structure/manager.d.ts.map +1 -1
- package/dist/sync/manager.d.ts +7 -6
- package/dist/sync/manager.d.ts.map +1 -1
- package/dist/types/index.d.ts +10 -23
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/bulk/ops.d.ts +0 -57
- package/dist/bulk/ops.d.ts.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS KMS ARN validator with specific failure reasons.
|
|
3
|
+
*
|
|
4
|
+
* The parser already used a single regex (`AWS_KMS_ARN_PATTERN`) to accept-or-
|
|
5
|
+
* reject keyIds, but the failure message was generic. This validator walks the
|
|
6
|
+
* ARN segment-by-segment and returns a reason that points at the actual fault
|
|
7
|
+
* — empty region, malformed account, missing `key/`/`alias/`, etc. — so users
|
|
8
|
+
* fix the right segment without trial-and-error.
|
|
9
|
+
*
|
|
10
|
+
* Accepted forms:
|
|
11
|
+
* - `arn:aws:kms:{region}:{account}:key/{key-id}`
|
|
12
|
+
* - `arn:aws:kms:{region}:{account}:alias/{name}`
|
|
13
|
+
* - `arn:aws-{partition}:kms:...` (gov, cn, etc.)
|
|
14
|
+
*
|
|
15
|
+
* Bare key UUIDs and bare aliases are rejected — region must be derivable
|
|
16
|
+
* from the ARN at synth time.
|
|
17
|
+
*/
|
|
18
|
+
export interface AwsKmsArnValidation {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
/** Human-readable reason. Present when `ok` is `false`. */
|
|
21
|
+
reason?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Validate an AWS KMS key or alias ARN. Returns `{ ok: true }` on a well-
|
|
25
|
+
* formed ARN, otherwise `{ ok: false, reason }` with a message that names the
|
|
26
|
+
* faulty segment.
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateAwsKmsArn(input: unknown): AwsKmsArnValidation;
|
|
29
|
+
//# sourceMappingURL=aws-arn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws-arn.d.ts","sourceRoot":"","sources":["../../src/kms/aws-arn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CA4FrE"}
|
package/dist/kms/index.d.ts
CHANGED
package/dist/kms/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kms/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kms/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/lint/runner.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ClefManifest, LintResult } from "../types";
|
|
2
2
|
import { MatrixManager } from "../matrix/manager";
|
|
3
3
|
import { SchemaValidator } from "../schema/validator";
|
|
4
|
-
import {
|
|
4
|
+
import type { Lintable, SecretSource } from "../source/types";
|
|
5
5
|
/**
|
|
6
6
|
* Runs matrix completeness, schema validation, SOPS integrity, and key-drift checks.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|
|
10
|
-
* const runner = new LintRunner(matrixManager, schemaValidator,
|
|
10
|
+
* const runner = new LintRunner(matrixManager, schemaValidator, source);
|
|
11
11
|
* const result = await runner.run(manifest, repoRoot);
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
export declare class LintRunner {
|
|
15
15
|
private readonly matrixManager;
|
|
16
16
|
private readonly schemaValidator;
|
|
17
|
-
private readonly
|
|
18
|
-
constructor(matrixManager: MatrixManager, schemaValidator: SchemaValidator,
|
|
17
|
+
private readonly source;
|
|
18
|
+
constructor(matrixManager: MatrixManager, schemaValidator: SchemaValidator, source: SecretSource & Lintable);
|
|
19
19
|
/**
|
|
20
20
|
* Lint the entire matrix: check missing files, schema errors, SOPS integrity,
|
|
21
21
|
* single-recipient warnings, and cross-environment key drift.
|
|
@@ -25,10 +25,10 @@ export declare class LintRunner {
|
|
|
25
25
|
*/
|
|
26
26
|
run(manifest: ClefManifest, repoRoot: string): Promise<LintResult>;
|
|
27
27
|
/**
|
|
28
|
-
* Cross-reference
|
|
28
|
+
* Cross-reference cell metadata against the cipher's plaintext key
|
|
29
29
|
* names for each existing cell. Reports orphan rotation records and
|
|
30
|
-
* dual-state (pending + rotation) inconsistencies. Uses
|
|
31
|
-
*
|
|
30
|
+
* dual-state (pending + rotation) inconsistencies. Uses the source's
|
|
31
|
+
* `listKeys` (no decryption).
|
|
32
32
|
*/
|
|
33
33
|
private lintMetadataConsistency;
|
|
34
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lint/runner.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAEZ,UAAU,EAIX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lint/runner.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAEZ,UAAU,EAIX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAW,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvE;;;;;;;;GAQG;AACH,qBAAa,UAAU;IAEnB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAGlD;;;;;;OAMG;IACG,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAqOxE;;;;;OAKG;YACW,uBAAuB;IA0DrC;;OAEG;YACW,qBAAqB;IAoGnC;;;;;OAKG;IACG,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAczE"}
|
package/dist/manifest/io.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ export declare function readManifestYaml(repoRoot: string): Record<string, unkno
|
|
|
8
8
|
* contents — never a half-written file. If the process dies mid-write, the
|
|
9
9
|
* temp file is cleaned up by write-file-atomic's signal-exit handler. Handles
|
|
10
10
|
* Windows EPERM retries internally.
|
|
11
|
+
*
|
|
12
|
+
* **Validates before writing.** Any caller producing an invalid manifest
|
|
13
|
+
* (malformed KMS ARN, bad recipient, missing required field, etc.) gets
|
|
14
|
+
* rejected here instead of silently persisting corrupt YAML that would later
|
|
15
|
+
* brick every `clef <command>` invocation. The validation error names the
|
|
16
|
+
* specific field at fault, so callers can fix the input rather than guessing.
|
|
11
17
|
*/
|
|
12
18
|
export declare function writeManifestYaml(repoRoot: string, doc: Record<string, unknown>): void;
|
|
13
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/manifest/io.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/manifest/io.ts"],"names":[],"mappings":"AAOA,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAG1E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAetF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAG7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/manifest/parser.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,YAAY,EAKb,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/manifest/parser.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,YAAY,EAKb,MAAM,UAAU,CAAC;AAIlB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAuBlD;;;;;;;;GAQG;AACH,qBAAa,cAAc;IACzB;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY;IAsBrC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY;IAonBtC;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI;CAchF"}
|
package/dist/matrix/manager.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClefManifest, MatrixCell, MatrixStatus } from "../types";
|
|
2
|
-
import { EncryptionBackend } from "../types";
|
|
3
2
|
/**
|
|
4
3
|
* Resolves and manages the namespace × environment matrix of encrypted files.
|
|
5
4
|
*
|
|
@@ -25,28 +24,17 @@ export declare class MatrixManager {
|
|
|
25
24
|
* @param repoRoot - Absolute path to the repository root.
|
|
26
25
|
*/
|
|
27
26
|
detectMissingCells(manifest: ClefManifest, repoRoot: string): MatrixCell[];
|
|
28
|
-
/**
|
|
29
|
-
* Create an empty encrypted SOPS file for a missing matrix cell.
|
|
30
|
-
*
|
|
31
|
-
* @param cell - The cell to scaffold (must not already exist).
|
|
32
|
-
* @param sopsClient - SOPS client used to write the initial encrypted file.
|
|
33
|
-
* @param manifest - Parsed manifest used to determine the encryption backend.
|
|
34
|
-
*/
|
|
35
|
-
scaffoldCell(cell: MatrixCell, sopsClient: EncryptionBackend, manifest: ClefManifest): Promise<void>;
|
|
36
27
|
/**
|
|
37
28
|
* Read each cell and return key counts, pending counts, and cross-environment issues.
|
|
38
29
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* decrypt-based implementation later (e.g. for backends that don't expose
|
|
43
|
-
* key names without decryption).
|
|
30
|
+
* Keys are read from the plaintext YAML structure directly — no
|
|
31
|
+
* decryption needed. A future backend that doesn't expose key names
|
|
32
|
+
* without decryption would need its own implementation.
|
|
44
33
|
*
|
|
45
34
|
* @param manifest - Parsed manifest.
|
|
46
35
|
* @param repoRoot - Absolute path to the repository root.
|
|
47
|
-
* @param _sopsClient - Reserved for future use; pass any `EncryptionBackend`.
|
|
48
36
|
*/
|
|
49
|
-
getMatrixStatus(manifest: ClefManifest, repoRoot: string
|
|
37
|
+
getMatrixStatus(manifest: ClefManifest, repoRoot: string): Promise<MatrixStatus[]>;
|
|
50
38
|
/**
|
|
51
39
|
* Read top-level key names from a SOPS file without decryption.
|
|
52
40
|
* SOPS stores key names in plaintext — only values are encrypted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/matrix/manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAe,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/matrix/manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAe,YAAY,EAAE,MAAM,UAAU,CAAC;AAI/E;;;;;;;;GAQG;AACH,qBAAa,aAAa;IACxB;;;;;;OAMG;IACH,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE;IAsBrE;;;;;OAKG;IACH,kBAAkB,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE;IAI1E;;;;;;;;;OASG;IACG,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAiExF;;;OAGG;IACH,OAAO,CAAC,YAAY;IAIpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAYxB;;;;;OAKG;IACH,sBAAsB,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;CAI7E"}
|
package/dist/merge/driver.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MergeDecrypter } from "../types";
|
|
2
2
|
/** Status of a single key in a three-way merge. */
|
|
3
3
|
export type MergeKeyStatus = "unchanged" | "ours" | "theirs" | "both_added" | "conflict";
|
|
4
4
|
/** One key's resolution in the three-way merge. */
|
|
@@ -43,7 +43,7 @@ export interface MergeResult {
|
|
|
43
43
|
*/
|
|
44
44
|
export declare class SopsMergeDriver {
|
|
45
45
|
private readonly sopsClient;
|
|
46
|
-
constructor(sopsClient:
|
|
46
|
+
constructor(sopsClient: MergeDecrypter);
|
|
47
47
|
/**
|
|
48
48
|
* Perform a three-way merge on three in-memory key/value maps.
|
|
49
49
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/merge/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/merge/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AC;CAS/F"}
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function mergeMetadataContents(oursContent: string, theirsContent: string): string;
|
|
10
10
|
/**
|
|
11
|
-
* Filesystem wrapper around
|
|
12
|
-
* theirs, writes the merged result back to `oursPath` (the
|
|
13
|
-
* destination git passes as `%A`). Does not read
|
|
14
|
-
* merge algorithm's docstring for why a base
|
|
11
|
+
* Filesystem wrapper around `mergeMetadataContents` (internal). Reads
|
|
12
|
+
* ours and theirs, writes the merged result back to `oursPath` (the
|
|
13
|
+
* conventional destination git passes as `%A`). Does not read
|
|
14
|
+
* `basePath` — see the merge algorithm's docstring for why a base
|
|
15
|
+
* revision is not needed.
|
|
15
16
|
*/
|
|
16
17
|
export declare function mergeMetadataFiles(_basePath: string, oursPath: string, theirsPath: string): void;
|
|
17
18
|
//# sourceMappingURL=metadata-driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-driver.d.ts","sourceRoot":"","sources":["../../src/merge/metadata-driver.ts"],"names":[],"mappings":"AAgNA;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAQxF;AAED
|
|
1
|
+
{"version":3,"file":"metadata-driver.d.ts","sourceRoot":"","sources":["../../src/merge/metadata-driver.ts"],"names":[],"mappings":"AAgNA;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAQxF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAKhG"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BackendType, ClefManifest,
|
|
1
|
+
import { BackendType, ClefManifest, EnvironmentSopsOverride } from "../types";
|
|
2
|
+
import type { SecretSource } from "../source/types";
|
|
2
3
|
import { MatrixManager } from "../matrix/manager";
|
|
3
4
|
import { TransactionManager } from "../tx";
|
|
4
5
|
export interface MigrationTarget {
|
|
@@ -43,19 +44,21 @@ export declare const BACKEND_KEY_FIELDS: Record<BackendType, keyof EnvironmentSo
|
|
|
43
44
|
*/
|
|
44
45
|
export declare function buildSopsOverride(backend: BackendType, key: string | undefined): EnvironmentSopsOverride;
|
|
45
46
|
export declare class BackendMigrator {
|
|
47
|
+
private readonly buildSource;
|
|
46
48
|
private readonly matrixManager;
|
|
47
49
|
private readonly tx;
|
|
48
|
-
private readonly decryptBackend;
|
|
49
|
-
private readonly encryptBackend;
|
|
50
50
|
/**
|
|
51
|
-
* @param
|
|
51
|
+
* @param buildSource - Factory that builds a `SecretSource` bound to a
|
|
52
|
+
* given manifest. Called twice during a real migration: once with the
|
|
53
|
+
* pre-migration manifest (for classification + decrypt) and once with
|
|
54
|
+
* the post-mutation manifest (for re-encrypt + verify). The factory
|
|
55
|
+
* pattern is required because the encryption layer of a composed
|
|
56
|
+
* source is bound to a manifest at construction.
|
|
52
57
|
* @param matrixManager - Matrix resolver.
|
|
53
58
|
* @param tx - Transaction manager that wraps the migration in a single git commit
|
|
54
59
|
* so a partial failure rolls back ALL files + the manifest via `git reset --hard`.
|
|
55
|
-
* @param targetEncryption - Optional separate backend for encrypt. Use when migrating
|
|
56
|
-
* from cloud (decrypt via keyservice) to another backend (encrypt via local credentials).
|
|
57
60
|
*/
|
|
58
|
-
constructor(
|
|
61
|
+
constructor(buildSource: (manifest: ClefManifest) => SecretSource, matrixManager: MatrixManager, tx: TransactionManager);
|
|
59
62
|
migrate(manifest: ClefManifest, repoRoot: string, options: MigrationOptions, onProgress?: (event: MigrationProgressEvent) => void): Promise<MigrationResult>;
|
|
60
63
|
private updateManifestDoc;
|
|
61
64
|
private checkAgeRecipientsWarning;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/migration/backend.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/migration/backend.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,uBAAuB,EAGxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,gFAAgF;IAChF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,eAAe,CAAC;IACxB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAID;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,uBAAuB,GAAG,SAA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AAmB;IAC9B,QAAQ,CAAC,WAAW,sEAAsE;IAE1F,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAY7C,IAAI,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"json-envelope.d.ts","sourceRoot":"","sources":["../../../src/pack/backends/json-envelope.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,YAAW,WAAW;IACrD,QAAQ,CAAC,EAAE,mBAAmB;IAC9B,QAAQ,CAAC,WAAW,sEAAsE;IAE1F,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAY7C,IAAI,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA0BzD"}
|
package/dist/pack/types.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import type { ClefManifest,
|
|
1
|
+
import type { ClefManifest, SubprocessRunner } from "../types";
|
|
2
2
|
import type { KmsProvider } from "../kms";
|
|
3
3
|
import type { PackResult } from "../artifact/types";
|
|
4
|
+
import type { SecretSource } from "../source/types";
|
|
4
5
|
/**
|
|
5
6
|
* Shared services a PackBackend may use. A backend is free to ignore any
|
|
6
7
|
* field it does not need.
|
|
7
8
|
*/
|
|
8
9
|
export interface PackServices {
|
|
9
|
-
/**
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Plaintext-cell access to the matrix. Backends call `source.readCell`
|
|
12
|
+
* (typically via the shared `resolveIdentitySecrets` helper) to fetch
|
|
13
|
+
* decrypted values for an identity's scoped namespaces × environment.
|
|
14
|
+
* Encryption substrate is opaque to the backend.
|
|
15
|
+
*/
|
|
16
|
+
source: SecretSource;
|
|
11
17
|
/** KMS provider, already constructed. Undefined when the manifest does not require one. */
|
|
12
18
|
kms?: KmsProvider;
|
|
13
19
|
/** For subprocess access (git, external CLIs). Prefer this over child_process. */
|
package/dist/pack/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pack/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pack/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB,2FAA2F;IAC3F,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB,kFAAkF;IAClF,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,QAAQ,EAAE,YAAY,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,QAAQ,EAAE,YAAY,CAAC;IACvB,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,eAAe,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrD;;;OAGG;IACH,IAAI,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACpD;AAED,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -21,8 +21,6 @@ interface CellMetadata {
|
|
|
21
21
|
pending: PendingKey[];
|
|
22
22
|
rotations: RotationRecord[];
|
|
23
23
|
}
|
|
24
|
-
/** @deprecated Use {@link CellMetadata}. Retained for external import compatibility. */
|
|
25
|
-
type PendingMetadata = CellMetadata;
|
|
26
24
|
/**
|
|
27
25
|
* Derive the `.clef-meta.yaml` path from an `.enc.yaml` path.
|
|
28
26
|
* Example: `database/dev.enc.yaml` → `database/dev.clef-meta.yaml`
|
|
@@ -67,5 +65,5 @@ declare function generateRandomValue(): string;
|
|
|
67
65
|
* Same as {@link markPending} but retries once after `retryDelayMs` on transient failure.
|
|
68
66
|
*/
|
|
69
67
|
declare function markPendingWithRetry(filePath: string, keys: string[], setBy: string, retryDelayMs?: number): Promise<void>;
|
|
70
|
-
export { PendingKey, RotationRecord, CellMetadata,
|
|
68
|
+
export { PendingKey, RotationRecord, CellMetadata, metadataPath, loadMetadata, saveMetadata, markPending, markPendingWithRetry, markResolved, getPendingKeys, isPending, recordRotation, removeRotation, getRotations, generateRandomValue, };
|
|
71
69
|
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/pending/metadata.ts"],"names":[],"mappings":"AAoCA,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,IAAI,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,UAAU,YAAY;IACpB,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/pending/metadata.ts"],"names":[],"mappings":"AAoCA,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,IAAI,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,E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O,CAAC,IAAI,CAAC,CAI7E;AAED,mFAAmF;AACnF,iBAAe,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAGvE;AAED,kGAAkG;AAClG,iBAAS,mBAAmB,IAAI,MAAM,CAErC;AAED;;GAEG;AACH,iBAAe,oBAAoB,CACjC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,EACb,YAAY,SAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,SAAS,EACT,cAAc,EACd,cAAc,EACd,YAAY,EACZ,mBAAmB,GACpB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ClefManifest
|
|
1
|
+
import { ClefManifest } from "../types";
|
|
2
|
+
import type { Rotatable, SecretSource } from "../source/types";
|
|
2
3
|
import { MatrixManager } from "../matrix/manager";
|
|
3
4
|
import { TransactionManager } from "../tx";
|
|
4
5
|
export interface Recipient {
|
|
@@ -28,10 +29,10 @@ export interface RecipientsResult {
|
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
31
|
export declare class RecipientManager {
|
|
31
|
-
private readonly
|
|
32
|
+
private readonly source;
|
|
32
33
|
private readonly matrixManager;
|
|
33
34
|
private readonly tx;
|
|
34
|
-
constructor(
|
|
35
|
+
constructor(source: SecretSource & Rotatable, matrixManager: MatrixManager, tx: TransactionManager);
|
|
35
36
|
/**
|
|
36
37
|
* List all age recipients declared in the manifest.
|
|
37
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recipients/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,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,OAAO,CAAC,gBAAgB,CAAC;IA2E5B;;;;;;;;;;OAUG;IACG,MAAM,CACV,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,CAAC;CAkE7B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ClefReport,
|
|
1
|
+
import { ClefReport, SubprocessRunner } from "../types";
|
|
2
2
|
import { MatrixManager } from "../matrix/manager";
|
|
3
3
|
import { SchemaValidator } from "../schema/validator";
|
|
4
|
+
import type { Lintable, SecretSource } from "../source/types";
|
|
4
5
|
/**
|
|
5
6
|
* Orchestrates all data-gathering for a `clef report` invocation.
|
|
6
7
|
* Matrix key counts are read from SOPS YAML directly (no decryption).
|
|
@@ -8,10 +9,10 @@ import { SchemaValidator } from "../schema/validator";
|
|
|
8
9
|
*/
|
|
9
10
|
export declare class ReportGenerator {
|
|
10
11
|
private readonly runner;
|
|
11
|
-
private readonly
|
|
12
|
+
private readonly source;
|
|
12
13
|
private readonly matrixManager;
|
|
13
14
|
private readonly schemaValidator;
|
|
14
|
-
constructor(runner: SubprocessRunner,
|
|
15
|
+
constructor(runner: SubprocessRunner, source: SecretSource & Lintable, matrixManager: MatrixManager, schemaValidator: SchemaValidator);
|
|
15
16
|
/**
|
|
16
17
|
* Generate a full {@link ClefReport} for the given repository root.
|
|
17
18
|
* Each section gathers data independently — partial failures return empty
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/report/generator.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,UAAU,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/report/generator.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,UAAU,EASV,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKtD,OAAO,KAAK,EAAW,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvE;;;;GAIG;AACH,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAHf,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,YAAY,GAAG,QAAQ,EAC/B,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe;IAGnD;;;;;;;;OAQG;IACG,QAAQ,CACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GACrE,OAAO,CAAC,UAAU,CAAC;YAwCR,iBAAiB;IAwD/B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,sBAAsB;YAiBhB,gBAAgB;YAuBhB,SAAS;IA+CvB,OAAO,CAAC,YAAY;YAIN,WAAW;IAUzB,OAAO,CAAC,eAAe;IAmCvB,OAAO,CAAC,kBAAkB;CAM3B"}
|
package/dist/reset/manager.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BackendType, ClefManifest
|
|
1
|
+
import { BackendType, ClefManifest } from "../types";
|
|
2
|
+
import type { SecretSource } from "../source/types";
|
|
2
3
|
import { MatrixManager } from "../matrix/manager";
|
|
3
4
|
import { SchemaValidator } from "../schema/validator";
|
|
4
5
|
import { TransactionManager } from "../tx";
|
|
@@ -68,10 +69,27 @@ export interface ResetResult {
|
|
|
68
69
|
*/
|
|
69
70
|
export declare class ResetManager {
|
|
70
71
|
private readonly matrixManager;
|
|
71
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Factory rather than a single instance because reset can swap the
|
|
74
|
+
* SOPS backend mid-transaction (`opts.backend`). The encryption
|
|
75
|
+
* layer of a composed source is bound to a manifest at construction,
|
|
76
|
+
* so writing cells under the *new* backend requires a fresh source.
|
|
77
|
+
* Callers pass `(m) => composeSecretSource(storage(m), enc, m)` (or
|
|
78
|
+
* equivalent) so the manager can recompose after the manifest swap.
|
|
79
|
+
*/
|
|
80
|
+
private readonly buildSource;
|
|
72
81
|
private readonly schemaValidator;
|
|
73
82
|
private readonly tx;
|
|
74
|
-
constructor(matrixManager: MatrixManager,
|
|
83
|
+
constructor(matrixManager: MatrixManager,
|
|
84
|
+
/**
|
|
85
|
+
* Factory rather than a single instance because reset can swap the
|
|
86
|
+
* SOPS backend mid-transaction (`opts.backend`). The encryption
|
|
87
|
+
* layer of a composed source is bound to a manifest at construction,
|
|
88
|
+
* so writing cells under the *new* backend requires a fresh source.
|
|
89
|
+
* Callers pass `(m) => composeSecretSource(storage(m), enc, m)` (or
|
|
90
|
+
* equivalent) so the manager can recompose after the manifest swap.
|
|
91
|
+
*/
|
|
92
|
+
buildSource: (manifest: ClefManifest) => SecretSource, schemaValidator: SchemaValidator, tx: TransactionManager);
|
|
75
93
|
reset(opts: ResetOptions, manifest: ClefManifest, repoRoot: string): Promise<ResetResult>;
|
|
76
94
|
/**
|
|
77
95
|
* Resolve the scope into an explicit list of cells. Assumes the scope has
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/reset/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/reset/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAc,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,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AkB;IAGnC,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAwF/F;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAcpB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;CAkBvB;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CASvD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE;IAAE,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,GAC7E,IAAI,CA2BN"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ClefManifest,
|
|
1
|
+
import { ClefManifest, KmsConfig, ServiceIdentityDefinition, ServiceIdentityDriftIssue } from "../types";
|
|
2
|
+
import type { Rotatable, SecretSource } from "../source/types";
|
|
2
3
|
import { MatrixManager } from "../matrix/manager";
|
|
3
4
|
import { TransactionManager } from "../tx";
|
|
4
5
|
/** Options for creating a new service identity. */
|
|
@@ -26,10 +27,12 @@ export interface CreateServiceIdentityOptions {
|
|
|
26
27
|
* ```
|
|
27
28
|
*/
|
|
28
29
|
export declare class ServiceIdentityManager {
|
|
29
|
-
private readonly
|
|
30
|
+
private readonly source;
|
|
30
31
|
private readonly matrixManager;
|
|
31
32
|
private readonly tx;
|
|
32
|
-
constructor(
|
|
33
|
+
constructor(source: SecretSource & Rotatable, matrixManager: MatrixManager, tx: TransactionManager);
|
|
34
|
+
/** Helper: cell → ref for the source seam. */
|
|
35
|
+
private ref;
|
|
33
36
|
/**
|
|
34
37
|
* Compute repo-relative paths for a set of cells plus the manifest. Used
|
|
35
38
|
* to seed TransactionManager.run's `paths` argument.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/service-identity/manager.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/service-identity/manager.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,SAAS,EAET,yBAAyB,EACzB,yBAAyB,EAG1B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAW,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,mDAAmD;AACnD,MAAM,WAAW,4BAA4B;IAC3C,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1C,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,sBAAsB;IAE/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAFF,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,aAAa,EAAE,aAAa,EAC5B,EAAE,EAAE,kBAAkB;IAGzC,8CAA8C;IAC9C,OAAO,CAAC,GAAG;IAIX;;;OAGG;IACH,OAAO,CAAC,OAAO;IAIf;;;;;OAKG;IACG,MAAM,CACV,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAAE,EACpB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,EACh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