@interncom/diplomatic 0.13.5 → 0.14.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.
@@ -1,28 +1,39 @@
1
1
  import { type ValStat } from "../valstat.ts";
2
- import { type WebAuthnRp } from "./common.ts";
2
+ import { type AuthenticatorAttachmentName, type WebAuthnRp } from "./common.ts";
3
3
  export type PrfRp = WebAuthnRp;
4
4
  export type PrfCreateOpts = PrfRp & {
5
5
  userName?: string;
6
6
  /** Omit so the UA can offer roaming keys (YubiKey) and third-party providers. */
7
7
  authenticatorAttachment?: "platform" | "cross-platform";
8
- /** If set, also request PRF eval during create. `{ prf: {} }` already enables hmac-secret. */
8
+ /** Seal salt (eval is on get, not create some UAs throw on create-time eval). */
9
9
  salt?: Uint8Array;
10
+ /** Already-bound cred ids so create does not assert an existing key. */
11
+ excludeCredentials?: readonly Uint8Array[];
10
12
  };
11
13
  /** Default salt for DIPLOMATIC PRF eval (UTF-8). */
12
14
  export declare const DEFAULT_PRF_SALT: Uint8Array<ArrayBufferLike>;
15
+ /** Default WebAuthn user.name / displayName when none is supplied. */
16
+ export declare const DEFAULT_PRF_USER_NAME = "diplomatic-prf";
13
17
  /** Bytes of PRF output we consume (first N of `results.first`). */
14
18
  export declare const PRF_OUTPUT_LEN = 32;
15
- export type PrfCreateResult = {
19
+ /** Public ceremony facts (no PRF bytes). */
20
+ export type PrfCeremony = {
16
21
  credId: Uint8Array;
22
+ userId?: Uint8Array;
23
+ attachment?: AuthenticatorAttachmentName;
24
+ transports?: string[];
25
+ aaguid?: Uint8Array;
26
+ };
27
+ export type PrfCreateResult = PrfCeremony & {
17
28
  prfEnabled: boolean;
18
29
  };
19
30
  /** Internal: PRF output + cred id. For Enclave only — do not re-export to apps. */
20
- export type PrfEvalResult = {
31
+ export type PrfEvalResult = PrfCeremony & {
21
32
  prf: Uint8Array;
22
- credId: Uint8Array;
23
33
  };
24
34
  export type PrfEvalOpts = PrfRp & {
25
- credId?: Uint8Array;
35
+ /** One id, or every bound id so a spare key can assert in one get(). */
36
+ credId?: Uint8Array | readonly Uint8Array[];
26
37
  salt?: Uint8Array;
27
38
  };
28
39
  /** Best-effort: client advertises PRF extension. */
@@ -27,8 +27,8 @@ import type { SyncProgressEvent } from "./progress";
27
27
  import { defaultPeekProgressEvery, idleProgress, shouldEmitItemProgress } from "./progress";
28
28
  import { defaultWebAuthnRpId, PasskeySeedStore } from "./passkey/seed";
29
29
  import { DEFAULT_PRF_SALT, prfCapable, type PrfRp } from "./shared/webauthn/prf";
30
- import { PrfSeedStore } from "./passkey/prf-store";
31
- import type { PersistPrfSeedMeta, PrfSeedMeta, PrfSeedStoreOpts } from "./passkey/prf-store";
30
+ import { KEYRING_MAX, keyringCredIds, keyringKind, keyringLabel, PrfSeedStore } from "./passkey/prf-store";
31
+ import type { Keyring, KeyringEntry, KeyringRow, PersistKeyring, PrfSeedStoreOpts } from "./passkey/prf-store";
32
32
  import type { PasskeySeedStoreOpts } from "./passkey/seed";
33
33
  import { type BundleHost } from "./shared/codecs/bundleHost";
34
34
  import { asDHKEReq, asDHKEResp, PairRequest } from "./shared/crypto/pairing";
@@ -39,8 +39,8 @@ import { openDiplomaticClient, type OpenDiplomaticClientMainOptions, type OpenDi
39
39
  import { WorkerClient } from "./worker/client";
40
40
  import type { WorkerClientOptions } from "./worker/client";
41
41
  import type { WipeOpts } from "./types";
42
- /** Platform advertises largeBlob (not a guarantee the authenticator has it). */
42
+ /** Platform advertises largeBlob (not a guarantee the binding key has it). */
43
43
  export declare function largeBlobCapable(): Promise<boolean>;
44
44
  export { webAuthnLastError } from "./shared/webauthn/common";
45
- export { APLD_APPLIED, APLD_ERROR, APLD_PENDING, apldFromStored, asDHKEReq, asDHKEResp, asSealedMasterKey, b64tob, b64urltob, btob64, btob64url, btoh, CachedEntDB, checksumEntRevs, checksumSet, Clock, cmpBytes, crypto, Decoder, DEFAULT_PRF_SALT, defaultPeekProgressEvery, defaultWebAuthnRpId, eidCodec, Enclave, encodeEntRev, Encoder, EntDBMemory, EntIDB, EntitiesQuery, EntityID, entStateManager, genSingletonEID, GroupID, hostHTTPTransport, htob, HTTPTransport, IDBSeedStore, IDBStore, idleProgress, IEntDB, IEntity, isApldState, isLiveEnt, isPendingApply, isTerminalApplyFailure, isTombstone, IStore, MASTER_SEED_LEN, MemoryStore, normalizeTags, nullEntDB, nullStateManager, openDiplomaticClient, openEntDB, openIDBStore, PairRequest, PasskeySeedStore, prfCapable, PrfSeedStore, revFromEntity, revFromHead, SEALED_MASTER_KEY_LEN, setApld, shouldEmitItemProgress, SingletonStateManager, StateManager, Status, SyncClient, TypedEventEmitter, useClient, useClientState, useClientXferState, useStateWatcher, useStateWatcherSuspense, useSyncOnResume, WorkerClient, };
46
- export type { ApldState, Applier, BundleHost, CachedEntDBOptions, DHKEReq, DHKEResp, EntDBMemoryOptions, HostHandle, HostStatsUpdate, IClient, ICrypto, IDeleteParams, IDiplomaticClientState, IEntRev, IEntRow, IHostConnectionInfo, IHostRow, IMessage, IMutateOp, IOp, IStateManager, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ITombstone, ITransport, IUpdateParams, ListMsgsOpts, OpenDiplomaticClientMainOptions, OpenDiplomaticClientOptions, OpenDiplomaticClientWorkerOptions, OpenedDiplomaticClient, OpenEntDBOptions, PairPackagePlain, PasskeySeedStoreOpts, PersistPrfSeedMeta, PrfRp, PrfSeedMeta, PrfSeedStoreOpts, ReconcileOpts, ReconcileReport, SealedMasterKey, SetSeedOpts, SyncProgressEvent, WipeOpts, WorkerClientOptions, };
45
+ export { APLD_APPLIED, APLD_ERROR, APLD_PENDING, apldFromStored, asDHKEReq, asDHKEResp, asSealedMasterKey, b64tob, b64urltob, btob64, btob64url, btoh, CachedEntDB, checksumEntRevs, checksumSet, Clock, cmpBytes, crypto, Decoder, DEFAULT_PRF_SALT, defaultPeekProgressEvery, defaultWebAuthnRpId, eidCodec, Enclave, encodeEntRev, Encoder, EntDBMemory, EntIDB, EntitiesQuery, EntityID, entStateManager, genSingletonEID, GroupID, hostHTTPTransport, htob, HTTPTransport, IDBSeedStore, IDBStore, idleProgress, IEntDB, IEntity, isApldState, isLiveEnt, isPendingApply, isTerminalApplyFailure, isTombstone, IStore, KEYRING_MAX, keyringCredIds, keyringKind, keyringLabel, MASTER_SEED_LEN, MemoryStore, normalizeTags, nullEntDB, nullStateManager, openDiplomaticClient, openEntDB, openIDBStore, PairRequest, PasskeySeedStore, prfCapable, PrfSeedStore, revFromEntity, revFromHead, SEALED_MASTER_KEY_LEN, setApld, shouldEmitItemProgress, SingletonStateManager, StateManager, Status, SyncClient, TypedEventEmitter, useClient, useClientState, useClientXferState, useStateWatcher, useStateWatcherSuspense, useSyncOnResume, WorkerClient, };
46
+ export type { ApldState, Applier, BundleHost, CachedEntDBOptions, DHKEReq, DHKEResp, EntDBMemoryOptions, HostHandle, HostStatsUpdate, IClient, ICrypto, IDeleteParams, IDiplomaticClientState, IEntRev, IEntRow, IHostConnectionInfo, IHostRow, IMessage, IMutateOp, IOp, IStateManager, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ITombstone, ITransport, IUpdateParams, Keyring, KeyringEntry, KeyringRow, ListMsgsOpts, OpenDiplomaticClientMainOptions, OpenDiplomaticClientOptions, OpenDiplomaticClientWorkerOptions, OpenedDiplomaticClient, OpenEntDBOptions, PairPackagePlain, PasskeySeedStoreOpts, PersistKeyring, PrfRp, PrfSeedStoreOpts, ReconcileOpts, ReconcileReport, SealedMasterKey, SetSeedOpts, SyncProgressEvent, WipeOpts, WorkerClientOptions, };