@parmana/crypto 0.1.1 → 2.0.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 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/CallerAuditChainVerifier.d.ts +2 -2
- package/dist/CallerAuditChainVerifier.js +1 -1
- package/dist/ExecutionTrustRecordCanonicalView.d.ts +1 -1
- package/dist/ExecutionTrustRecordCanonicalView.js +1 -1
- package/dist/KeyProvider.d.ts +2 -2
- package/dist/KeyProvider.js +1 -1
- package/dist/OfflineVerifier.js +2 -2
- package/dist/Signer.d.ts +1 -1
- package/dist/SignerBootstrap.d.ts +1 -1
- package/dist/SignerBootstrap.js +1 -1
- package/dist/VerificationCrypto.d.ts +2 -2
- package/dist/VerificationCrypto.js +2 -2
- package/dist/providers/key/FileKeyProvider.d.ts +1 -1
- package/dist/providers/key/FileKeyProvider.js +1 -1
- package/package.json +7 -7
|
@@ -2,7 +2,7 @@ import type { Signature } from "@parmana/shared";
|
|
|
2
2
|
/**
|
|
3
3
|
* One caller_audit_events row, in the shape a verifier reads it back:
|
|
4
4
|
* the original CallerAuditEvent-shaped fields (occurredAt, callerId,
|
|
5
|
-
* etc, exactly as
|
|
5
|
+
* etc, exactly as PostgresCallerAuditSink.record() received them —
|
|
6
6
|
* never including storage-only fields like a database row id), plus
|
|
7
7
|
* the signature and chain columns that sit alongside it.
|
|
8
8
|
*/
|
|
@@ -19,7 +19,7 @@ export interface CallerAuditChainVerificationResult {
|
|
|
19
19
|
readonly reason?: string;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Verifies one caller's full audit chain (
|
|
22
|
+
* Verifies one caller's full audit chain (PostgresCallerAuditSink's
|
|
23
23
|
* per-caller chaining): each row's signature against its own
|
|
24
24
|
* recomputed content -- including the previousChainHash/chainPosition
|
|
25
25
|
* fields folded into what was actually signed -- and that each row's
|
|
@@ -2,7 +2,7 @@ import { AuditEventCrypto } from "./AuditEventCrypto.js";
|
|
|
2
2
|
import { CryptoBootstrap } from "./CryptoBootstrap.js";
|
|
3
3
|
import { TrustRecordHasher } from "./TrustRecordHasher.js";
|
|
4
4
|
/**
|
|
5
|
-
* Verifies one caller's full audit chain (
|
|
5
|
+
* Verifies one caller's full audit chain (PostgresCallerAuditSink's
|
|
6
6
|
* per-caller chaining): each row's signature against its own
|
|
7
7
|
* recomputed content -- including the previousChainHash/chainPosition
|
|
8
8
|
* fields folded into what was actually signed -- and that each row's
|
|
@@ -12,7 +12,7 @@ import type { ExecutionTrustRecord } from "@parmana/shared";
|
|
|
12
12
|
* their own right -- exactly the kind of drift a third-party verifier
|
|
13
13
|
* must never have to guess at.
|
|
14
14
|
*
|
|
15
|
-
* PQC audit RED-1 (docs/VERIFICATION-GAPS.md): before this file
|
|
15
|
+
* PQC audit RED-1 (docs/internal/VERIFICATION-GAPS.md): before this file
|
|
16
16
|
* existed, this mapping lived only as a private method on
|
|
17
17
|
* VerificationCrypto, so a third party had no way to reconstruct it
|
|
18
18
|
* without reading this repository's source directly. A separately
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* their own right -- exactly the kind of drift a third-party verifier
|
|
12
12
|
* must never have to guess at.
|
|
13
13
|
*
|
|
14
|
-
* PQC audit RED-1 (docs/VERIFICATION-GAPS.md): before this file
|
|
14
|
+
* PQC audit RED-1 (docs/internal/VERIFICATION-GAPS.md): before this file
|
|
15
15
|
* existed, this mapping lived only as a private method on
|
|
16
16
|
* VerificationCrypto, so a third party had no way to reconstruct it
|
|
17
17
|
* without reading this repository's source directly. A separately
|
package/dist/KeyProvider.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare const DEFAULT_SECONDARY_KEY_ID = "default-secondary";
|
|
|
22
22
|
* Resolves the keyId that VerificationCrypto/RefusalCrypto/
|
|
23
23
|
* AuditEventCrypto -- the durable-evidence signers (Trust Records,
|
|
24
24
|
* Refusal Records, Audit Events) -- use for NEW signatures (PQC audit
|
|
25
|
-
* RED-3, docs/VERIFICATION-GAPS.md). Every one of these three signers
|
|
25
|
+
* RED-3, docs/internal/VERIFICATION-GAPS.md). Every one of these three signers
|
|
26
26
|
* previously hardcoded DEFAULT_KEY_ID directly, so the only way to
|
|
27
27
|
* "rotate" was to overwrite default.private.pem/default.public.pem in
|
|
28
28
|
* place -- which silently invalidates every record ever signed under
|
|
@@ -80,7 +80,7 @@ export interface KeyProvider {
|
|
|
80
80
|
hasKey(keyId: string): Promise<boolean>;
|
|
81
81
|
/**
|
|
82
82
|
* Lists every keyId this provider can currently load a public key
|
|
83
|
-
* for (PQC audit RED-2, docs/VERIFICATION-GAPS.md) -- used by the
|
|
83
|
+
* for (PQC audit RED-2, docs/internal/VERIFICATION-GAPS.md) -- used by the
|
|
84
84
|
* key-discovery endpoints (packages/api/src/routes/keys.ts) to
|
|
85
85
|
* enumerate every key an auditor might need, not only whichever one
|
|
86
86
|
* happens to be "current."
|
package/dist/KeyProvider.js
CHANGED
|
@@ -20,7 +20,7 @@ export const DEFAULT_SECONDARY_KEY_ID = "default-secondary";
|
|
|
20
20
|
* Resolves the keyId that VerificationCrypto/RefusalCrypto/
|
|
21
21
|
* AuditEventCrypto -- the durable-evidence signers (Trust Records,
|
|
22
22
|
* Refusal Records, Audit Events) -- use for NEW signatures (PQC audit
|
|
23
|
-
* RED-3, docs/VERIFICATION-GAPS.md). Every one of these three signers
|
|
23
|
+
* RED-3, docs/internal/VERIFICATION-GAPS.md). Every one of these three signers
|
|
24
24
|
* previously hardcoded DEFAULT_KEY_ID directly, so the only way to
|
|
25
25
|
* "rotate" was to overwrite default.private.pem/default.public.pem in
|
|
26
26
|
* place -- which silently invalidates every record ever signed under
|
package/dist/OfflineVerifier.js
CHANGED
|
@@ -8,7 +8,7 @@ import { SignatureVerifier } from "./SignatureVerifier.js";
|
|
|
8
8
|
import { TrustRecordHasher } from "./TrustRecordHasher.js";
|
|
9
9
|
/**
|
|
10
10
|
* Standalone, offline verification of an Execution Trust Record
|
|
11
|
-
* (PQC audit RED-1, docs/VERIFICATION-GAPS.md).
|
|
11
|
+
* (PQC audit RED-1, docs/internal/VERIFICATION-GAPS.md).
|
|
12
12
|
*
|
|
13
13
|
* Zero network calls, zero disk reads, zero environment variables.
|
|
14
14
|
* Callers supply the exact public key material for every keyId a
|
|
@@ -34,7 +34,7 @@ import { TrustRecordHasher } from "./TrustRecordHasher.js";
|
|
|
34
34
|
* SignatureRegistry (CryptoBootstrap.ts) registers -- "ecdsa-p256",
|
|
35
35
|
* "dilithium5", and "sphincs-plus" are declared as valid
|
|
36
36
|
* PRIMARY_SIGNATURE_PROVIDER config values elsewhere in this codebase
|
|
37
|
-
* but have no real implementation anywhere (see docs/REMAINING-WORK.md, section D);
|
|
37
|
+
* but have no real implementation anywhere (see docs/internal/REMAINING-WORK.md, section D);
|
|
38
38
|
* an offline verifier claiming to support them would be worse than
|
|
39
39
|
* refusing outright.
|
|
40
40
|
*/
|
package/dist/Signer.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { KeyMetadata } from "./KeyProvider.js";
|
|
|
9
9
|
* cannot be implemented honestly against such a
|
|
10
10
|
* backend, since the whole point of those backends is that the
|
|
11
11
|
* private key never leaves them. ADR-0009
|
|
12
|
-
* (docs/adr/ADR-0009-KMS-Secrets-And-Connector-Signature-Hardening.md)
|
|
12
|
+
* (docs/internal/adr/ADR-0009-KMS-Secrets-And-Connector-Signature-Hardening.md)
|
|
13
13
|
* is the design this interface exists for.
|
|
14
14
|
*
|
|
15
15
|
* Read operations (getPublicKey/getMetadata/hasKey/listKeys) are
|
|
@@ -21,7 +21,7 @@ import type { Signer } from "./Signer.js";
|
|
|
21
21
|
* `loadConfig().keys.keyDirectory` (and so the current
|
|
22
22
|
* PARMANA_KEY_DIR) fresh every time. A static singleton here broke
|
|
23
23
|
* that -- caught by a real CI failure
|
|
24
|
-
* (packages/api/tests/unit/
|
|
24
|
+
* (packages/api/tests/unit/postgres-caller-audit-sink.test.ts), where
|
|
25
25
|
* each test sets PARMANA_KEY_DIR to its own temp directory and tears
|
|
26
26
|
* it down in afterEach: the first test to run would permanently poison
|
|
27
27
|
* a process-wide cached signer pointing at a directory every
|
package/dist/SignerBootstrap.js
CHANGED
|
@@ -24,7 +24,7 @@ import { LocalFileSigner } from "./providers/signer/LocalFileSigner.js";
|
|
|
24
24
|
* `loadConfig().keys.keyDirectory` (and so the current
|
|
25
25
|
* PARMANA_KEY_DIR) fresh every time. A static singleton here broke
|
|
26
26
|
* that -- caught by a real CI failure
|
|
27
|
-
* (packages/api/tests/unit/
|
|
27
|
+
* (packages/api/tests/unit/postgres-caller-audit-sink.test.ts), where
|
|
28
28
|
* each test sets PARMANA_KEY_DIR to its own temp directory and tears
|
|
29
29
|
* it down in afterEach: the first test to run would permanently poison
|
|
30
30
|
* a process-wide cached signer pointing at a directory every
|
|
@@ -64,7 +64,7 @@ export declare class VerificationCrypto {
|
|
|
64
64
|
*/
|
|
65
65
|
sign(trustRecord: ExecutionTrustRecord): Promise<Signature>;
|
|
66
66
|
/**
|
|
67
|
-
* Signing readiness probe (docs/VERIFICATION-GAPS.md G-52).
|
|
67
|
+
* Signing readiness probe (docs/internal/VERIFICATION-GAPS.md G-52).
|
|
68
68
|
*
|
|
69
69
|
* Proves, before an action is released, that the evidence signing path
|
|
70
70
|
* can currently produce a signature that verifies. It signs a synthetic
|
|
@@ -102,7 +102,7 @@ export declare class VerificationCrypto {
|
|
|
102
102
|
* fails here even if the legacy `signature` alone is valid: never a
|
|
103
103
|
* silent downgrade to single-signature verification.
|
|
104
104
|
*
|
|
105
|
-
* PQC audit RED-4 (docs/VERIFICATION-GAPS.md): by itself, the
|
|
105
|
+
* PQC audit RED-4 (docs/internal/VERIFICATION-GAPS.md): by itself, the
|
|
106
106
|
* paragraph above only protects a record that still *carries* its
|
|
107
107
|
* `signatures` array -- nothing stopped `signatures` from being
|
|
108
108
|
* stripped entirely, at which point this method fell back to
|
|
@@ -100,7 +100,7 @@ export class VerificationCrypto {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
* Signing readiness probe (docs/VERIFICATION-GAPS.md G-52).
|
|
103
|
+
* Signing readiness probe (docs/internal/VERIFICATION-GAPS.md G-52).
|
|
104
104
|
*
|
|
105
105
|
* Proves, before an action is released, that the evidence signing path
|
|
106
106
|
* can currently produce a signature that verifies. It signs a synthetic
|
|
@@ -157,7 +157,7 @@ export class VerificationCrypto {
|
|
|
157
157
|
* fails here even if the legacy `signature` alone is valid: never a
|
|
158
158
|
* silent downgrade to single-signature verification.
|
|
159
159
|
*
|
|
160
|
-
* PQC audit RED-4 (docs/VERIFICATION-GAPS.md): by itself, the
|
|
160
|
+
* PQC audit RED-4 (docs/internal/VERIFICATION-GAPS.md): by itself, the
|
|
161
161
|
* paragraph above only protects a record that still *carries* its
|
|
162
162
|
* `signatures` array -- nothing stopped `signatures` from being
|
|
163
163
|
* stripped entirely, at which point this method fell back to
|
|
@@ -31,7 +31,7 @@ export declare class FileKeyProvider implements KeyProvider {
|
|
|
31
31
|
/**
|
|
32
32
|
* Returns key metadata.
|
|
33
33
|
*
|
|
34
|
-
* PQC audit RED-2 (docs/VERIFICATION-GAPS.md) fix: algorithm is
|
|
34
|
+
* PQC audit RED-2 (docs/internal/VERIFICATION-GAPS.md) fix: algorithm is
|
|
35
35
|
* derived from the actual public key material's own
|
|
36
36
|
* `asymmetricKeyType`, not from `config.crypto.primarySignatureProvider`
|
|
37
37
|
* as this method previously did. That global config value describes
|
|
@@ -70,7 +70,7 @@ export class FileKeyProvider {
|
|
|
70
70
|
/**
|
|
71
71
|
* Returns key metadata.
|
|
72
72
|
*
|
|
73
|
-
* PQC audit RED-2 (docs/VERIFICATION-GAPS.md) fix: algorithm is
|
|
73
|
+
* PQC audit RED-2 (docs/internal/VERIFICATION-GAPS.md) fix: algorithm is
|
|
74
74
|
* derived from the actual public key material's own
|
|
75
75
|
* `asymmetricKeyType`, not from `config.crypto.primarySignatureProvider`
|
|
76
76
|
* as this method previously did. That global config value describes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parmana/crypto",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Parmana Crypto Module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,21 +23,21 @@
|
|
|
23
23
|
"test": "vitest run"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/client-kms": "^3.
|
|
27
|
-
"@parmana/shared": "0.
|
|
28
|
-
"@vercel/oidc-aws-credentials-provider": "^3.3.
|
|
26
|
+
"@aws-sdk/client-kms": "^3.1162.0",
|
|
27
|
+
"@parmana/shared": "2.0.0",
|
|
28
|
+
"@vercel/oidc-aws-credentials-provider": "^3.3.18",
|
|
29
29
|
"express": "^5.3.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@eslint/js": "^10.0.1",
|
|
33
33
|
"@types/express": "^5.0.6",
|
|
34
34
|
"@types/node": "^24.19.2",
|
|
35
|
-
"dotenv": "^18.0.
|
|
36
|
-
"eslint": "^10.
|
|
35
|
+
"dotenv": "^18.0.9",
|
|
36
|
+
"eslint": "^10.14.0",
|
|
37
37
|
"eslint-config-prettier": "^10.1.8",
|
|
38
38
|
"tsx": "^4.23.15",
|
|
39
39
|
"typescript": "^6.0.3",
|
|
40
|
-
"typescript-eslint": "^8.72.
|
|
40
|
+
"typescript-eslint": "^8.72.1",
|
|
41
41
|
"vitest": "^5.0.3"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|