@adcp/sdk 16.0.0-beta.1 → 16.0.0-beta.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.
Files changed (97) hide show
  1. package/dist/lib/core/SingleAgentClient.d.mts +10 -1
  2. package/dist/lib/core/SingleAgentClient.d.ts +10 -1
  3. package/dist/lib/core/SingleAgentClient.js +29 -8
  4. package/dist/lib/core/SingleAgentClient.mjs +29 -8
  5. package/dist/lib/identity-3.3/generated-compat.d.mts +34 -0
  6. package/dist/lib/identity-3.3/generated-compat.d.ts +34 -0
  7. package/dist/lib/identity-3.3/generated-compat.js +16 -0
  8. package/dist/lib/identity-3.3/generated-compat.mjs +0 -0
  9. package/dist/lib/identity-3.3/index.d.mts +2 -2
  10. package/dist/lib/identity-3.3/index.d.ts +2 -2
  11. package/dist/lib/identity-3.3/index.js +4 -0
  12. package/dist/lib/identity-3.3/index.mjs +5 -1
  13. package/dist/lib/identity-3.3/lifecycle.d.mts +17 -5
  14. package/dist/lib/identity-3.3/lifecycle.d.ts +17 -5
  15. package/dist/lib/identity-3.3/lifecycle.js +32 -5
  16. package/dist/lib/identity-3.3/lifecycle.mjs +38 -6
  17. package/dist/lib/identity-3.3/revocation.d.mts +39 -3
  18. package/dist/lib/identity-3.3/revocation.d.ts +39 -3
  19. package/dist/lib/identity-3.3/revocation.js +88 -18
  20. package/dist/lib/identity-3.3/revocation.mjs +89 -19
  21. package/dist/lib/identity-3.3/server.d.mts +12 -0
  22. package/dist/lib/identity-3.3/server.d.ts +12 -0
  23. package/dist/lib/identity-3.3/server.js +103 -43
  24. package/dist/lib/identity-3.3/server.mjs +111 -45
  25. package/dist/lib/identity-3.3/trust.d.mts +62 -1
  26. package/dist/lib/identity-3.3/trust.d.ts +62 -1
  27. package/dist/lib/identity-3.3/trust.js +126 -21
  28. package/dist/lib/identity-3.3/trust.mjs +124 -21
  29. package/dist/lib/identity-3.3/types.d.mts +39 -11
  30. package/dist/lib/identity-3.3/types.d.ts +39 -11
  31. package/dist/lib/index.d.mts +1 -1
  32. package/dist/lib/index.d.ts +1 -1
  33. package/dist/lib/index.js +2 -0
  34. package/dist/lib/index.mjs +2 -0
  35. package/dist/lib/protocols/index.d.mts +1 -1
  36. package/dist/lib/protocols/index.d.ts +1 -1
  37. package/dist/lib/protocols/index.js +2 -2
  38. package/dist/lib/protocols/index.mjs +2 -2
  39. package/dist/lib/reporting/bigquery/index.js +8 -0
  40. package/dist/lib/reporting/bigquery/index.mjs +8 -0
  41. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  42. package/dist/lib/server/auth-signature.d.mts +6 -1
  43. package/dist/lib/server/auth-signature.d.ts +6 -1
  44. package/dist/lib/server/auth-signature.js +24 -13
  45. package/dist/lib/server/auth-signature.mjs +29 -13
  46. package/dist/lib/server/auth.d.mts +2 -2
  47. package/dist/lib/server/auth.d.ts +2 -2
  48. package/dist/lib/server/create-adcp-server.js +31 -10
  49. package/dist/lib/server/create-adcp-server.mjs +37 -11
  50. package/dist/lib/signing/crypto.js +8 -0
  51. package/dist/lib/signing/crypto.mjs +9 -1
  52. package/dist/lib/signing/fetch-async.js +1 -1
  53. package/dist/lib/signing/fetch-async.mjs +1 -1
  54. package/dist/lib/signing/fetch.js +1 -1
  55. package/dist/lib/signing/fetch.mjs +1 -1
  56. package/dist/lib/signing/middleware.js +9 -0
  57. package/dist/lib/signing/middleware.mjs +14 -0
  58. package/dist/lib/signing/parser.d.mts +8 -5
  59. package/dist/lib/signing/parser.d.ts +8 -5
  60. package/dist/lib/signing/parser.js +77 -61
  61. package/dist/lib/signing/parser.mjs +77 -61
  62. package/dist/lib/signing/revocation.js +3 -0
  63. package/dist/lib/signing/revocation.mjs +3 -0
  64. package/dist/lib/signing/verifier.js +1 -1
  65. package/dist/lib/signing/verifier.mjs +1 -1
  66. package/dist/lib/signing/web-bot-auth.d.mts +84 -10
  67. package/dist/lib/signing/web-bot-auth.d.ts +84 -10
  68. package/dist/lib/signing/web-bot-auth.js +259 -82
  69. package/dist/lib/signing/web-bot-auth.mjs +259 -87
  70. package/dist/lib/signing/webhook-verifier.js +1 -1
  71. package/dist/lib/signing/webhook-verifier.mjs +1 -1
  72. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  73. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  74. package/dist/lib/v2/projection/catalog-snapshot.js +3 -1
  75. package/dist/lib/v2/projection/catalog-snapshot.mjs +3 -1
  76. package/dist/lib/v2/projection/creative-delivery.d.mts +31 -9
  77. package/dist/lib/v2/projection/creative-delivery.d.ts +31 -9
  78. package/dist/lib/v2/projection/index.d.mts +1 -1
  79. package/dist/lib/v2/projection/index.d.ts +1 -1
  80. package/dist/lib/v2/projection/index.js +2 -0
  81. package/dist/lib/v2/projection/index.mjs +2 -0
  82. package/dist/lib/v2/projection/legacy-routes.d.mts +10 -0
  83. package/dist/lib/v2/projection/legacy-routes.d.ts +10 -0
  84. package/dist/lib/v2/projection/legacy-routes.js +7 -0
  85. package/dist/lib/v2/projection/legacy-routes.mjs +6 -0
  86. package/dist/lib/version.d.mts +3 -3
  87. package/dist/lib/version.d.ts +3 -3
  88. package/dist/lib/version.js +3 -3
  89. package/dist/lib/version.mjs +3 -3
  90. package/docs/TYPE-SUMMARY.md +2 -2
  91. package/docs/guides/REPORTING-LEDGER.md +15 -5
  92. package/docs/guides/REPORTING-OPERATIONS.md +17 -11
  93. package/docs/llms.txt +2 -2
  94. package/docs/migration-12-to-13.md +8 -0
  95. package/docs/migration-14.x-rc-worksheet.md +4 -4
  96. package/docs/migration-agent-identity-3.3.md +150 -11
  97. package/package.json +3 -1
@@ -9,16 +9,46 @@ export declare const WEB_BOT_AUTH_PROFILE: "web-bot-auth";
9
9
  export declare const WEB_BOT_AUTH_DRAFT_REVISION: "draft-ietf-webbotauth-httpsig-protocol-00";
10
10
  export declare const SIGNATURE_DIRECTORY_PATH = "/.well-known/http-message-signatures-directory";
11
11
  export declare const SIGNATURE_DIRECTORY_MEDIA_TYPE = "application/http-message-signatures-directory+json";
12
- /** HTTP outcome, deliberately separate from the legacy request_signature_* taxonomy. */
12
+ /**
13
+ * Signature-path outcome (WBA §4, DR-0023): 400 for a field that does not
14
+ * parse, 403 for a signature that does not verify (with `Accept-Signature`
15
+ * unless the key is revoked), 429 for a replay. Any AdCP body is the generic
16
+ * authentication error; signature-specific detail stays in `reason` (logs).
17
+ * Infrastructure the verifier depends on is reported separately by
18
+ * {@link WebBotAuthUnavailableError}.
19
+ */
13
20
  export declare class WebBotAuthError extends Error {
14
21
  readonly status: 400 | 403 | 429;
15
22
  readonly reason: string;
16
23
  readonly headers: Record<string, string>;
17
24
  get body(): Record<string, unknown>;
25
+ /**
26
+ * The signer's identity could not be established because key discovery
27
+ * failed (WBA §6.10) or its revocation status is unknown. The request is
28
+ * unverified; servers apply their unverified-request policy.
29
+ */
30
+ get unverified(): boolean;
18
31
  constructor(status: 400 | 403 | 429, reason: string);
19
32
  }
33
+ /**
34
+ * Infrastructure the verifier depends on failed (replay store, revocation
35
+ * history store). Not a signature outcome and never answered as one: the
36
+ * application layer decides how to report the outage (the SDK's server
37
+ * integrations answer 503 SERVICE_UNAVAILABLE).
38
+ */
39
+ export declare class WebBotAuthUnavailableError extends Error {
40
+ readonly reason: string;
41
+ constructor(reason: string, cause?: unknown);
42
+ }
20
43
  export declare function selectSignatureProfile(request: Pick<RequestLike, 'headers'>): 'web-bot-auth' | 'rfc9421';
21
- export declare function jwkThumbprint(jwk: Partial<Pick<AdcpJsonWebKey, 'kty' | 'crv' | 'x' | 'y'>>): string;
44
+ /**
45
+ * RFC 7638 JWK SHA-256 thumbprint, synchronous. Byte-identical to jose's
46
+ * `calculateJwkThumbprint` for OKP, EC and RSA keys (tested).
47
+ */
48
+ export declare function jwkThumbprint(jwk: Partial<Pick<AdcpJsonWebKey, 'kty' | 'crv' | 'x' | 'y'>> & {
49
+ n?: unknown;
50
+ e?: unknown;
51
+ }): string;
22
52
  /** Reject authority normalization differentials on received identifiers. */
23
53
  export declare function receivedAgentOrigin(value: string): string;
24
54
  /** RFC 9421 dictionary-member extraction, including relay member coverage. */
@@ -29,7 +59,14 @@ export interface WebBotAuthAuthorizationFailure {
29
59
  message: string;
30
60
  recovery: 'correctable' | 'transient';
31
61
  }
32
- export declare function createWebBotAuthAuthorizationFailure(reason: 'key_revoked' | 'identity_not_bound' | 'revocation_unavailable'): WebBotAuthAuthorizationFailure;
62
+ declare const AUTHORIZATION_FAILURE_MESSAGES: {
63
+ readonly key_revoked: "Agent identity key is revoked";
64
+ readonly identity_not_bound: "Agent identity is not onboarded for this operation";
65
+ readonly revocation_unavailable: "Identity revocation information is unavailable";
66
+ readonly authorization_failed: "Agent authorization failed";
67
+ readonly authorization_unavailable: "Agent authorization is temporarily unavailable";
68
+ };
69
+ export declare function createWebBotAuthAuthorizationFailure(reason: keyof typeof AUTHORIZATION_FAILURE_MESSAGES): WebBotAuthAuthorizationFailure;
33
70
  export declare function getWebBotAuthAuthorizationFailure(extra: Record<string, unknown> | undefined): WebBotAuthAuthorizationFailure | undefined;
34
71
  export declare function webBotAuthToolFailure(failure: WebBotAuthAuthorizationFailure, version?: string): {
35
72
  isError: true;
@@ -48,27 +85,52 @@ export interface VerifiedWebBotSigner {
48
85
  authorizationFailure?: WebBotAuthAuthorizationFailure;
49
86
  }
50
87
  export interface VerifyWebBotAuthOptions {
88
+ /** Key discovery (WBA §5.5). The only network dependency of verification. */
51
89
  directory: SignatureDirectoryResolver;
52
90
  /** Published fixture keys are allowed only outside production. */
53
91
  allowTestKeys?: boolean;
54
- /** Unknown revocation state is acceptable only for trusted read operations. */
55
- requireFreshRevocation?: boolean;
56
- /** SDK server adapters carry verified authorization denials into normal tool errors. */
57
- deferAuthorizationErrors?: boolean;
58
92
  /** Atomic, shared across endpoints and replicas. Nonce scope is the identity origin, not the rotating kid. */
59
93
  replayStore: ReplayStore;
60
94
  now?: () => number;
61
- isRevoked: (origin: string, keyid: string) => Promise<boolean>;
62
95
  /** Older #7894 vector draft expects 403; ratified R2 defaults to 429. */
63
96
  replayStatus?: 403 | 429;
97
+ /**
98
+ * @deprecated Revocation is an identity and authorization check, not part of
99
+ * signature verification: call `OriginRevocationResolver.status()` after
100
+ * verification (`createIdentity33PrincipalResolver({ revocation })` does).
101
+ * When supplied it is still consulted: a revoked key is a 403 without
102
+ * `Accept-Signature`, unknown status leaves the identity unverified, and a
103
+ * history-store failure is a {@link WebBotAuthUnavailableError}.
104
+ */
105
+ isRevoked?: (origin: string, keyid: string) => Promise<boolean>;
106
+ /** @deprecated Only affects the deprecated `isRevoked` path: `false` tolerates unknown status. */
107
+ requireFreshRevocation?: boolean;
108
+ /** @deprecated No effect; revocation outcomes are no longer deferred into tool errors. */
109
+ deferAuthorizationErrors?: boolean;
64
110
  }
65
111
  export declare function verifyWebBotAuth(request: RequestLike, options: VerifyWebBotAuthOptions): Promise<VerifiedWebBotSigner[]>;
66
112
  export interface VerifiedSignatureDirectory {
67
113
  keys: AdcpJsonWebKey[];
114
+ /** Signed: the earliest proof expiry. Unsigned: verification time plus the unsigned-age bound. */
68
115
  expires: number;
69
- /** Preserve exact signed bytes and response headers for auditing. */
116
+ /** Whether every key carried an Appendix B signature. */
117
+ signed: boolean;
118
+ /** Preserve exact bytes and response headers for auditing. */
70
119
  proof: ResponseLike;
71
120
  }
121
+ /**
122
+ * Verify a key directory response (draft-meunier-http-message-signatures-directory).
123
+ * Appendix B signatures are a SHOULD there: a directory without
124
+ * `Signature-Input` is accepted as a plain JWKS unless `requireSigned`, with
125
+ * every key checked against its RFC 7638 thumbprint. When signatures are
126
+ * present, every key must carry a valid one.
127
+ */
128
+ export declare function verifyKeyDirectory(response: ResponseLike, now?: number, options?: {
129
+ allowTestKeys?: boolean;
130
+ requireSigned?: boolean;
131
+ maxUnsignedAgeSeconds?: number;
132
+ }): VerifiedSignatureDirectory;
133
+ /** Signed directories only (Appendix B). Prefer {@link verifyKeyDirectory}. */
72
134
  export declare function verifySignatureDirectory(response: ResponseLike, now?: number, allowTestKeys?: boolean): VerifiedSignatureDirectory;
73
135
  export interface SignatureDirectoryResolverOptions {
74
136
  now?: () => number;
@@ -77,8 +139,17 @@ export interface SignatureDirectoryResolverOptions {
77
139
  maxOrigins?: number;
78
140
  /** Globally bound concurrency across attacker-selected origins. */
79
141
  maxConcurrentFetches?: number;
142
+ /** Refuse plain JWKS directories without Appendix B signatures. Default false. */
143
+ requireSignedDirectories?: boolean;
144
+ /** How long an unsigned directory may keep verifying after a failed refresh (seconds). Default 86400. */
145
+ maxUnsignedDirectoryAgeSeconds?: number;
80
146
  }
81
- /** Multi-origin discovery. Cache keys never collapse origins sharing a kid. */
147
+ /**
148
+ * Multi-origin key discovery. Cache keys never collapse origins sharing a
149
+ * kid. A failed refresh (any transport error or non-200, 404/410 included) is
150
+ * a discovery failure: it never evicts a cached, unexpired directory, which
151
+ * keeps verifying (WBA §6.10). Without one, the request is unverified.
152
+ */
82
153
  export declare class SignatureDirectoryResolver implements JwksResolver {
83
154
  private readonly options;
84
155
  private readonly cache;
@@ -89,6 +160,8 @@ export declare class SignatureDirectoryResolver implements JwksResolver {
89
160
  resolve(keyid: string, signerOrigin?: string): Promise<AdcpJsonWebKey | null>;
90
161
  private fetch;
91
162
  get allowsTestKeys(): boolean;
163
+ /** The directory currently used to verify `origin`, including one kept through a failed refresh. */
164
+ getVerifiedDirectory(origin: string): VerifiedSignatureDirectory | undefined;
92
165
  getAuditProof(origin: string): ResponseLike | undefined;
93
166
  }
94
167
  export interface WebBotSigningOptions {
@@ -115,3 +188,4 @@ export declare function createSignedSignatureDirectory(originUrl: string, signin
115
188
  export declare function createWebBotAuthFetch(upstream: typeof fetch, key: WebBotSigningKey, options: WebBotSigningOptions & {
116
189
  shouldSign?: (url: string, init?: RequestInit) => boolean;
117
190
  }): typeof fetch;
191
+ export {};
@@ -9,16 +9,46 @@ export declare const WEB_BOT_AUTH_PROFILE: "web-bot-auth";
9
9
  export declare const WEB_BOT_AUTH_DRAFT_REVISION: "draft-ietf-webbotauth-httpsig-protocol-00";
10
10
  export declare const SIGNATURE_DIRECTORY_PATH = "/.well-known/http-message-signatures-directory";
11
11
  export declare const SIGNATURE_DIRECTORY_MEDIA_TYPE = "application/http-message-signatures-directory+json";
12
- /** HTTP outcome, deliberately separate from the legacy request_signature_* taxonomy. */
12
+ /**
13
+ * Signature-path outcome (WBA §4, DR-0023): 400 for a field that does not
14
+ * parse, 403 for a signature that does not verify (with `Accept-Signature`
15
+ * unless the key is revoked), 429 for a replay. Any AdCP body is the generic
16
+ * authentication error; signature-specific detail stays in `reason` (logs).
17
+ * Infrastructure the verifier depends on is reported separately by
18
+ * {@link WebBotAuthUnavailableError}.
19
+ */
13
20
  export declare class WebBotAuthError extends Error {
14
21
  readonly status: 400 | 403 | 429;
15
22
  readonly reason: string;
16
23
  readonly headers: Record<string, string>;
17
24
  get body(): Record<string, unknown>;
25
+ /**
26
+ * The signer's identity could not be established because key discovery
27
+ * failed (WBA §6.10) or its revocation status is unknown. The request is
28
+ * unverified; servers apply their unverified-request policy.
29
+ */
30
+ get unverified(): boolean;
18
31
  constructor(status: 400 | 403 | 429, reason: string);
19
32
  }
33
+ /**
34
+ * Infrastructure the verifier depends on failed (replay store, revocation
35
+ * history store). Not a signature outcome and never answered as one: the
36
+ * application layer decides how to report the outage (the SDK's server
37
+ * integrations answer 503 SERVICE_UNAVAILABLE).
38
+ */
39
+ export declare class WebBotAuthUnavailableError extends Error {
40
+ readonly reason: string;
41
+ constructor(reason: string, cause?: unknown);
42
+ }
20
43
  export declare function selectSignatureProfile(request: Pick<RequestLike, 'headers'>): 'web-bot-auth' | 'rfc9421';
21
- export declare function jwkThumbprint(jwk: Partial<Pick<AdcpJsonWebKey, 'kty' | 'crv' | 'x' | 'y'>>): string;
44
+ /**
45
+ * RFC 7638 JWK SHA-256 thumbprint, synchronous. Byte-identical to jose's
46
+ * `calculateJwkThumbprint` for OKP, EC and RSA keys (tested).
47
+ */
48
+ export declare function jwkThumbprint(jwk: Partial<Pick<AdcpJsonWebKey, 'kty' | 'crv' | 'x' | 'y'>> & {
49
+ n?: unknown;
50
+ e?: unknown;
51
+ }): string;
22
52
  /** Reject authority normalization differentials on received identifiers. */
23
53
  export declare function receivedAgentOrigin(value: string): string;
24
54
  /** RFC 9421 dictionary-member extraction, including relay member coverage. */
@@ -29,7 +59,14 @@ export interface WebBotAuthAuthorizationFailure {
29
59
  message: string;
30
60
  recovery: 'correctable' | 'transient';
31
61
  }
32
- export declare function createWebBotAuthAuthorizationFailure(reason: 'key_revoked' | 'identity_not_bound' | 'revocation_unavailable'): WebBotAuthAuthorizationFailure;
62
+ declare const AUTHORIZATION_FAILURE_MESSAGES: {
63
+ readonly key_revoked: "Agent identity key is revoked";
64
+ readonly identity_not_bound: "Agent identity is not onboarded for this operation";
65
+ readonly revocation_unavailable: "Identity revocation information is unavailable";
66
+ readonly authorization_failed: "Agent authorization failed";
67
+ readonly authorization_unavailable: "Agent authorization is temporarily unavailable";
68
+ };
69
+ export declare function createWebBotAuthAuthorizationFailure(reason: keyof typeof AUTHORIZATION_FAILURE_MESSAGES): WebBotAuthAuthorizationFailure;
33
70
  export declare function getWebBotAuthAuthorizationFailure(extra: Record<string, unknown> | undefined): WebBotAuthAuthorizationFailure | undefined;
34
71
  export declare function webBotAuthToolFailure(failure: WebBotAuthAuthorizationFailure, version?: string): {
35
72
  isError: true;
@@ -48,27 +85,52 @@ export interface VerifiedWebBotSigner {
48
85
  authorizationFailure?: WebBotAuthAuthorizationFailure;
49
86
  }
50
87
  export interface VerifyWebBotAuthOptions {
88
+ /** Key discovery (WBA §5.5). The only network dependency of verification. */
51
89
  directory: SignatureDirectoryResolver;
52
90
  /** Published fixture keys are allowed only outside production. */
53
91
  allowTestKeys?: boolean;
54
- /** Unknown revocation state is acceptable only for trusted read operations. */
55
- requireFreshRevocation?: boolean;
56
- /** SDK server adapters carry verified authorization denials into normal tool errors. */
57
- deferAuthorizationErrors?: boolean;
58
92
  /** Atomic, shared across endpoints and replicas. Nonce scope is the identity origin, not the rotating kid. */
59
93
  replayStore: ReplayStore;
60
94
  now?: () => number;
61
- isRevoked: (origin: string, keyid: string) => Promise<boolean>;
62
95
  /** Older #7894 vector draft expects 403; ratified R2 defaults to 429. */
63
96
  replayStatus?: 403 | 429;
97
+ /**
98
+ * @deprecated Revocation is an identity and authorization check, not part of
99
+ * signature verification: call `OriginRevocationResolver.status()` after
100
+ * verification (`createIdentity33PrincipalResolver({ revocation })` does).
101
+ * When supplied it is still consulted: a revoked key is a 403 without
102
+ * `Accept-Signature`, unknown status leaves the identity unverified, and a
103
+ * history-store failure is a {@link WebBotAuthUnavailableError}.
104
+ */
105
+ isRevoked?: (origin: string, keyid: string) => Promise<boolean>;
106
+ /** @deprecated Only affects the deprecated `isRevoked` path: `false` tolerates unknown status. */
107
+ requireFreshRevocation?: boolean;
108
+ /** @deprecated No effect; revocation outcomes are no longer deferred into tool errors. */
109
+ deferAuthorizationErrors?: boolean;
64
110
  }
65
111
  export declare function verifyWebBotAuth(request: RequestLike, options: VerifyWebBotAuthOptions): Promise<VerifiedWebBotSigner[]>;
66
112
  export interface VerifiedSignatureDirectory {
67
113
  keys: AdcpJsonWebKey[];
114
+ /** Signed: the earliest proof expiry. Unsigned: verification time plus the unsigned-age bound. */
68
115
  expires: number;
69
- /** Preserve exact signed bytes and response headers for auditing. */
116
+ /** Whether every key carried an Appendix B signature. */
117
+ signed: boolean;
118
+ /** Preserve exact bytes and response headers for auditing. */
70
119
  proof: ResponseLike;
71
120
  }
121
+ /**
122
+ * Verify a key directory response (draft-meunier-http-message-signatures-directory).
123
+ * Appendix B signatures are a SHOULD there: a directory without
124
+ * `Signature-Input` is accepted as a plain JWKS unless `requireSigned`, with
125
+ * every key checked against its RFC 7638 thumbprint. When signatures are
126
+ * present, every key must carry a valid one.
127
+ */
128
+ export declare function verifyKeyDirectory(response: ResponseLike, now?: number, options?: {
129
+ allowTestKeys?: boolean;
130
+ requireSigned?: boolean;
131
+ maxUnsignedAgeSeconds?: number;
132
+ }): VerifiedSignatureDirectory;
133
+ /** Signed directories only (Appendix B). Prefer {@link verifyKeyDirectory}. */
72
134
  export declare function verifySignatureDirectory(response: ResponseLike, now?: number, allowTestKeys?: boolean): VerifiedSignatureDirectory;
73
135
  export interface SignatureDirectoryResolverOptions {
74
136
  now?: () => number;
@@ -77,8 +139,17 @@ export interface SignatureDirectoryResolverOptions {
77
139
  maxOrigins?: number;
78
140
  /** Globally bound concurrency across attacker-selected origins. */
79
141
  maxConcurrentFetches?: number;
142
+ /** Refuse plain JWKS directories without Appendix B signatures. Default false. */
143
+ requireSignedDirectories?: boolean;
144
+ /** How long an unsigned directory may keep verifying after a failed refresh (seconds). Default 86400. */
145
+ maxUnsignedDirectoryAgeSeconds?: number;
80
146
  }
81
- /** Multi-origin discovery. Cache keys never collapse origins sharing a kid. */
147
+ /**
148
+ * Multi-origin key discovery. Cache keys never collapse origins sharing a
149
+ * kid. A failed refresh (any transport error or non-200, 404/410 included) is
150
+ * a discovery failure: it never evicts a cached, unexpired directory, which
151
+ * keeps verifying (WBA §6.10). Without one, the request is unverified.
152
+ */
82
153
  export declare class SignatureDirectoryResolver implements JwksResolver {
83
154
  private readonly options;
84
155
  private readonly cache;
@@ -89,6 +160,8 @@ export declare class SignatureDirectoryResolver implements JwksResolver {
89
160
  resolve(keyid: string, signerOrigin?: string): Promise<AdcpJsonWebKey | null>;
90
161
  private fetch;
91
162
  get allowsTestKeys(): boolean;
163
+ /** The directory currently used to verify `origin`, including one kept through a failed refresh. */
164
+ getVerifiedDirectory(origin: string): VerifiedSignatureDirectory | undefined;
92
165
  getAuditProof(origin: string): ResponseLike | undefined;
93
166
  }
94
167
  export interface WebBotSigningOptions {
@@ -115,3 +188,4 @@ export declare function createSignedSignatureDirectory(originUrl: string, signin
115
188
  export declare function createWebBotAuthFetch(upstream: typeof fetch, key: WebBotSigningKey, options: WebBotSigningOptions & {
116
189
  shouldSign?: (url: string, init?: RequestInit) => boolean;
117
190
  }): typeof fetch;
191
+ export {};