@interncom/diplomatic 0.13.0 → 0.13.2

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,4 +1,4 @@
1
- import { Enclave } from "../shared/crypto/enclave";
1
+ import { Enclave, type PasskeyPrfOpts } from "../shared/crypto/enclave";
2
2
  import { type SealedMasterKey } from "../shared/seed";
3
3
  import { type ValStat } from "../shared/valstat";
4
4
  import type { ISeedStore, SetSeedOpts } from "../types";
@@ -47,11 +47,7 @@ export declare class PrfSeedStore implements ISeedStore {
47
47
  /**
48
48
  * PRF UV inside Enclave, seal master, persist meta (no PRF leaves Enclave).
49
49
  */
50
- wrapAndSave(enclave: Enclave, opts?: {
51
- salt?: Uint8Array;
52
- credId?: Uint8Array;
53
- createCredIfNeeded?: boolean;
54
- }): Promise<ValStat<Enclave>>;
50
+ wrapAndSave(enclave: Enclave, opts?: Pick<PasskeyPrfOpts, "salt" | "credId" | "createCredIfNeeded" | "authenticatorAttachment">): Promise<ValStat<Enclave>>;
55
51
  load(): Promise<Enclave | void>;
56
52
  /** Passkey UV inside Enclave → new session enclave. */
57
53
  unlock(): Promise<ValStat<Enclave>>;
@@ -9,12 +9,10 @@ import { type PrfCreateOpts, type PrfEvalOpts, type PrfRp } from "../webauthn/pr
9
9
  export type { LargeBlobCreateOpts, LargeBlobRp };
10
10
  export type { PrfCreateOpts, PrfEvalOpts, PrfRp };
11
11
  /** Options for PRF seal/unseal ceremonies (no raw PRF bytes). */
12
- export type PasskeyPrfOpts = PrfRp & {
13
- salt?: Uint8Array;
12
+ export type PasskeyPrfOpts = PrfCreateOpts & {
14
13
  credId?: Uint8Array;
15
14
  /** Seal only: create a PRF credential first when no credId is known. */
16
15
  createCredIfNeeded?: boolean;
17
- userName?: string;
18
16
  };
19
17
  /** Durable PRF-sealed master + public meta (never includes PRF output). */
20
18
  export type PrfSealedMaster = {
@@ -3,7 +3,10 @@ import { type WebAuthnRp } from "./common.ts";
3
3
  export type PrfRp = WebAuthnRp;
4
4
  export type PrfCreateOpts = PrfRp & {
5
5
  userName?: string;
6
- authenticatorAttachment?: string;
6
+ /** Omit so the UA can offer roaming keys (YubiKey) and third-party providers. */
7
+ authenticatorAttachment?: "platform" | "cross-platform";
8
+ /** If set, also request PRF eval during create. `{ prf: {} }` already enables hmac-secret. */
9
+ salt?: Uint8Array;
7
10
  };
8
11
  /** Default salt for DIPLOMATIC PRF eval (UTF-8). */
9
12
  export declare const DEFAULT_PRF_SALT: Uint8Array<ArrayBufferLike>;