@agimon-ai/doompi-web-security 0.0.1-alpha.19 → 0.0.1-alpha.25
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/adapters/browserBundleVerifier.d.cts +6 -7
- package/dist/adapters/browserBundleVerifier.d.cts.map +1 -1
- package/dist/adapters/browserBundleVerifier.d.mts +6 -7
- package/dist/adapters/browserBundleVerifier.d.mts.map +1 -1
- package/dist/adapters/browserSealedChannel.d.cts +5 -6
- package/dist/adapters/browserSealedChannel.d.cts.map +1 -1
- package/dist/adapters/browserSealedChannel.d.mts +5 -6
- package/dist/adapters/browserSealedChannel.d.mts.map +1 -1
- package/dist/adapters/bundleSigner.d.cts +3 -4
- package/dist/adapters/bundleSigner.d.cts.map +1 -1
- package/dist/adapters/bundleSigner.d.mts +3 -4
- package/dist/adapters/bundleSigner.d.mts.map +1 -1
- package/dist/adapters/nodeSealedChannel.d.cts +5 -6
- package/dist/adapters/nodeSealedChannel.d.cts.map +1 -1
- package/dist/adapters/nodeSealedChannel.d.mts +5 -6
- package/dist/adapters/nodeSealedChannel.d.mts.map +1 -1
- package/dist/adapters/sealedTransport.d.cts +3 -4
- package/dist/adapters/sealedTransport.d.cts.map +1 -1
- package/dist/adapters/sealedTransport.d.mts +3 -4
- package/dist/adapters/sealedTransport.d.mts.map +1 -1
- package/dist/services/serialQueue.d.cts +2 -3
- package/dist/services/serialQueue.d.cts.map +1 -1
- package/dist/services/serialQueue.d.mts +2 -3
- package/dist/services/serialQueue.d.mts.map +1 -1
- package/dist/types/bundleManifest.d.cts +10 -11
- package/dist/types/bundleManifest.d.cts.map +1 -1
- package/dist/types/bundleManifest.d.mts +10 -11
- package/dist/types/bundleManifest.d.mts.map +1 -1
- package/dist/types/sealedChannel.d.cts +16 -17
- package/dist/types/sealedChannel.d.cts.map +1 -1
- package/dist/types/sealedChannel.d.mts +16 -17
- package/dist/types/sealedChannel.d.mts.map +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BundleManifest } from "../types/bundleManifest.cjs";
|
|
2
2
|
//#region src/adapters/browserBundleVerifier.d.ts
|
|
3
|
-
type BundleVerificationFailure = {
|
|
3
|
+
export type BundleVerificationFailure = {
|
|
4
4
|
code: 'invalid-envelope';
|
|
5
5
|
} | {
|
|
6
6
|
code: 'untrusted-public-key';
|
|
@@ -13,14 +13,14 @@ type BundleVerificationFailure = {
|
|
|
13
13
|
} | {
|
|
14
14
|
code: 'invalid-signature';
|
|
15
15
|
};
|
|
16
|
-
type BundleVerificationResult = {
|
|
16
|
+
export type BundleVerificationResult = {
|
|
17
17
|
ok: true;
|
|
18
18
|
manifest: BundleManifest;
|
|
19
19
|
} | {
|
|
20
20
|
ok: false;
|
|
21
21
|
failure: BundleVerificationFailure;
|
|
22
22
|
};
|
|
23
|
-
type BundleAssetVerificationFailure = {
|
|
23
|
+
export type BundleAssetVerificationFailure = {
|
|
24
24
|
code: 'asset-not-listed';
|
|
25
25
|
path: string;
|
|
26
26
|
} | {
|
|
@@ -30,16 +30,15 @@ type BundleAssetVerificationFailure = {
|
|
|
30
30
|
} | {
|
|
31
31
|
code: 'digest-mismatch';
|
|
32
32
|
};
|
|
33
|
-
type BundleAssetVerificationResult = {
|
|
33
|
+
export type BundleAssetVerificationResult = {
|
|
34
34
|
ok: true;
|
|
35
35
|
} | {
|
|
36
36
|
ok: false;
|
|
37
37
|
failure: BundleAssetVerificationFailure;
|
|
38
38
|
};
|
|
39
39
|
/** Verifies a strict envelope against a separately trusted key and revision floor. */
|
|
40
|
-
declare function verifySignedBundleManifest(value: unknown, trustedPublicKey: string, minimumRevision?: number): Promise<BundleVerificationResult>;
|
|
40
|
+
export declare function verifySignedBundleManifest(value: unknown, trustedPublicKey: string, minimumRevision?: number): Promise<BundleVerificationResult>;
|
|
41
41
|
/** Verifies fetched raw response bytes against an authenticated manifest. */
|
|
42
|
-
declare function verifyBundleAsset(manifest: BundleManifest, assetPath: string, bytes: ArrayBuffer): Promise<BundleAssetVerificationResult>;
|
|
42
|
+
export declare function verifyBundleAsset(manifest: BundleManifest, assetPath: string, bytes: ArrayBuffer): Promise<BundleAssetVerificationResult>;
|
|
43
43
|
//#endregion
|
|
44
|
-
export { BundleAssetVerificationFailure, BundleAssetVerificationResult, BundleVerificationFailure, BundleVerificationResult, verifyBundleAsset, verifySignedBundleManifest };
|
|
45
44
|
//# sourceMappingURL=browserBundleVerifier.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserBundleVerifier.d.cts","names":[],"sources":["../../src/adapters/browserBundleVerifier.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"browserBundleVerifier.d.cts","names":[],"sources":["../../src/adapters/browserBundleVerifier.ts"],"mappings":";;YAQY;EACN;;EACA;;EACA;EAAwB;EAAyB;;EACjD;;EACA;;YAEM;EACN;EAAU,UAAU;;EACpB;EAAW,SAAS;;YAEd;EACN;EAA0B;;EAC1B;EAA8B;EAAkB;;EAChD;;YAEM;EAAkC;;EAAe;EAAW,SAAS;;;wBAgB3D,2BACpB,gBACA,0BACA,2BACC,QAAQ;;wBAsCW,kBACpB,UAAU,gBACV,mBACA,OAAO,cACN,QAAQ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BundleManifest } from "../types/bundleManifest.mjs";
|
|
2
2
|
//#region src/adapters/browserBundleVerifier.d.ts
|
|
3
|
-
type BundleVerificationFailure = {
|
|
3
|
+
export type BundleVerificationFailure = {
|
|
4
4
|
code: 'invalid-envelope';
|
|
5
5
|
} | {
|
|
6
6
|
code: 'untrusted-public-key';
|
|
@@ -13,14 +13,14 @@ type BundleVerificationFailure = {
|
|
|
13
13
|
} | {
|
|
14
14
|
code: 'invalid-signature';
|
|
15
15
|
};
|
|
16
|
-
type BundleVerificationResult = {
|
|
16
|
+
export type BundleVerificationResult = {
|
|
17
17
|
ok: true;
|
|
18
18
|
manifest: BundleManifest;
|
|
19
19
|
} | {
|
|
20
20
|
ok: false;
|
|
21
21
|
failure: BundleVerificationFailure;
|
|
22
22
|
};
|
|
23
|
-
type BundleAssetVerificationFailure = {
|
|
23
|
+
export type BundleAssetVerificationFailure = {
|
|
24
24
|
code: 'asset-not-listed';
|
|
25
25
|
path: string;
|
|
26
26
|
} | {
|
|
@@ -30,16 +30,15 @@ type BundleAssetVerificationFailure = {
|
|
|
30
30
|
} | {
|
|
31
31
|
code: 'digest-mismatch';
|
|
32
32
|
};
|
|
33
|
-
type BundleAssetVerificationResult = {
|
|
33
|
+
export type BundleAssetVerificationResult = {
|
|
34
34
|
ok: true;
|
|
35
35
|
} | {
|
|
36
36
|
ok: false;
|
|
37
37
|
failure: BundleAssetVerificationFailure;
|
|
38
38
|
};
|
|
39
39
|
/** Verifies a strict envelope against a separately trusted key and revision floor. */
|
|
40
|
-
declare function verifySignedBundleManifest(value: unknown, trustedPublicKey: string, minimumRevision?: number): Promise<BundleVerificationResult>;
|
|
40
|
+
export declare function verifySignedBundleManifest(value: unknown, trustedPublicKey: string, minimumRevision?: number): Promise<BundleVerificationResult>;
|
|
41
41
|
/** Verifies fetched raw response bytes against an authenticated manifest. */
|
|
42
|
-
declare function verifyBundleAsset(manifest: BundleManifest, assetPath: string, bytes: ArrayBuffer): Promise<BundleAssetVerificationResult>;
|
|
42
|
+
export declare function verifyBundleAsset(manifest: BundleManifest, assetPath: string, bytes: ArrayBuffer): Promise<BundleAssetVerificationResult>;
|
|
43
43
|
//#endregion
|
|
44
|
-
export { BundleAssetVerificationFailure, BundleAssetVerificationResult, BundleVerificationFailure, BundleVerificationResult, verifyBundleAsset, verifySignedBundleManifest };
|
|
45
44
|
//# sourceMappingURL=browserBundleVerifier.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserBundleVerifier.d.mts","names":[],"sources":["../../src/adapters/browserBundleVerifier.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"browserBundleVerifier.d.mts","names":[],"sources":["../../src/adapters/browserBundleVerifier.ts"],"mappings":";;YAQY;EACN;;EACA;;EACA;EAAwB;EAAyB;;EACjD;;EACA;;YAEM;EACN;EAAU,UAAU;;EACpB;EAAW,SAAS;;YAEd;EACN;EAA0B;;EAC1B;EAA8B;EAAkB;;EAChD;;YAEM;EAAkC;;EAAe;EAAW,SAAS;;;wBAgB3D,2BACpB,gBACA,0BACA,2BACC,QAAQ;;wBAsCW,kBACpB,UAAU,gBACV,mBACA,OAAO,cACN,QAAQ"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { SealedDirection, SealedEnvelope, SealedFailure } from "../types/sealedChannel.cjs";
|
|
2
2
|
//#region src/adapters/browserSealedChannel.d.ts
|
|
3
|
-
type SealResult = {
|
|
3
|
+
export type SealResult = {
|
|
4
4
|
ok: true;
|
|
5
5
|
envelope: SealedEnvelope;
|
|
6
6
|
} | {
|
|
7
7
|
ok: false;
|
|
8
8
|
failure: SealedFailure;
|
|
9
9
|
};
|
|
10
|
-
type OpenResult = {
|
|
10
|
+
export type OpenResult = {
|
|
11
11
|
ok: true;
|
|
12
12
|
plaintext: Uint8Array;
|
|
13
13
|
} | {
|
|
14
14
|
ok: false;
|
|
15
15
|
failure: SealedFailure;
|
|
16
16
|
};
|
|
17
|
-
interface SealedChannel {
|
|
17
|
+
export interface SealedChannel {
|
|
18
18
|
seal(plaintext: Uint8Array): Promise<SealResult>;
|
|
19
19
|
open(envelope: unknown): Promise<OpenResult>;
|
|
20
20
|
}
|
|
@@ -25,12 +25,11 @@ interface SealedChannel {
|
|
|
25
25
|
* authenticated: a relay can watch the client's public key go past and learn
|
|
26
26
|
* nothing, and it cannot substitute the host's because it never carried it.
|
|
27
27
|
*/
|
|
28
|
-
declare function connectSealedChannel(hostPublicKey: string): Promise<{
|
|
28
|
+
export declare function connectSealedChannel(hostPublicKey: string): Promise<{
|
|
29
29
|
channel: SealedChannel;
|
|
30
30
|
clientPublicKey: string;
|
|
31
31
|
} | undefined>;
|
|
32
32
|
/** Exposed so a test can build the browser side against a known secret. */
|
|
33
|
-
declare function channelFromSecret(secret: ArrayBuffer, sendDirection: SealedDirection, noncePrefix: Uint8Array): Promise<SealedChannel>;
|
|
33
|
+
export declare function channelFromSecret(secret: ArrayBuffer, sendDirection: SealedDirection, noncePrefix: Uint8Array): Promise<SealedChannel>;
|
|
34
34
|
//#endregion
|
|
35
|
-
export { OpenResult, SealResult, SealedChannel, channelFromSecret, connectSealedChannel };
|
|
36
35
|
//# sourceMappingURL=browserSealedChannel.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserSealedChannel.d.cts","names":[],"sources":["../../src/adapters/browserSealedChannel.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"browserSealedChannel.d.cts","names":[],"sources":["../../src/adapters/browserSealedChannel.ts"],"mappings":";;YA8BY;EAAe;EAAU,UAAU;;EAAqB;EAAW,SAAS;;YAC5E;EAAe;EAAU,WAAW;;EAAiB;EAAW,SAAS;;iBAEpE;EACf,KAAK,WAAW,aAAa,QAAQ;EACrC,KAAK,oBAAoB,QAAQ;;;;;;;;;wBA+Gb,qBACpB,wBACC;EAAU,SAAS;EAAe;;;wBAyBf,kBACpB,QAAQ,aACR,eAAe,iBACf,aAAa,aACZ,QAAQ"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { SealedDirection, SealedEnvelope, SealedFailure } from "../types/sealedChannel.mjs";
|
|
2
2
|
//#region src/adapters/browserSealedChannel.d.ts
|
|
3
|
-
type SealResult = {
|
|
3
|
+
export type SealResult = {
|
|
4
4
|
ok: true;
|
|
5
5
|
envelope: SealedEnvelope;
|
|
6
6
|
} | {
|
|
7
7
|
ok: false;
|
|
8
8
|
failure: SealedFailure;
|
|
9
9
|
};
|
|
10
|
-
type OpenResult = {
|
|
10
|
+
export type OpenResult = {
|
|
11
11
|
ok: true;
|
|
12
12
|
plaintext: Uint8Array;
|
|
13
13
|
} | {
|
|
14
14
|
ok: false;
|
|
15
15
|
failure: SealedFailure;
|
|
16
16
|
};
|
|
17
|
-
interface SealedChannel {
|
|
17
|
+
export interface SealedChannel {
|
|
18
18
|
seal(plaintext: Uint8Array): Promise<SealResult>;
|
|
19
19
|
open(envelope: unknown): Promise<OpenResult>;
|
|
20
20
|
}
|
|
@@ -25,12 +25,11 @@ interface SealedChannel {
|
|
|
25
25
|
* authenticated: a relay can watch the client's public key go past and learn
|
|
26
26
|
* nothing, and it cannot substitute the host's because it never carried it.
|
|
27
27
|
*/
|
|
28
|
-
declare function connectSealedChannel(hostPublicKey: string): Promise<{
|
|
28
|
+
export declare function connectSealedChannel(hostPublicKey: string): Promise<{
|
|
29
29
|
channel: SealedChannel;
|
|
30
30
|
clientPublicKey: string;
|
|
31
31
|
} | undefined>;
|
|
32
32
|
/** Exposed so a test can build the browser side against a known secret. */
|
|
33
|
-
declare function channelFromSecret(secret: ArrayBuffer, sendDirection: SealedDirection, noncePrefix: Uint8Array): Promise<SealedChannel>;
|
|
33
|
+
export declare function channelFromSecret(secret: ArrayBuffer, sendDirection: SealedDirection, noncePrefix: Uint8Array): Promise<SealedChannel>;
|
|
34
34
|
//#endregion
|
|
35
|
-
export { OpenResult, SealResult, SealedChannel, channelFromSecret, connectSealedChannel };
|
|
36
35
|
//# sourceMappingURL=browserSealedChannel.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserSealedChannel.d.mts","names":[],"sources":["../../src/adapters/browserSealedChannel.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"browserSealedChannel.d.mts","names":[],"sources":["../../src/adapters/browserSealedChannel.ts"],"mappings":";;YA8BY;EAAe;EAAU,UAAU;;EAAqB;EAAW,SAAS;;YAC5E;EAAe;EAAU,WAAW;;EAAiB;EAAW,SAAS;;iBAEpE;EACf,KAAK,WAAW,aAAa,QAAQ;EACrC,KAAK,oBAAoB,QAAQ;;;;;;;;;wBA+Gb,qBACpB,wBACC;EAAU,SAAS;EAAe;;;wBAyBf,kBACpB,QAAQ,aACR,eAAe,iBACf,aAAa,aACZ,QAAQ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SignedBundleManifest } from "../types/bundleManifest.cjs";
|
|
2
2
|
//#region src/adapters/bundleSigner.d.ts
|
|
3
|
-
interface BundleSigner {
|
|
3
|
+
export interface BundleSigner {
|
|
4
4
|
/** Base64url SPKI for an independently trusted verifier to pin. */
|
|
5
5
|
publicKey(): string;
|
|
6
6
|
/** Hashes and signs once per asset directory. Undefined when the bundle is empty. */
|
|
@@ -10,9 +10,8 @@ interface BundleSigner {
|
|
|
10
10
|
/** Invalidates one cached directory, or every cached directory when omitted. */
|
|
11
11
|
invalidate(assetsDir?: string): void;
|
|
12
12
|
}
|
|
13
|
-
declare function createBundleSigner(stateDir: string, _onNotice?: (message: string) => void): BundleSigner;
|
|
13
|
+
export declare function createBundleSigner(stateDir: string, _onNotice?: (message: string) => void): BundleSigner;
|
|
14
14
|
/** Re-derives the public key from a stored private key. */
|
|
15
|
-
declare function publicKeyOf(privateKeyPem: string): string;
|
|
15
|
+
export declare function publicKeyOf(privateKeyPem: string): string;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { BundleSigner, createBundleSigner, publicKeyOf };
|
|
18
17
|
//# sourceMappingURL=bundleSigner.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleSigner.d.cts","names":[],"sources":["../../src/adapters/bundleSigner.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"bundleSigner.d.cts","names":[],"sources":["../../src/adapters/bundleSigner.ts"],"mappings":";;iBA6CiB;;EAEf;;EAEA,KAAK,oBAAoB;;EAEzB,QAAQ,oBAAoB;;EAE5B,WAAW;;wBAsJG,mBAAmB,kBAAkB,aAAY,2BAAsC;;wBAoDvF,YAAY"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SignedBundleManifest } from "../types/bundleManifest.mjs";
|
|
2
2
|
//#region src/adapters/bundleSigner.d.ts
|
|
3
|
-
interface BundleSigner {
|
|
3
|
+
export interface BundleSigner {
|
|
4
4
|
/** Base64url SPKI for an independently trusted verifier to pin. */
|
|
5
5
|
publicKey(): string;
|
|
6
6
|
/** Hashes and signs once per asset directory. Undefined when the bundle is empty. */
|
|
@@ -10,9 +10,8 @@ interface BundleSigner {
|
|
|
10
10
|
/** Invalidates one cached directory, or every cached directory when omitted. */
|
|
11
11
|
invalidate(assetsDir?: string): void;
|
|
12
12
|
}
|
|
13
|
-
declare function createBundleSigner(stateDir: string, _onNotice?: (message: string) => void): BundleSigner;
|
|
13
|
+
export declare function createBundleSigner(stateDir: string, _onNotice?: (message: string) => void): BundleSigner;
|
|
14
14
|
/** Re-derives the public key from a stored private key. */
|
|
15
|
-
declare function publicKeyOf(privateKeyPem: string): string;
|
|
15
|
+
export declare function publicKeyOf(privateKeyPem: string): string;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { BundleSigner, createBundleSigner, publicKeyOf };
|
|
18
17
|
//# sourceMappingURL=bundleSigner.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleSigner.d.mts","names":[],"sources":["../../src/adapters/bundleSigner.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"bundleSigner.d.mts","names":[],"sources":["../../src/adapters/bundleSigner.ts"],"mappings":";;iBA6CiB;;EAEf;;EAEA,KAAK,oBAAoB;;EAEzB,QAAQ,oBAAoB;;EAE5B,WAAW;;wBAsJG,mBAAmB,kBAAkB,aAAY,2BAAsC;;wBAoDvF,YAAY"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { SealedEnvelope, SealedFailure } from "../types/sealedChannel.cjs";
|
|
2
2
|
//#region src/adapters/nodeSealedChannel.d.ts
|
|
3
|
-
type SealResult = {
|
|
3
|
+
export type SealResult = {
|
|
4
4
|
ok: true;
|
|
5
5
|
envelope: SealedEnvelope;
|
|
6
6
|
} | {
|
|
7
7
|
ok: false;
|
|
8
8
|
failure: SealedFailure;
|
|
9
9
|
};
|
|
10
|
-
type OpenResult = {
|
|
10
|
+
export type OpenResult = {
|
|
11
11
|
ok: true;
|
|
12
12
|
plaintext: Uint8Array;
|
|
13
13
|
} | {
|
|
14
14
|
ok: false;
|
|
15
15
|
failure: SealedFailure;
|
|
16
16
|
};
|
|
17
|
-
interface SealedChannel {
|
|
17
|
+
export interface SealedChannel {
|
|
18
18
|
/** Seals one message. Counters advance only on success. */
|
|
19
19
|
seal(plaintext: Uint8Array): SealResult;
|
|
20
20
|
open(envelope: unknown): OpenResult;
|
|
21
21
|
}
|
|
22
|
-
interface HostHandshake {
|
|
22
|
+
export interface HostHandshake {
|
|
23
23
|
/** Base64url uncompressed P-256 point, printed in the QR. */
|
|
24
24
|
publicKey: string;
|
|
25
25
|
/** Completes the exchange against the peer's key and yields the channel. */
|
|
@@ -34,7 +34,6 @@ interface HostHandshake {
|
|
|
34
34
|
* host, because the host only ever derives against the key the client presents
|
|
35
35
|
* and the client only ever derives against the key it read off the screen.
|
|
36
36
|
*/
|
|
37
|
-
declare function createHostHandshake(): HostHandshake;
|
|
37
|
+
export declare function createHostHandshake(): HostHandshake;
|
|
38
38
|
//#endregion
|
|
39
|
-
export { HostHandshake, OpenResult, SealResult, SealedChannel, createHostHandshake };
|
|
40
39
|
//# sourceMappingURL=nodeSealedChannel.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeSealedChannel.d.cts","names":[],"sources":["../../src/adapters/nodeSealedChannel.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"nodeSealedChannel.d.cts","names":[],"sources":["../../src/adapters/nodeSealedChannel.ts"],"mappings":";;YAqBY;EAAe;EAAU,UAAU;;EAAqB;EAAW,SAAS;;YAC5E;EAAe;EAAU,WAAW;;EAAiB;EAAW,SAAS;;iBAEpE;;EAEf,KAAK,WAAW,aAAa;EAC7B,KAAK,oBAAoB;;iBAGV;;EAEf;;EAEA,OAAO,wBAAwB;;;;;;;;;;;wBAwFjB,uBAAuB"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { SealedEnvelope, SealedFailure } from "../types/sealedChannel.mjs";
|
|
2
2
|
//#region src/adapters/nodeSealedChannel.d.ts
|
|
3
|
-
type SealResult = {
|
|
3
|
+
export type SealResult = {
|
|
4
4
|
ok: true;
|
|
5
5
|
envelope: SealedEnvelope;
|
|
6
6
|
} | {
|
|
7
7
|
ok: false;
|
|
8
8
|
failure: SealedFailure;
|
|
9
9
|
};
|
|
10
|
-
type OpenResult = {
|
|
10
|
+
export type OpenResult = {
|
|
11
11
|
ok: true;
|
|
12
12
|
plaintext: Uint8Array;
|
|
13
13
|
} | {
|
|
14
14
|
ok: false;
|
|
15
15
|
failure: SealedFailure;
|
|
16
16
|
};
|
|
17
|
-
interface SealedChannel {
|
|
17
|
+
export interface SealedChannel {
|
|
18
18
|
/** Seals one message. Counters advance only on success. */
|
|
19
19
|
seal(plaintext: Uint8Array): SealResult;
|
|
20
20
|
open(envelope: unknown): OpenResult;
|
|
21
21
|
}
|
|
22
|
-
interface HostHandshake {
|
|
22
|
+
export interface HostHandshake {
|
|
23
23
|
/** Base64url uncompressed P-256 point, printed in the QR. */
|
|
24
24
|
publicKey: string;
|
|
25
25
|
/** Completes the exchange against the peer's key and yields the channel. */
|
|
@@ -34,7 +34,6 @@ interface HostHandshake {
|
|
|
34
34
|
* host, because the host only ever derives against the key the client presents
|
|
35
35
|
* and the client only ever derives against the key it read off the screen.
|
|
36
36
|
*/
|
|
37
|
-
declare function createHostHandshake(): HostHandshake;
|
|
37
|
+
export declare function createHostHandshake(): HostHandshake;
|
|
38
38
|
//#endregion
|
|
39
|
-
export { HostHandshake, OpenResult, SealResult, SealedChannel, createHostHandshake };
|
|
40
39
|
//# sourceMappingURL=nodeSealedChannel.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeSealedChannel.d.mts","names":[],"sources":["../../src/adapters/nodeSealedChannel.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"nodeSealedChannel.d.mts","names":[],"sources":["../../src/adapters/nodeSealedChannel.ts"],"mappings":";;YAqBY;EAAe;EAAU,UAAU;;EAAqB;EAAW,SAAS;;YAC5E;EAAe;EAAU,WAAW;;EAAiB;EAAW,SAAS;;iBAEpE;;EAEf,KAAK,WAAW,aAAa;EAC7B,KAAK,oBAAoB;;iBAGV;;EAEf;;EAEA,OAAO,wBAAwB;;;;;;;;;;;wBAwFjB,uBAAuB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/adapters/sealedTransport.d.ts
|
|
2
|
-
interface SealedTransport {
|
|
2
|
+
export interface SealedTransport {
|
|
3
3
|
/** False on loopback and before the handshake completes, where everything passes through. */
|
|
4
4
|
active(): boolean;
|
|
5
5
|
sealText(text: string): Promise<string>;
|
|
@@ -11,7 +11,7 @@ interface SealedTransport {
|
|
|
11
11
|
fetch(input: string, init?: RequestInit): Promise<Response>;
|
|
12
12
|
lastFailure(): string | undefined;
|
|
13
13
|
}
|
|
14
|
-
declare function createSealedTransport(): SealedTransport & {
|
|
14
|
+
export declare function createSealedTransport(): SealedTransport & {
|
|
15
15
|
/** Completes the handshake against the host key from the QR. */
|
|
16
16
|
connect: (hostPublicKey: string) => Promise<string | undefined>;
|
|
17
17
|
/** Drops the channel, so everything falls back to pass-through. */
|
|
@@ -30,7 +30,7 @@ declare function createSealedTransport(): SealedTransport & {
|
|
|
30
30
|
* Inactive until a handshake completes, and inactive forever on the loopback
|
|
31
31
|
* listener, so `sealedTransport.fetch` is a plain `fetch` there.
|
|
32
32
|
*/
|
|
33
|
-
declare const sealedTransport: SealedTransport & {
|
|
33
|
+
export declare const sealedTransport: SealedTransport & {
|
|
34
34
|
/** Completes the handshake against the host key from the QR. */
|
|
35
35
|
connect: (hostPublicKey: string) => Promise<string | undefined>;
|
|
36
36
|
/** Drops the channel, so everything falls back to pass-through. */
|
|
@@ -39,5 +39,4 @@ declare const sealedTransport: SealedTransport & {
|
|
|
39
39
|
relayRequestsThrough: (path: string) => void;
|
|
40
40
|
};
|
|
41
41
|
//#endregion
|
|
42
|
-
export { SealedTransport, createSealedTransport, sealedTransport };
|
|
43
42
|
//# sourceMappingURL=sealedTransport.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealedTransport.d.cts","names":[],"sources":["../../src/adapters/sealedTransport.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"sealedTransport.d.cts","names":[],"sources":["../../src/adapters/sealedTransport.ts"],"mappings":";iBAqBiB;;EAEf;EACA,SAAS,eAAe;;EAExB,SAAS,eAAe;EACxB,WAAW,OAAO,aAAa,QAAQ;EACvC,WAAW,OAAO,aAAa,QAAQ;;EAEvC,MAAM,eAAe,OAAO,cAAc,QAAQ;EAClD;;wBA4Dc,yBAAyB;;EAEvC,UAAU,0BAA0B;;EAEpC;;EAEA,uBAAuB;;;;;;;;;;;;;qBAmJZ,iBAAe;;EAvJjB,UAAC,0BAA0B;;EAE7B;;EAEe,uBAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/adapters/sealedTransport.d.ts
|
|
2
|
-
interface SealedTransport {
|
|
2
|
+
export interface SealedTransport {
|
|
3
3
|
/** False on loopback and before the handshake completes, where everything passes through. */
|
|
4
4
|
active(): boolean;
|
|
5
5
|
sealText(text: string): Promise<string>;
|
|
@@ -11,7 +11,7 @@ interface SealedTransport {
|
|
|
11
11
|
fetch(input: string, init?: RequestInit): Promise<Response>;
|
|
12
12
|
lastFailure(): string | undefined;
|
|
13
13
|
}
|
|
14
|
-
declare function createSealedTransport(): SealedTransport & {
|
|
14
|
+
export declare function createSealedTransport(): SealedTransport & {
|
|
15
15
|
/** Completes the handshake against the host key from the QR. */
|
|
16
16
|
connect: (hostPublicKey: string) => Promise<string | undefined>;
|
|
17
17
|
/** Drops the channel, so everything falls back to pass-through. */
|
|
@@ -30,7 +30,7 @@ declare function createSealedTransport(): SealedTransport & {
|
|
|
30
30
|
* Inactive until a handshake completes, and inactive forever on the loopback
|
|
31
31
|
* listener, so `sealedTransport.fetch` is a plain `fetch` there.
|
|
32
32
|
*/
|
|
33
|
-
declare const sealedTransport: SealedTransport & {
|
|
33
|
+
export declare const sealedTransport: SealedTransport & {
|
|
34
34
|
/** Completes the handshake against the host key from the QR. */
|
|
35
35
|
connect: (hostPublicKey: string) => Promise<string | undefined>;
|
|
36
36
|
/** Drops the channel, so everything falls back to pass-through. */
|
|
@@ -39,5 +39,4 @@ declare const sealedTransport: SealedTransport & {
|
|
|
39
39
|
relayRequestsThrough: (path: string) => void;
|
|
40
40
|
};
|
|
41
41
|
//#endregion
|
|
42
|
-
export { SealedTransport, createSealedTransport, sealedTransport };
|
|
43
42
|
//# sourceMappingURL=sealedTransport.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealedTransport.d.mts","names":[],"sources":["../../src/adapters/sealedTransport.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"sealedTransport.d.mts","names":[],"sources":["../../src/adapters/sealedTransport.ts"],"mappings":";iBAqBiB;;EAEf;EACA,SAAS,eAAe;;EAExB,SAAS,eAAe;EACxB,WAAW,OAAO,aAAa,QAAQ;EACvC,WAAW,OAAO,aAAa,QAAQ;;EAEvC,MAAM,eAAe,OAAO,cAAc,QAAQ;EAClD;;wBA4Dc,yBAAyB;;EAEvC,UAAU,0BAA0B;;EAEpC;;EAEA,uBAAuB;;;;;;;;;;;;;qBAmJZ,iBAAe;;EAvJjB,UAAC,0BAA0B;;EAE7B;;EAEe,uBAAC"}
|
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
* Deliberately not a general work pool. A pool with any concurrency above one
|
|
14
14
|
* reintroduces exactly the reordering this exists to prevent.
|
|
15
15
|
*/
|
|
16
|
-
interface SerialQueue {
|
|
16
|
+
export interface SerialQueue {
|
|
17
17
|
/** Resolves with the task's result once every task queued before it has settled. */
|
|
18
18
|
run<T>(task: () => Promise<T>): Promise<T>;
|
|
19
19
|
}
|
|
20
|
-
declare function createSerialQueue(): SerialQueue;
|
|
20
|
+
export declare function createSerialQueue(): SerialQueue;
|
|
21
21
|
//#endregion
|
|
22
|
-
export { SerialQueue, createSerialQueue };
|
|
23
22
|
//# sourceMappingURL=serialQueue.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialQueue.d.cts","names":[],"sources":["../../src/services/serialQueue.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"serialQueue.d.cts","names":[],"sources":["../../src/services/serialQueue.ts"],"mappings":";;;;;;;;;;;;;;;iBAciB;;EAEf,IAAI,GAAG,YAAY,QAAQ,KAAK,QAAQ;;wBAG1B,qBAAqB"}
|
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
* Deliberately not a general work pool. A pool with any concurrency above one
|
|
14
14
|
* reintroduces exactly the reordering this exists to prevent.
|
|
15
15
|
*/
|
|
16
|
-
interface SerialQueue {
|
|
16
|
+
export interface SerialQueue {
|
|
17
17
|
/** Resolves with the task's result once every task queued before it has settled. */
|
|
18
18
|
run<T>(task: () => Promise<T>): Promise<T>;
|
|
19
19
|
}
|
|
20
|
-
declare function createSerialQueue(): SerialQueue;
|
|
20
|
+
export declare function createSerialQueue(): SerialQueue;
|
|
21
21
|
//#endregion
|
|
22
|
-
export { SerialQueue, createSerialQueue };
|
|
23
22
|
//# sourceMappingURL=serialQueue.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialQueue.d.mts","names":[],"sources":["../../src/services/serialQueue.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"serialQueue.d.mts","names":[],"sources":["../../src/services/serialQueue.ts"],"mappings":";;;;;;;;;;;;;;;iBAciB;;EAEf,IAAI,GAAG,YAAY,QAAQ,KAAK,QAAQ;;wBAG1B,qBAAqB"}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* edge that supplied its executable code. Consumers need a separately trusted
|
|
7
7
|
* bootstrap and key before these signatures become a delivery guarantee.
|
|
8
8
|
*/
|
|
9
|
-
declare const BUNDLE_MANIFEST_ROUTE = "/bundle-manifest.json";
|
|
10
|
-
declare const BUNDLE_MANIFEST_VERSION = 2;
|
|
11
|
-
interface BundleAsset {
|
|
9
|
+
export declare const BUNDLE_MANIFEST_ROUTE = "/bundle-manifest.json";
|
|
10
|
+
export declare const BUNDLE_MANIFEST_VERSION = 2;
|
|
11
|
+
export interface BundleAsset {
|
|
12
12
|
/** Normalized absolute URL path, without a query or fragment. */
|
|
13
13
|
path: string;
|
|
14
14
|
/** Lowercase hex SHA-256 of the served bytes. */
|
|
@@ -17,7 +17,7 @@ interface BundleAsset {
|
|
|
17
17
|
/** MIME type of the response, without parameters. */
|
|
18
18
|
contentType: string;
|
|
19
19
|
}
|
|
20
|
-
interface BundleManifest {
|
|
20
|
+
export interface BundleManifest {
|
|
21
21
|
version: typeof BUNDLE_MANIFEST_VERSION;
|
|
22
22
|
/** Monotonically increasing persistent signer revision. */
|
|
23
23
|
revision: number;
|
|
@@ -25,7 +25,7 @@ interface BundleManifest {
|
|
|
25
25
|
builtAt: number;
|
|
26
26
|
assets: BundleAsset[];
|
|
27
27
|
}
|
|
28
|
-
interface SignedBundleManifest {
|
|
28
|
+
export interface SignedBundleManifest {
|
|
29
29
|
manifest: BundleManifest;
|
|
30
30
|
/** Base64url IEEE P1363 ECDSA P-256 signature over the canonical serialization. */
|
|
31
31
|
signature: string;
|
|
@@ -33,13 +33,12 @@ interface SignedBundleManifest {
|
|
|
33
33
|
publicKey: string;
|
|
34
34
|
}
|
|
35
35
|
/** The exact bytes signed by Node and verified by WebCrypto. */
|
|
36
|
-
declare function canonicalManifest(manifest: BundleManifest): string;
|
|
37
|
-
declare function isBundleManifest(value: unknown): value is BundleManifest;
|
|
38
|
-
declare function isSignedBundleManifest(value: unknown): value is SignedBundleManifest;
|
|
36
|
+
export declare function canonicalManifest(manifest: BundleManifest): string;
|
|
37
|
+
export declare function isBundleManifest(value: unknown): value is BundleManifest;
|
|
38
|
+
export declare function isSignedBundleManifest(value: unknown): value is SignedBundleManifest;
|
|
39
39
|
/** The recorded asset for one path, or undefined if the manifest does not cover it. */
|
|
40
|
-
declare function assetFor(manifest: BundleManifest, path: string): BundleAsset | undefined;
|
|
40
|
+
export declare function assetFor(manifest: BundleManifest, path: string): BundleAsset | undefined;
|
|
41
41
|
/** The recorded digest for one asset, or undefined if the manifest does not cover it. */
|
|
42
|
-
declare function digestFor(manifest: BundleManifest, path: string): string | undefined;
|
|
42
|
+
export declare function digestFor(manifest: BundleManifest, path: string): string | undefined;
|
|
43
43
|
//#endregion
|
|
44
|
-
export { BUNDLE_MANIFEST_ROUTE, BUNDLE_MANIFEST_VERSION, BundleAsset, BundleManifest, SignedBundleManifest, assetFor, canonicalManifest, digestFor, isBundleManifest, isSignedBundleManifest };
|
|
45
44
|
//# sourceMappingURL=bundleManifest.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleManifest.d.cts","names":[],"sources":["../../src/types/bundleManifest.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"bundleManifest.d.cts","names":[],"sources":["../../src/types/bundleManifest.ts"],"mappings":";;;;;;;;qBAQa;qBACA;iBAMI;;EAEf;;EAEA;EACA;;EAEA;;iBAGe;EACf,gBAAgB;;EAEhB;;EAEA;EACA,QAAQ;;iBAGO;EACf,UAAU;;EAEV;;EAEA;;;wBAwBc,kBAAkB,UAAU;wBAU5B,iBAAiB,iBAAiB,SAAS;wBAsB3C,uBAAuB,iBAAiB,SAAS;;wBAgBjD,SAAS,UAAU,gBAAgB,eAAe;;wBAKlD,UAAU,UAAU,gBAAgB"}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* edge that supplied its executable code. Consumers need a separately trusted
|
|
7
7
|
* bootstrap and key before these signatures become a delivery guarantee.
|
|
8
8
|
*/
|
|
9
|
-
declare const BUNDLE_MANIFEST_ROUTE = "/bundle-manifest.json";
|
|
10
|
-
declare const BUNDLE_MANIFEST_VERSION = 2;
|
|
11
|
-
interface BundleAsset {
|
|
9
|
+
export declare const BUNDLE_MANIFEST_ROUTE = "/bundle-manifest.json";
|
|
10
|
+
export declare const BUNDLE_MANIFEST_VERSION = 2;
|
|
11
|
+
export interface BundleAsset {
|
|
12
12
|
/** Normalized absolute URL path, without a query or fragment. */
|
|
13
13
|
path: string;
|
|
14
14
|
/** Lowercase hex SHA-256 of the served bytes. */
|
|
@@ -17,7 +17,7 @@ interface BundleAsset {
|
|
|
17
17
|
/** MIME type of the response, without parameters. */
|
|
18
18
|
contentType: string;
|
|
19
19
|
}
|
|
20
|
-
interface BundleManifest {
|
|
20
|
+
export interface BundleManifest {
|
|
21
21
|
version: typeof BUNDLE_MANIFEST_VERSION;
|
|
22
22
|
/** Monotonically increasing persistent signer revision. */
|
|
23
23
|
revision: number;
|
|
@@ -25,7 +25,7 @@ interface BundleManifest {
|
|
|
25
25
|
builtAt: number;
|
|
26
26
|
assets: BundleAsset[];
|
|
27
27
|
}
|
|
28
|
-
interface SignedBundleManifest {
|
|
28
|
+
export interface SignedBundleManifest {
|
|
29
29
|
manifest: BundleManifest;
|
|
30
30
|
/** Base64url IEEE P1363 ECDSA P-256 signature over the canonical serialization. */
|
|
31
31
|
signature: string;
|
|
@@ -33,13 +33,12 @@ interface SignedBundleManifest {
|
|
|
33
33
|
publicKey: string;
|
|
34
34
|
}
|
|
35
35
|
/** The exact bytes signed by Node and verified by WebCrypto. */
|
|
36
|
-
declare function canonicalManifest(manifest: BundleManifest): string;
|
|
37
|
-
declare function isBundleManifest(value: unknown): value is BundleManifest;
|
|
38
|
-
declare function isSignedBundleManifest(value: unknown): value is SignedBundleManifest;
|
|
36
|
+
export declare function canonicalManifest(manifest: BundleManifest): string;
|
|
37
|
+
export declare function isBundleManifest(value: unknown): value is BundleManifest;
|
|
38
|
+
export declare function isSignedBundleManifest(value: unknown): value is SignedBundleManifest;
|
|
39
39
|
/** The recorded asset for one path, or undefined if the manifest does not cover it. */
|
|
40
|
-
declare function assetFor(manifest: BundleManifest, path: string): BundleAsset | undefined;
|
|
40
|
+
export declare function assetFor(manifest: BundleManifest, path: string): BundleAsset | undefined;
|
|
41
41
|
/** The recorded digest for one asset, or undefined if the manifest does not cover it. */
|
|
42
|
-
declare function digestFor(manifest: BundleManifest, path: string): string | undefined;
|
|
42
|
+
export declare function digestFor(manifest: BundleManifest, path: string): string | undefined;
|
|
43
43
|
//#endregion
|
|
44
|
-
export { BUNDLE_MANIFEST_ROUTE, BUNDLE_MANIFEST_VERSION, BundleAsset, BundleManifest, SignedBundleManifest, assetFor, canonicalManifest, digestFor, isBundleManifest, isSignedBundleManifest };
|
|
45
44
|
//# sourceMappingURL=bundleManifest.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleManifest.d.mts","names":[],"sources":["../../src/types/bundleManifest.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"bundleManifest.d.mts","names":[],"sources":["../../src/types/bundleManifest.ts"],"mappings":";;;;;;;;qBAQa;qBACA;iBAMI;;EAEf;;EAEA;EACA;;EAEA;;iBAGe;EACf,gBAAgB;;EAEhB;;EAEA;EACA,QAAQ;;iBAGO;EACf,UAAU;;EAEV;;EAEA;;;wBAwBc,kBAAkB,UAAU;wBAU5B,iBAAiB,iBAAiB,SAAS;wBAsB3C,uBAAuB,iBAAiB,SAAS;;wBAgBjD,SAAS,UAAU,gBAAgB,eAAe;;wBAKlD,UAAU,UAAU,gBAAgB"}
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
* read it identically.
|
|
19
19
|
*/
|
|
20
20
|
/** Bumped when the envelope layout changes; a mismatch is refused, never guessed at. */
|
|
21
|
-
declare const SEALED_VERSION = 1;
|
|
21
|
+
export declare const SEALED_VERSION = 1;
|
|
22
22
|
/** Fragment key in the pairing URL carrying the host's ephemeral public key. */
|
|
23
|
-
declare const SEALED_KEY_PARAM = "k";
|
|
23
|
+
export declare const SEALED_KEY_PARAM = "k";
|
|
24
24
|
/** AES-GCM standard nonce length. Longer is non-standard, shorter is unsafe. */
|
|
25
|
-
declare const NONCE_BYTES = 12;
|
|
25
|
+
export declare const NONCE_BYTES = 12;
|
|
26
26
|
/** Random per-channel prefix, so two channels never share a nonce space. */
|
|
27
|
-
declare const NONCE_PREFIX_BYTES = 4;
|
|
27
|
+
export declare const NONCE_PREFIX_BYTES = 4;
|
|
28
28
|
/** Monotonic per-direction counter filling the rest of the nonce. */
|
|
29
|
-
declare const NONCE_COUNTER_BYTES: number;
|
|
29
|
+
export declare const NONCE_COUNTER_BYTES: number;
|
|
30
30
|
/**
|
|
31
31
|
* Rekey well before the counter could wrap.
|
|
32
32
|
*
|
|
@@ -35,43 +35,42 @@ declare const NONCE_COUNTER_BYTES: number;
|
|
|
35
35
|
* 64 bits, so this bound is nowhere near it; the point is that the bound exists
|
|
36
36
|
* and is enforced rather than assumed.
|
|
37
37
|
*/
|
|
38
|
-
declare const MAX_MESSAGES_PER_KEY: number;
|
|
38
|
+
export declare const MAX_MESSAGES_PER_KEY: number;
|
|
39
39
|
/**
|
|
40
40
|
* HKDF info strings, one per direction.
|
|
41
41
|
*
|
|
42
42
|
* Separate keys per direction, not one shared key, so a message the server sent
|
|
43
43
|
* can never be replayed back at it as though the client had sent it.
|
|
44
44
|
*/
|
|
45
|
-
declare const CLIENT_TO_SERVER_INFO = "doompi/sealed/c2s/v1";
|
|
46
|
-
declare const SERVER_TO_CLIENT_INFO = "doompi/sealed/s2c/v1";
|
|
47
|
-
type SealedDirection = 'c2s' | 's2c';
|
|
48
|
-
declare function infoFor(direction: SealedDirection): string;
|
|
45
|
+
export declare const CLIENT_TO_SERVER_INFO = "doompi/sealed/c2s/v1";
|
|
46
|
+
export declare const SERVER_TO_CLIENT_INFO = "doompi/sealed/s2c/v1";
|
|
47
|
+
export type SealedDirection = 'c2s' | 's2c';
|
|
48
|
+
export declare function infoFor(direction: SealedDirection): string;
|
|
49
49
|
/**
|
|
50
50
|
* One sealed message, as it travels.
|
|
51
51
|
*
|
|
52
52
|
* Base64url rather than binary so the same envelope works on a JSON body and a
|
|
53
53
|
* text WebSocket frame without a second encoding path to get wrong.
|
|
54
54
|
*/
|
|
55
|
-
interface SealedEnvelope {
|
|
55
|
+
export interface SealedEnvelope {
|
|
56
56
|
v: number;
|
|
57
57
|
/** Base64url, 4-byte prefix plus 8-byte counter. */
|
|
58
58
|
n: string;
|
|
59
59
|
/** Base64url ciphertext with the GCM tag appended. */
|
|
60
60
|
c: string;
|
|
61
61
|
}
|
|
62
|
-
declare function isSealedEnvelope(value: unknown): value is SealedEnvelope;
|
|
62
|
+
export declare function isSealedEnvelope(value: unknown): value is SealedEnvelope;
|
|
63
63
|
/** Header naming the client's ephemeral public key during the handshake. */
|
|
64
|
-
declare const SEALED_CLIENT_KEY_HEADER = "x-doompi-channel-key";
|
|
64
|
+
export declare const SEALED_CLIENT_KEY_HEADER = "x-doompi-channel-key";
|
|
65
65
|
/** Header carrying a sealed request body's envelope on a non-JSON request. */
|
|
66
|
-
declare const SEALED_BODY_HEADER = "x-doompi-sealed";
|
|
67
|
-
type SealedFailure = 'version' | 'malformed' | 'replay' | 'auth' | 'exhausted';
|
|
66
|
+
export declare const SEALED_BODY_HEADER = "x-doompi-sealed";
|
|
67
|
+
export type SealedFailure = 'version' | 'malformed' | 'replay' | 'auth' | 'exhausted';
|
|
68
68
|
/**
|
|
69
69
|
* Why an unseal failed, in words a diagnostic can show.
|
|
70
70
|
*
|
|
71
71
|
* A decryption failure means a blank cockpit, so every one of these has to name
|
|
72
72
|
* its cause rather than leaving a dead page and no explanation.
|
|
73
73
|
*/
|
|
74
|
-
declare function describeSealedFailure(failure: SealedFailure): string;
|
|
74
|
+
export declare function describeSealedFailure(failure: SealedFailure): string;
|
|
75
75
|
//#endregion
|
|
76
|
-
export { CLIENT_TO_SERVER_INFO, MAX_MESSAGES_PER_KEY, NONCE_BYTES, NONCE_COUNTER_BYTES, NONCE_PREFIX_BYTES, SEALED_BODY_HEADER, SEALED_CLIENT_KEY_HEADER, SEALED_KEY_PARAM, SEALED_VERSION, SERVER_TO_CLIENT_INFO, SealedDirection, SealedEnvelope, SealedFailure, describeSealedFailure, infoFor, isSealedEnvelope };
|
|
77
76
|
//# sourceMappingURL=sealedChannel.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealedChannel.d.cts","names":[],"sources":["../../src/types/sealedChannel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"sealedChannel.d.cts","names":[],"sources":["../../src/types/sealedChannel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;qBAoBa;;qBAGA;;qBAGA;;qBAEA;;qBAEA;;;;;;;;;qBAUA;;;;;;;qBAQA;qBACA;YAED;wBAEI,QAAQ,WAAW;;;;;;;iBAUlB;EACf;;EAEA;;EAEA;;wBAGc,iBAAiB,iBAAiB,SAAS;;qBAO9C;;qBAEA;YAED;;;;;;;wBAQI,sBAAsB,SAAS"}
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
* read it identically.
|
|
19
19
|
*/
|
|
20
20
|
/** Bumped when the envelope layout changes; a mismatch is refused, never guessed at. */
|
|
21
|
-
declare const SEALED_VERSION = 1;
|
|
21
|
+
export declare const SEALED_VERSION = 1;
|
|
22
22
|
/** Fragment key in the pairing URL carrying the host's ephemeral public key. */
|
|
23
|
-
declare const SEALED_KEY_PARAM = "k";
|
|
23
|
+
export declare const SEALED_KEY_PARAM = "k";
|
|
24
24
|
/** AES-GCM standard nonce length. Longer is non-standard, shorter is unsafe. */
|
|
25
|
-
declare const NONCE_BYTES = 12;
|
|
25
|
+
export declare const NONCE_BYTES = 12;
|
|
26
26
|
/** Random per-channel prefix, so two channels never share a nonce space. */
|
|
27
|
-
declare const NONCE_PREFIX_BYTES = 4;
|
|
27
|
+
export declare const NONCE_PREFIX_BYTES = 4;
|
|
28
28
|
/** Monotonic per-direction counter filling the rest of the nonce. */
|
|
29
|
-
declare const NONCE_COUNTER_BYTES: number;
|
|
29
|
+
export declare const NONCE_COUNTER_BYTES: number;
|
|
30
30
|
/**
|
|
31
31
|
* Rekey well before the counter could wrap.
|
|
32
32
|
*
|
|
@@ -35,43 +35,42 @@ declare const NONCE_COUNTER_BYTES: number;
|
|
|
35
35
|
* 64 bits, so this bound is nowhere near it; the point is that the bound exists
|
|
36
36
|
* and is enforced rather than assumed.
|
|
37
37
|
*/
|
|
38
|
-
declare const MAX_MESSAGES_PER_KEY: number;
|
|
38
|
+
export declare const MAX_MESSAGES_PER_KEY: number;
|
|
39
39
|
/**
|
|
40
40
|
* HKDF info strings, one per direction.
|
|
41
41
|
*
|
|
42
42
|
* Separate keys per direction, not one shared key, so a message the server sent
|
|
43
43
|
* can never be replayed back at it as though the client had sent it.
|
|
44
44
|
*/
|
|
45
|
-
declare const CLIENT_TO_SERVER_INFO = "doompi/sealed/c2s/v1";
|
|
46
|
-
declare const SERVER_TO_CLIENT_INFO = "doompi/sealed/s2c/v1";
|
|
47
|
-
type SealedDirection = 'c2s' | 's2c';
|
|
48
|
-
declare function infoFor(direction: SealedDirection): string;
|
|
45
|
+
export declare const CLIENT_TO_SERVER_INFO = "doompi/sealed/c2s/v1";
|
|
46
|
+
export declare const SERVER_TO_CLIENT_INFO = "doompi/sealed/s2c/v1";
|
|
47
|
+
export type SealedDirection = 'c2s' | 's2c';
|
|
48
|
+
export declare function infoFor(direction: SealedDirection): string;
|
|
49
49
|
/**
|
|
50
50
|
* One sealed message, as it travels.
|
|
51
51
|
*
|
|
52
52
|
* Base64url rather than binary so the same envelope works on a JSON body and a
|
|
53
53
|
* text WebSocket frame without a second encoding path to get wrong.
|
|
54
54
|
*/
|
|
55
|
-
interface SealedEnvelope {
|
|
55
|
+
export interface SealedEnvelope {
|
|
56
56
|
v: number;
|
|
57
57
|
/** Base64url, 4-byte prefix plus 8-byte counter. */
|
|
58
58
|
n: string;
|
|
59
59
|
/** Base64url ciphertext with the GCM tag appended. */
|
|
60
60
|
c: string;
|
|
61
61
|
}
|
|
62
|
-
declare function isSealedEnvelope(value: unknown): value is SealedEnvelope;
|
|
62
|
+
export declare function isSealedEnvelope(value: unknown): value is SealedEnvelope;
|
|
63
63
|
/** Header naming the client's ephemeral public key during the handshake. */
|
|
64
|
-
declare const SEALED_CLIENT_KEY_HEADER = "x-doompi-channel-key";
|
|
64
|
+
export declare const SEALED_CLIENT_KEY_HEADER = "x-doompi-channel-key";
|
|
65
65
|
/** Header carrying a sealed request body's envelope on a non-JSON request. */
|
|
66
|
-
declare const SEALED_BODY_HEADER = "x-doompi-sealed";
|
|
67
|
-
type SealedFailure = 'version' | 'malformed' | 'replay' | 'auth' | 'exhausted';
|
|
66
|
+
export declare const SEALED_BODY_HEADER = "x-doompi-sealed";
|
|
67
|
+
export type SealedFailure = 'version' | 'malformed' | 'replay' | 'auth' | 'exhausted';
|
|
68
68
|
/**
|
|
69
69
|
* Why an unseal failed, in words a diagnostic can show.
|
|
70
70
|
*
|
|
71
71
|
* A decryption failure means a blank cockpit, so every one of these has to name
|
|
72
72
|
* its cause rather than leaving a dead page and no explanation.
|
|
73
73
|
*/
|
|
74
|
-
declare function describeSealedFailure(failure: SealedFailure): string;
|
|
74
|
+
export declare function describeSealedFailure(failure: SealedFailure): string;
|
|
75
75
|
//#endregion
|
|
76
|
-
export { CLIENT_TO_SERVER_INFO, MAX_MESSAGES_PER_KEY, NONCE_BYTES, NONCE_COUNTER_BYTES, NONCE_PREFIX_BYTES, SEALED_BODY_HEADER, SEALED_CLIENT_KEY_HEADER, SEALED_KEY_PARAM, SEALED_VERSION, SERVER_TO_CLIENT_INFO, SealedDirection, SealedEnvelope, SealedFailure, describeSealedFailure, infoFor, isSealedEnvelope };
|
|
77
76
|
//# sourceMappingURL=sealedChannel.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealedChannel.d.mts","names":[],"sources":["../../src/types/sealedChannel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"sealedChannel.d.mts","names":[],"sources":["../../src/types/sealedChannel.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;qBAoBa;;qBAGA;;qBAGA;;qBAEA;;qBAEA;;;;;;;;;qBAUA;;;;;;;qBAQA;qBACA;YAED;wBAEI,QAAQ,WAAW;;;;;;;iBAUlB;EACf;;EAEA;;EAEA;;wBAGc,iBAAiB,iBAAiB,SAAS;;qBAO9C;;qBAEA;YAED;;;;;;;wBAQI,sBAAsB,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-web-security",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.25",
|
|
4
4
|
"description": "Shared security primitives for the DoomPi web cockpit: sealed channels and signed bundle manifests for independently trusted verifiers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/node": "26.4.
|
|
61
|
-
"@vitest/coverage-v8": "
|
|
62
|
-
"tsdown": "0.
|
|
60
|
+
"@types/node": "26.4.1",
|
|
61
|
+
"@vitest/coverage-v8": "5.0.0",
|
|
62
|
+
"tsdown": "0.23.0",
|
|
63
63
|
"typescript": "7.0.2",
|
|
64
|
-
"vitest": "
|
|
64
|
+
"vitest": "5.0.0"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=22.19.0"
|