@interncom/diplomatic 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.mjs +2 -2
- package/dist/cli/shared/codecs/identityBundle.d.ts +3 -16
- package/dist/cli/shared/crypto/enclave.d.ts +8 -0
- package/dist/cli/shared/webauthn/common.d.ts +4 -0
- package/dist/cli/shared/webauthn/largeBlob.d.ts +0 -3
- package/dist/cli/shared/webauthn/prf.d.ts +4 -18
- package/dist/web/index.d.ts +4 -4
- package/dist/web/index.mjs +1 -1
- package/dist/web/passkey/seed.d.ts +1 -3
- package/dist/web/shared/codecs/identityBundle.d.ts +3 -16
- package/dist/web/shared/crypto/enclave.d.ts +8 -0
- package/dist/web/shared/webauthn/common.d.ts +4 -0
- package/dist/web/shared/webauthn/largeBlob.d.ts +0 -3
- package/dist/web/shared/webauthn/prf.d.ts +4 -18
- package/dist/web/worker.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/shared/codecs/pairPackage.d.ts +0 -14
- package/dist/web/passkey/largeBlob.d.ts +0 -17
- package/dist/web/passkey/webauthn.d.ts +0 -1
- package/dist/web/shared/codecs/pairPackage.d.ts +0 -14
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Enclave } from "../shared/crypto/enclave";
|
|
2
2
|
import { type ValStat } from "../shared/valstat";
|
|
3
3
|
import type { ISeedStore, SetSeedOpts } from "../types";
|
|
4
|
-
import {
|
|
5
|
-
export { defaultWebAuthnRpId } from "./webauthn";
|
|
6
|
-
export { LargeBlob, type LargeBlobCreateOpts, type LargeBlobRp, } from "./largeBlob";
|
|
4
|
+
import type { LargeBlobRp } from "../shared/webauthn/largeBlob";
|
|
7
5
|
export type PasskeySeedStoreOpts = LargeBlobRp & {
|
|
8
6
|
credId?: Uint8Array;
|
|
9
7
|
};
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
import { ICodecStruct } from "../codec.ts";
|
|
2
|
-
import { type MasterSeed } from "../seed.ts";
|
|
3
|
-
import { type ValStat } from "../valstat.ts";
|
|
4
2
|
import { type BundleHost } from "./bundleHost.ts";
|
|
5
3
|
export { type BundleHost, bundleHostCodec } from "./bundleHost.ts";
|
|
6
|
-
export
|
|
7
|
-
export type IdentityBundle = {
|
|
8
|
-
v: number;
|
|
9
|
-
masterSeed: MasterSeed;
|
|
4
|
+
export type IdentityHosts = {
|
|
10
5
|
hosts: BundleHost[];
|
|
11
6
|
};
|
|
12
7
|
/**
|
|
13
|
-
* IdentityBundle wire
|
|
14
|
-
* v: varint
|
|
15
|
-
* masterSeed: 32 fixed bytes
|
|
8
|
+
* Host list on the IdentityBundle wire:
|
|
16
9
|
* hostsLen: varint
|
|
17
10
|
* hosts: hostsLen × BundleHost
|
|
18
11
|
*/
|
|
19
|
-
export declare const
|
|
20
|
-
/**
|
|
21
|
-
* Build a wire-format identity bundle from a branded {@link MasterSeed} + hosts.
|
|
22
|
-
* Codec/tests only. Runtime seed I/O must go through Enclave.persistToLargeBlob
|
|
23
|
-
* — never encode then hand seed-bearing bytes to outer layers.
|
|
24
|
-
*/
|
|
25
|
-
export declare function createIdentityBundle(masterSeed: MasterSeed, hosts: BundleHost[]): ValStat<IdentityBundle>;
|
|
12
|
+
export declare const identityHostsCodec: ICodecStruct<IdentityHosts>;
|
|
@@ -125,6 +125,14 @@ export declare class Enclave {
|
|
|
125
125
|
}>>;
|
|
126
126
|
/** UV + overwrite largeBlob with zeros (destroys stored seed material). */
|
|
127
127
|
static clearLargeBlob(credId: Uint8Array, opts?: LargeBlobRp): Promise<Status>;
|
|
128
|
+
/**
|
|
129
|
+
* Absorb seed‖hosts plaintext (pair AEAD inner).
|
|
130
|
+
* Encoder/Decoder never see the seed.
|
|
131
|
+
*/
|
|
132
|
+
static fromPairPlain(plain: Uint8Array): ValStat<{
|
|
133
|
+
enclave: Enclave;
|
|
134
|
+
hosts: BundleHost[];
|
|
135
|
+
}>;
|
|
128
136
|
static pairRequest(): Promise<ValStat<PairRequest>>;
|
|
129
137
|
pairAccept(dhkeReq: DHKEReq, hosts: BundleHost[]): Promise<ValStat<DHKEResp>>;
|
|
130
138
|
/**
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Status } from "../consts.ts";
|
|
2
2
|
import { type ValStat } from "../valstat.ts";
|
|
3
3
|
export declare const WEBAUTHN_CHAL_LEN = 32;
|
|
4
|
+
/** Default RP name shown in the WebAuthn picker. */
|
|
5
|
+
export declare const DEFAULT_WEBAUTHN_RP_NAME = "DIPLOMATIC";
|
|
6
|
+
/** WebAuthn PublicKeyCredentialType. */
|
|
7
|
+
export declare const WEBAUTHN_CRED_TYPE: "public-key";
|
|
4
8
|
/** COSE algorithm identifiers for WebAuthn `pubKeyCredParams`. */
|
|
5
9
|
export declare const COSE_ALG_ES256 = -7;
|
|
6
10
|
export declare const COSE_ALG_EDDSA = -8;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Status } from "../consts.ts";
|
|
2
1
|
import { type ValStat } from "../valstat.ts";
|
|
3
2
|
import { type WebAuthnRp } from "./common.ts";
|
|
4
3
|
export type LargeBlobRp = WebAuthnRp;
|
|
@@ -10,8 +9,6 @@ export type LargeBlobCreateOpts = LargeBlobRp & {
|
|
|
10
9
|
export declare function largeBlobCapable(): Promise<boolean>;
|
|
11
10
|
/** Create discoverable largeBlob-capable credential; returns credential id. */
|
|
12
11
|
export declare function largeBlobCreateCred(opts?: LargeBlobCreateOpts): Promise<ValStat<Uint8Array>>;
|
|
13
|
-
/** UV write of opaque bytes to largeBlob. */
|
|
14
|
-
export declare function largeBlobWrite(credId: Uint8Array, data: Uint8Array, opts?: LargeBlobRp): Promise<Status>;
|
|
15
12
|
/** UV read from largeBlob; `credId` undefined = discoverable then targeted read. */
|
|
16
13
|
export declare function largeBlobRead(credId: Uint8Array | undefined, opts?: LargeBlobRp): Promise<ValStat<{
|
|
17
14
|
blob: Uint8Array;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { type ValStat } from "../valstat.ts";
|
|
2
1
|
import { type AuthenticatorAttachmentName, type WebAuthnRp } from "./common.ts";
|
|
3
2
|
export type PrfRp = WebAuthnRp;
|
|
4
3
|
export type PrfCreateOpts = PrfRp & {
|
|
4
|
+
/** WebAuthn user.name — stable account id. */
|
|
5
5
|
userName?: string;
|
|
6
|
+
/** WebAuthn user.displayName — human nick. */
|
|
7
|
+
displayName?: string;
|
|
6
8
|
/** Omit so the UA can offer roaming keys (YubiKey) and third-party providers. */
|
|
7
9
|
authenticatorAttachment?: "platform" | "cross-platform";
|
|
8
|
-
/**
|
|
10
|
+
/** PRF salt. Tried at create; some UAs only eval on get(). */
|
|
9
11
|
salt?: Uint8Array;
|
|
10
12
|
/** Already-bound cred ids so create does not assert an existing key. */
|
|
11
13
|
excludeCredentials?: readonly Uint8Array[];
|
|
@@ -14,8 +16,6 @@ export type PrfCreateOpts = PrfRp & {
|
|
|
14
16
|
export declare const DEFAULT_PRF_SALT: Uint8Array<ArrayBufferLike>;
|
|
15
17
|
/** Default WebAuthn user.name / displayName when none is supplied. */
|
|
16
18
|
export declare const DEFAULT_PRF_USER_NAME = "diplomatic-prf";
|
|
17
|
-
/** Bytes of PRF output we consume (first N of `results.first`). */
|
|
18
|
-
export declare const PRF_OUTPUT_LEN = 32;
|
|
19
19
|
/** Public ceremony facts (no PRF bytes). */
|
|
20
20
|
export type PrfCeremony = {
|
|
21
21
|
credId: Uint8Array;
|
|
@@ -24,13 +24,6 @@ export type PrfCeremony = {
|
|
|
24
24
|
transports?: string[];
|
|
25
25
|
aaguid?: Uint8Array;
|
|
26
26
|
};
|
|
27
|
-
export type PrfCreateResult = PrfCeremony & {
|
|
28
|
-
prfEnabled: boolean;
|
|
29
|
-
};
|
|
30
|
-
/** Internal: PRF output + cred id. For Enclave only — do not re-export to apps. */
|
|
31
|
-
export type PrfEvalResult = PrfCeremony & {
|
|
32
|
-
prf: Uint8Array;
|
|
33
|
-
};
|
|
34
27
|
export type PrfEvalOpts = PrfRp & {
|
|
35
28
|
/** One id, or every bound id so a spare key can assert in one get(). */
|
|
36
29
|
credId?: Uint8Array | readonly Uint8Array[];
|
|
@@ -38,10 +31,3 @@ export type PrfEvalOpts = PrfRp & {
|
|
|
38
31
|
};
|
|
39
32
|
/** Best-effort: client advertises PRF extension. */
|
|
40
33
|
export declare function prfCapable(): Promise<boolean>;
|
|
41
|
-
/** Create a discoverable credential that enables PRF. */
|
|
42
|
-
export declare function createPrfCred(opts?: PrfCreateOpts): Promise<ValStat<PrfCreateResult>>;
|
|
43
|
-
/**
|
|
44
|
-
* Evaluate PRF (UV). Returns PRF bytes — only Enclave should call this and must
|
|
45
|
-
* zero/drop PRF after seal/unseal. Apps must not hold PRF alongside sealed meta.
|
|
46
|
-
*/
|
|
47
|
-
export declare function evalPrf(opts?: PrfEvalOpts): Promise<ValStat<PrfEvalResult>>;
|