@substrat-run/contracts 0.159.0 → 0.161.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.
Files changed (41) hide show
  1. package/dist/attachments.d.ts +102 -0
  2. package/dist/attachments.d.ts.map +1 -1
  3. package/dist/attachments.js +100 -1
  4. package/dist/attachments.js.map +1 -1
  5. package/dist/control-plane.d.ts +379 -8
  6. package/dist/control-plane.d.ts.map +1 -1
  7. package/dist/control-plane.js +341 -9
  8. package/dist/control-plane.js.map +1 -1
  9. package/dist/file-source.d.ts +167 -0
  10. package/dist/file-source.d.ts.map +1 -0
  11. package/dist/file-source.js +144 -0
  12. package/dist/file-source.js.map +1 -0
  13. package/dist/ids.d.ts +7 -0
  14. package/dist/ids.d.ts.map +1 -1
  15. package/dist/ids.js +7 -0
  16. package/dist/ids.js.map +1 -1
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/introspection.d.ts +1 -0
  22. package/dist/introspection.d.ts.map +1 -1
  23. package/dist/introspection.js +11 -0
  24. package/dist/introspection.js.map +1 -1
  25. package/dist/platform-request.d.ts +2 -2
  26. package/dist/platform-request.d.ts.map +1 -1
  27. package/dist/platform-request.js +8 -6
  28. package/dist/platform-request.js.map +1 -1
  29. package/dist/registry.d.ts +27 -0
  30. package/dist/registry.d.ts.map +1 -1
  31. package/dist/registry.js +28 -0
  32. package/dist/registry.js.map +1 -1
  33. package/dist/wire-headers.d.ts +15 -0
  34. package/dist/wire-headers.d.ts.map +1 -1
  35. package/dist/wire-headers.js +15 -0
  36. package/dist/wire-headers.js.map +1 -1
  37. package/dist/wire-signing.d.ts +443 -0
  38. package/dist/wire-signing.d.ts.map +1 -0
  39. package/dist/wire-signing.js +734 -0
  40. package/dist/wire-signing.js.map +1 -0
  41. package/package.json +5 -1
@@ -0,0 +1,443 @@
1
+ import { type ScopeStoreKeyProblem } from './scope-store-envelope.js';
2
+ export declare const WIRE_ENVELOPE_VERSION = 1;
3
+ /** The first line of every wire envelope: the protocol and its version. */
4
+ export declare const WIRE_ENVELOPE_TAG: "substrat-wire/1";
5
+ /** The request header carrying base64url of the canonical bytes. */
6
+ export declare const WIRE_ENVELOPE_HEADER = "x-substrat-wire-envelope";
7
+ /** The request header carrying the base64url signature. */
8
+ export declare const WIRE_SIGNATURE_HEADER = "x-substrat-wire-signature";
9
+ /** What a signer gives an envelope when it is not told: `exp = iat + 60`. */
10
+ export declare const WIRE_ENVELOPE_LIFETIME_SECONDS = 60;
11
+ /** The longest `exp - iat` a verifier accepts, and a signer mints. */
12
+ export declare const WIRE_ENVELOPE_MAX_LIFETIME_SECONDS = 120;
13
+ /** How far a verifier's clock may be from the signer's, on either side of `[iat, exp]`. */
14
+ export declare const WIRE_CLOCK_SKEW_SECONDS = 30;
15
+ export type WireIssuer = 'router' | 'platform';
16
+ export type WireKind = 'route' | 'call';
17
+ /** Whether a field is carried: always, possibly (empty when not), or never (always empty). */
18
+ export type WireFieldPresence = 'required' | 'optional' | 'absent';
19
+ export interface WireEnvelopeShape {
20
+ /** The tenant and scope, as a pair: both ULIDs or both empty. */
21
+ readonly scope: WireFieldPresence;
22
+ readonly surface: WireFieldPresence;
23
+ readonly vertical: WireFieldPresence;
24
+ readonly body: WireFieldPresence;
25
+ }
26
+ /** What an (iss, kind) pair carries, or undefined when version 1 does not admit the pair. */
27
+ export declare function wireEnvelopeShape(iss: string, kind: string): WireEnvelopeShape | undefined;
28
+ /** One envelope's fields. An absent field is `null`, never an empty string. */
29
+ export interface WireClaims {
30
+ readonly v: 1;
31
+ readonly iss: WireIssuer;
32
+ readonly kind: WireKind;
33
+ readonly kid: string;
34
+ readonly aud: string;
35
+ readonly tenantId: string | null;
36
+ readonly scopeId: string | null;
37
+ readonly surface: string | null;
38
+ readonly vertical: string | null;
39
+ readonly method: string;
40
+ readonly targetDigest: string;
41
+ readonly bodyDigest: string | null;
42
+ readonly iat: number;
43
+ readonly exp: number;
44
+ readonly nonce: string;
45
+ }
46
+ /** The claims those bytes name, or undefined when they are not exactly what the encoder emits. */
47
+ export declare function parseWireEnvelope(canonical: string): WireClaims | undefined;
48
+ /**
49
+ * The canonical text a header carries and the claims it names, or undefined when the header is not
50
+ * base64url of exactly what the encoder emits. Nothing is verified here: the verifier decodes with
51
+ * this, and an entry may read the claims beforehand only to choose what to verify them against.
52
+ */
53
+ export declare function decodeWireEnvelope(header: string): {
54
+ readonly canonical: string;
55
+ readonly claims: WireClaims;
56
+ } | undefined;
57
+ /**
58
+ * The encoder's refusal of claims no verifier would accept: a field the parser would refuse, a body
59
+ * where the pair binds none or none where it binds one, a lifetime past the maximum. Its own class, so
60
+ * a signer counts it as `claims` and every other throw as `error` (RFC §8).
61
+ */
62
+ export declare class WireClaimsError extends Error {
63
+ readonly name = "WireClaimsError";
64
+ }
65
+ /** Fifteen lines, no trailing newline. Throws {@link WireClaimsError} on a field the parser would refuse. */
66
+ export declare function canonicalWireEnvelope(claims: WireClaims): string;
67
+ /** A body or a target, as the bytes a digest is taken over. A string is its UTF-8. */
68
+ export type WireBytes = string | ArrayBuffer | ArrayBufferView;
69
+ /** SHA-256 of the exact bytes, lowercase hex: for a string, the store's body digest. */
70
+ export declare function wireDigest(data: WireBytes): Promise<string>;
71
+ /**
72
+ * What an envelope binds of a request, read the same way by the signer (from the request it is
73
+ * about to send) and the verifier (from the request it received): the method, upper-cased, and
74
+ * the target, the URL's pathname plus its search as the URL API serializes them. The fragment
75
+ * never travels, and an empty `?` reads as no query on both ends.
76
+ */
77
+ export declare function wireRequestBinding(request: {
78
+ readonly method: string;
79
+ readonly url: string;
80
+ }): {
81
+ readonly method: string;
82
+ readonly target: string;
83
+ };
84
+ /** A signing key that is present but cannot be used. Its message never carries the key. */
85
+ export declare class WireKeyError extends Error {
86
+ readonly reason: ScopeStoreKeyProblem;
87
+ readonly name = "WireKeyError";
88
+ constructor(message: string, reason: ScopeStoreKeyProblem);
89
+ }
90
+ /** An imported private key and the key id its envelopes name. Import once per isolate. */
91
+ export interface WireSigningKey {
92
+ readonly kid: string;
93
+ readonly publicKey: string;
94
+ readonly key: CryptoKey;
95
+ }
96
+ /**
97
+ * Import a PKCS8 Ed25519 private key (base64url) for signing. The key is judged by the store
98
+ * module's own check (only the 48-byte PKCS8 v1 form, never a small-order point), so the store
99
+ * key tooling's `generate` and `doctor` accept and refuse the same values. Throws
100
+ * {@link WireKeyError} when it is unusable.
101
+ */
102
+ export declare function importWireSigningKey(pkcs8: string): Promise<WireSigningKey>;
103
+ /** What a signer is told. Absent optional fields are omitted or `null`. */
104
+ export interface WireEnvelopeInput {
105
+ readonly iss: WireIssuer;
106
+ readonly kind: WireKind;
107
+ readonly aud: string;
108
+ readonly tenantId?: string | null;
109
+ readonly scopeId?: string | null;
110
+ readonly surface?: string | null;
111
+ readonly vertical?: string | null;
112
+ /** From {@link wireRequestBinding} over the request being sent. */
113
+ readonly method: string;
114
+ readonly target: string;
115
+ /** A call's exact body (an empty one is `''`). A route takes none. */
116
+ readonly body?: WireBytes;
117
+ /** Defaults to now. */
118
+ readonly iat?: number;
119
+ /** Defaults to `iat` + {@link WIRE_ENVELOPE_LIFETIME_SECONDS}. */
120
+ readonly exp?: number;
121
+ /** Defaults to 16 random bytes. */
122
+ readonly nonce?: string;
123
+ }
124
+ export interface IssuedWireEnvelope {
125
+ readonly claims: WireClaims;
126
+ readonly canonical: string;
127
+ /** {@link WIRE_ENVELOPE_HEADER} carries it: base64url of the canonical UTF-8 bytes. */
128
+ readonly header: string;
129
+ /** {@link WIRE_SIGNATURE_HEADER} carries it. */
130
+ readonly signature: string;
131
+ }
132
+ /** Build, digest and sign one envelope. Throws {@link WireClaimsError} on an input no verifier would accept. */
133
+ export declare function signWireEnvelope(key: WireSigningKey, input: WireEnvelopeInput): Promise<IssuedWireEnvelope>;
134
+ /**
135
+ * The public keys a deployment verifies with, per issuer, by key id. Only {@link wireVerificationKeys}
136
+ * makes one, and only the same copy of this module accepts it: the mark is held by the module
137
+ * instance, so a key set built by a second copy of the package (two bundled versions, say) throws
138
+ * on every call. Build the key set and verify in the same bundle.
139
+ */
140
+ export interface WireVerificationKeys {
141
+ readonly router: ReadonlyMap<string, string>;
142
+ readonly platform: ReadonlyMap<string, string>;
143
+ }
144
+ /**
145
+ * Each issuer's public keys, from the configured lists: raw Ed25519 keys, base64url, separated
146
+ * by commas, as the store's lists are and refused for the same faults. An unset or blank list is
147
+ * no keys, which verifies nothing. Throws on a key listed for both issuers: whoever holds the
148
+ * router's private key could then sign as the platform.
149
+ */
150
+ export declare function wireVerificationKeys(config: {
151
+ readonly router?: string;
152
+ readonly platform?: string;
153
+ }): Promise<WireVerificationKeys>;
154
+ /**
155
+ * Where a deployment records the nonces of envelopes it accepted, so a replay inside the window
156
+ * is refused. An interface only: the RFC puts the store in the scope's own object, for the calls
157
+ * that change state.
158
+ */
159
+ export interface WireNonceCache {
160
+ /**
161
+ * Record `nonce` as spent until `until` (Unix seconds) and answer whether it was unspent. It
162
+ * answers `true` at most once per nonce while recorded, concurrent claims included, and may
163
+ * forget a nonce after `until`, and a claim made after `until` by its own clock answers `false`:
164
+ * that is what makes forgetting safe. The verifier also refuses, without asking, a claim it would
165
+ * make after `until` by its own clock (a slow body). Only `true` itself is acceptance: any other
166
+ * answer refuses. A cache that cannot answer throws, and the verifier never reads a throw as
167
+ * acceptance. The entry bounds each claim in time and treats a timeout as that throw.
168
+ */
169
+ claim(nonce: string, until: number): boolean | Promise<boolean>;
170
+ }
171
+ /**
172
+ * How a call is held against replay, stated by the endpoint, never defaulted: `'none'` keeps no
173
+ * nonce memory, so a replay inside the window is accepted (a read, an idempotent call); a cache
174
+ * spends each nonce once (a call that changes state). A call expectation without one throws.
175
+ */
176
+ export type WireReplayPolicy = 'none' | WireNonceCache;
177
+ /** What a deployment expects of an envelope: who signs, for whom, and the request it rides on. */
178
+ interface WireExpectationOf<K extends WireKind> {
179
+ readonly iss: WireIssuer;
180
+ readonly kind: K;
181
+ /** This deployment's own name. An empty one matches nothing. */
182
+ readonly aud: string;
183
+ /** From {@link wireRequestBinding} over the request received. */
184
+ readonly method: string;
185
+ readonly target: string;
186
+ /** When given, the envelope must name exactly this tenant. */
187
+ readonly tenantId?: string;
188
+ /** When given, the envelope must name exactly this scope. */
189
+ readonly scopeId?: string;
190
+ }
191
+ /**
192
+ * A call's body, read on demand: the verifier calls it only when the body is the next check, after
193
+ * the signature, the audience, the lifetime, the clock, the method and the target have passed, so an
194
+ * envelope refused for any of those never costs a read. The tenant and scope pins, and a nonce claim,
195
+ * come after it, in the order §3.4 of the RFC fixes. It answers `null` when the body could not be read, which is refused as `body`.
196
+ */
197
+ export type WireBodyReader = () => WireBytes | null | Promise<WireBytes | null>;
198
+ export type WireExpectation = WireExpectationOf<'route'> | (WireExpectationOf<'call'> & {
199
+ /** The exact body received, read before any of it is acted on; or a reader that reads it then. */
200
+ readonly body: WireBytes | WireBodyReader;
201
+ /** Required: an endpoint that forgets to say fails closed, rather than accepting replays. */
202
+ readonly replay: WireReplayPolicy;
203
+ });
204
+ /** Why an envelope was refused, in the order the verifier checks. For metrics only. */
205
+ export declare const WIRE_REFUSAL_REASONS: readonly ['missing', 'malformed', 'issuer', 'kind', 'kid', 'signature', 'audience', 'lifetime', 'not-yet-valid', 'expired', 'method', 'target', 'body', 'scope', 'claim-after-until', 'replay'];
206
+ export type WireRefusalReason = (typeof WIRE_REFUSAL_REASONS)[number];
207
+ export interface WireAccepted {
208
+ readonly ok: true;
209
+ readonly claims: WireClaims;
210
+ }
211
+ /** The one refusal. Every failure returns this same object, so none can be told from another. */
212
+ export interface WireRefused {
213
+ readonly ok: false;
214
+ }
215
+ export declare const WIRE_REFUSED: WireRefused;
216
+ export type WireVerdict = WireAccepted | WireRefused;
217
+ /**
218
+ * Every check a deployment makes on an envelope, in one fixed order: present, well-formed, the
219
+ * expected issuer and kind, a listed key id, the signature, then (all over signed bytes) the
220
+ * audience, the lifetime, the clock, the method, the target, a call's body, any pinned tenant
221
+ * and scope, and last a call's nonce when its policy keeps them, so an envelope that fails anything
222
+ * else never spends a cache entry. A route keeps no nonces. `nowSeconds` is the time the request
223
+ * arrived, not when its body finished reading.
224
+ *
225
+ * Returns {@link WIRE_REFUSED} for every failure of the caller's. `onRefusal` hears the reason; a
226
+ * throw or a rejection from it is ignored. The deployment's own faults throw instead, so no counter
227
+ * files them under a caller, and they are checked before anything else: a key set
228
+ * {@link wireVerificationKeys} did not build, a call expectation whose replay policy is neither
229
+ * `'none'` nor a cache, a cache with no pinned `scopeId` (a cache lives in one scope's object, so
230
+ * the endpoint pins the scope it claims through), and a cache with no `clockSeconds` function. Two
231
+ * more are found only when a nonce is about to be claimed, and throw then: a claim clock that reads
232
+ * something other than a finite, non-negative number of seconds (a promise from an async clock
233
+ * included), before the cache is asked; and a throw from the cache.
234
+ */
235
+ export declare function verifyWireEnvelope(input: {
236
+ readonly headers: {
237
+ get(name: string): string | null;
238
+ };
239
+ readonly keys: WireVerificationKeys;
240
+ readonly expected: WireExpectation;
241
+ /** When the request arrived: what the envelope's window is judged against. */
242
+ readonly nowSeconds: number;
243
+ /**
244
+ * The time now, read again just before a nonce is claimed, after the body has been read: the same
245
+ * clock `nowSeconds` was read from. Required when the replay policy is a cache (it throws otherwise,
246
+ * before anything is read). A claim that would come after the cache may have forgotten the nonce is
247
+ * refused as `claim-after-until`.
248
+ */
249
+ readonly clockSeconds?: () => number;
250
+ /** Whatever it returns is ignored; a promise it returns is awaited by nobody and its rejection caught. */
251
+ readonly onRefusal?: (reason: WireRefusalReason) => unknown;
252
+ }): Promise<WireVerdict>;
253
+ /** The router's public keys, a comma-separated list. Plain configuration: public keys are not secret. */
254
+ export declare const WIRE_ROUTER_KEYS_VAR = "SUBSTRAT_WIRE_ROUTER_KEYS";
255
+ /** The control plane's public keys, a comma-separated list. */
256
+ export declare const WIRE_PLATFORM_KEYS_VAR = "SUBSTRAT_WIRE_PLATFORM_KEYS";
257
+ /** The deployment's own dispatch name, which an envelope's `aud` must equal. */
258
+ export declare const WIRE_AUDIENCE_VAR = "SUBSTRAT_WIRE_AUDIENCE";
259
+ /** The environment's down-channel state, one of {@link WIRE_STATES}. */
260
+ export declare const WIRE_STATE_VAR = "SUBSTRAT_WIRE_STATE";
261
+ /** What a deployment accepts on a call down (RFC §5). */
262
+ export declare const WIRE_STATES: readonly ['legacy-only', 'dual', 'signed-only'];
263
+ export type WireState = (typeof WIRE_STATES)[number];
264
+ /**
265
+ * A deployment's state from what its upload carries (RFC §5, Q3). No key list at all is
266
+ * `legacy-only` whatever the setting says, so a deployment no upload gave keys behaves as it
267
+ * did before the verifier existed. With keys, an explicit `legacy-only` or `signed-only` is
268
+ * taken as said, and anything else (missing, unknown) reads as `dual`: a wrong value fails
269
+ * toward accepting what is accepted today.
270
+ */
271
+ export declare function wireStateOf(config: {
272
+ readonly routerKeys?: unknown;
273
+ readonly platformKeys?: unknown;
274
+ readonly state?: unknown;
275
+ }): WireState;
276
+ /**
277
+ * The only state an upload gives a deployment in step 2 (RFC §9): `dual`. Moving a deployment to
278
+ * `signed-only` is a later, separate step (the flip, follow-on 7), a person's act behind its own
279
+ * gate, so no code that injects settings here can name it.
280
+ */
281
+ export declare const WIRE_UPLOAD_STATE = "dual";
282
+ /**
283
+ * What one upload gives the deployment it uploads as `audience` (RFC §5, §6, step 2), as the settings
284
+ * the entry reads: both key lists, its own name for the audience check, and the state
285
+ * {@link WIRE_UPLOAD_STATE}. The uploader writes them as plain configuration. The lists are judged first
286
+ * by {@link wireVerificationKeys}, the very function the entry loads them with, so an upload never gives
287
+ * a deployment lists its verifier would refuse: it throws instead, and the caller gives nothing. Each
288
+ * list must hold at least one key, and the audience must be one the encoder admits. Answers the kids
289
+ * each list names, for the capability record (RFC §7, Q8).
290
+ */
291
+ export declare function wireUploadSettings(input: {
292
+ readonly routerKeys: string;
293
+ readonly platformKeys: string;
294
+ readonly audience: string;
295
+ }): Promise<{
296
+ readonly settings: readonly {
297
+ readonly name: string;
298
+ readonly text: string;
299
+ }[];
300
+ readonly routerKids: string[];
301
+ readonly platformKids: string[];
302
+ }>;
303
+ /** What an endpoint of a deployment accepts: the kind of envelope, and the issuers that may sign it. */
304
+ export interface WireEndpoint {
305
+ readonly kind: WireKind;
306
+ readonly issuers: readonly WireIssuer[];
307
+ }
308
+ /**
309
+ * Which envelope a deployment's endpoint accepts (RFC §3.4, check 3), by the request's path. The
310
+ * internal surface vertical-host's `mountPlatformSurface` gates (`/internal/*`) takes calls from
311
+ * the control plane, and its peer invocation (`/internal/vertical-invoke`) from the router too,
312
+ * which makes those calls. Every other path is a routed request. A verifier judges by this, and a
313
+ * signer signs what it says.
314
+ *
315
+ * The surface is matched on the path its router decodes (Hono's `getPath`: `decodeURI`, with `%25`
316
+ * kept escaped), so the path is judged in every form a router could read it: as sent, decoded that
317
+ * way, decoded fully, each with empty and dot segments collapsed, in any letter case. Any form under
318
+ * `/internal` makes it a call: the stricter reading wins. Only the exact path the router sends a peer
319
+ * invocation to admits the router.
320
+ */
321
+ export declare function wireEndpoint(pathname: string): WireEndpoint;
322
+ /**
323
+ * The internal calls that take a body but change nothing, so a call to one keeps no nonce memory
324
+ * (RFC §4): each only reads the scope it names. Named by the exact path the platform calls, so any
325
+ * other spelling of one keeps nonces.
326
+ */
327
+ export declare const WIRE_REPLAY_FREE_CALLS: readonly string[];
328
+ /**
329
+ * A call's replay policy as its endpoint states it (RFC §4), never inferred from what an envelope
330
+ * names: `'none'` for a safe method or a call {@link WIRE_REPLAY_FREE_CALLS} lists, and `'nonce'`
331
+ * for every other call, a new endpoint included, whether or not its envelope names a scope. A call
332
+ * that keeps nonces and names no scope has no store to spend one in, which is its deployment's fault.
333
+ */
334
+ export declare function wireReplayOf(method: string, pathname: string): 'none' | 'nonce';
335
+ /**
336
+ * How one request fared (RFC §8). `legacy-accepted` is an envelope refused beside a legacy
337
+ * credential that was valid, and carries the refusal's reason; `refused` is an envelope refused
338
+ * with no valid legacy credential beside it.
339
+ */
340
+ export declare const WIRE_OUTCOMES: readonly ['signed-accepted', 'legacy-accepted', 'dual-mismatch', 'refused', 'fault'];
341
+ export type WireOutcome = (typeof WIRE_OUTCOMES)[number];
342
+ /**
343
+ * Which of the deployment's own faults a `fault` was: its key lists could not be loaded, it has
344
+ * no nonce store for a call that needs one, its nonce store threw or did not answer in time, or
345
+ * the verifier threw for any other reason.
346
+ */
347
+ export declare const WIRE_FAULTS: readonly ['keys', 'no-nonce-store', 'nonce-store', 'verifier'];
348
+ export type WireFault = (typeof WIRE_FAULTS)[number];
349
+ /** The legacy credential beside the envelope: present and valid, present and not, or not sent. */
350
+ export type WireLegacyCredential = 'valid' | 'invalid' | 'absent';
351
+ /**
352
+ * The line an entry writes for every request it judged (RFC §8), beside the invocation line and
353
+ * sharing its request id. Never written in `legacy-only`. Names, ids and outcomes only: never a
354
+ * header, a credential, a body or an error's text. Add fields; never rename one.
355
+ */
356
+ export interface WireVerificationLine {
357
+ readonly substrat: 'wire';
358
+ readonly state: Exclude<WireState, 'legacy-only'>;
359
+ /**
360
+ * Who signed: the issuer the envelope was verified as. An envelope not verified is the endpoint's
361
+ * one issuer, or `null` at an endpoint that admits two, since its claim is not trusted.
362
+ */
363
+ readonly issuer: WireIssuer | null;
364
+ /** The kind the endpoint takes. */
365
+ readonly kind: WireKind;
366
+ readonly outcome: WireOutcome;
367
+ /** Why the envelope was refused, beside `legacy-accepted` and `refused`; otherwise null. */
368
+ readonly reason: WireRefusalReason | null;
369
+ /** Beside `fault`; otherwise null. */
370
+ readonly fault: WireFault | null;
371
+ readonly legacy: WireLegacyCredential;
372
+ /** The tenant and scope the request was served as, when a credential proved one. */
373
+ readonly tenantId: string | null;
374
+ readonly scopeId: string | null;
375
+ /** The platform's `SUBSTRAT_VERSION_ID`, as on the invocation line. */
376
+ readonly versionId: string | null;
377
+ }
378
+ /**
379
+ * Whether a signer's `sign` flag (RFC §5) is on: exactly `on`, around whitespace. Absent, empty or
380
+ * anything else is off, so a signer nobody configured adds nothing to any request.
381
+ */
382
+ export declare function wireSigningOn(value: unknown): boolean;
383
+ /**
384
+ * {@link importWireSigningKey}, once per isolate for a given value: the signer's key is imported on
385
+ * the first request that needs it and reused after. A value that will not import keeps rejecting,
386
+ * with the same {@link WireKeyError}, until the value changes.
387
+ */
388
+ export declare function wireSigningKeyOf(pkcs8: string): Promise<WireSigningKey>;
389
+ /** What a signer names on one request, beside what the request itself says: its method, target and body. */
390
+ export type WireRequestClaims = Omit<WireEnvelopeInput, 'method' | 'target' | 'body'>;
391
+ /**
392
+ * The request with one fresh envelope on it ({@link WIRE_ENVELOPE_HEADER} and
393
+ * {@link WIRE_SIGNATURE_HEADER}), every other header kept as it was. The method and target are read
394
+ * with {@link wireRequestBinding}, as the verifier reads them. A call binds the request's exact body,
395
+ * read whole here and handed on as the same bytes (an absent body is the empty one, as the verifier
396
+ * reads it); a route binds none, and its body is not read. Sign each attempt: a resend carries a
397
+ * spent nonce (RFC §4).
398
+ */
399
+ export declare function signWireRequest(key: WireSigningKey, request: Request, claims: WireRequestClaims): Promise<Request>;
400
+ /**
401
+ * What a signer did with one request (RFC §8): signed it, or sent it as it came because it could
402
+ * not, saying why: `unset` (no key), the key form's refusal (a {@link WireKeyError} reason), `claims`
403
+ * (claims the encoder refuses), or `error` (anything else).
404
+ */
405
+ export type WireSignResult = {
406
+ readonly request: Request;
407
+ readonly outcome: 'signed';
408
+ } | {
409
+ readonly request: Request;
410
+ readonly outcome: 'failed';
411
+ readonly reason: string;
412
+ };
413
+ /**
414
+ * One signer's decision for one request. `named`, when given, adds the tenant and scope the call's
415
+ * own body names, read from the bytes the signer already holds.
416
+ */
417
+ export type WireSigner = (request: Request, claims: WireRequestClaims, named?: (request: Request, body: ArrayBuffer | undefined) => {
418
+ readonly tenantId: string;
419
+ readonly scopeId: string;
420
+ } | null) => Promise<WireSignResult>;
421
+ /**
422
+ * A signer's whole decision (RFC §5, §8): `null` while its `sign` flag is off, which is the default,
423
+ * so nothing is read and nothing is signed. On, each request is signed afresh with the key, imported
424
+ * once per isolate. A signer that cannot sign never fails the request: it is handed back with its
425
+ * legacy headers and its whole body (a call's body is read once, and the request rebuilt from those
426
+ * bytes when signing fails after reading it), and the result says why, never with the key.
427
+ */
428
+ export declare function wireSignerOf(settings: {
429
+ readonly sign?: unknown;
430
+ readonly key?: string;
431
+ }): WireSigner | null;
432
+ /** The listed headers by name, each with the kind of request it rides on. */
433
+ export declare const WIRE_UNSIGNED_HEADERS: Readonly<Record<string, WireKind>>;
434
+ /**
435
+ * The listed headers ({@link WIRE_UNSIGNED_HEADERS}) a request of `kind` hands on, as name and value:
436
+ * only those listed for that kind, and only a value its reader's check accepts. A header sent twice
437
+ * reads as both values joined, which is not one id, so it is dropped whole.
438
+ */
439
+ export declare function wireUnsignedHeadersOf(kind: WireKind, headers: {
440
+ get(name: string): string | null;
441
+ }): [name: string, value: string][];
442
+ export {};
443
+ //# sourceMappingURL=wire-signing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-signing.d.ts","sourceRoot":"","sources":["../src/wire-signing.ts"],"names":[],"mappings":"AAiDA,OAAO,EAQL,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,mBAAoD,CAAC;AACnF,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAC/D,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,6EAA6E;AAC7E,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,sEAAsE;AACtE,eAAO,MAAM,kCAAkC,MAAM,CAAC;AACtD,2FAA2F;AAC3F,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC/C,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAExC,8FAA8F;AAC9F,MAA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