@keri-ts/hosting 0.0.0-stage → 2.0.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/LICENSE +202 -0
- package/README.md +22 -2
- package/esm/hosting/npm/src/_dnt.shims.js +61 -0
- package/esm/hosting/npm/src/mod.js +7 -0
- package/esm/hosting/npm/src/src/host/http-server.js +310 -0
- package/esm/hosting/npm/src/src/host/kernel.js +83 -0
- package/esm/hosting/npm/src/src/http/app.js +33 -0
- package/esm/hosting/npm/src/src/http/error-mapping.js +19 -0
- package/esm/hosting/npm/src/src/http/policy.js +63 -0
- package/esm/hosting/npm/src/src/http/protocol/artifact-files.js +164 -0
- package/esm/hosting/npm/src/src/http/protocol/context.js +48 -0
- package/esm/hosting/npm/src/src/http/protocol/endpoints/did-resolution.js +90 -0
- package/esm/hosting/npm/src/src/http/protocol/endpoints/dws-artifacts.js +112 -0
- package/esm/hosting/npm/src/src/http/protocol/endpoints/generic-cesr-ingress.js +272 -0
- package/esm/hosting/npm/src/src/http/protocol/endpoints/health.js +9 -0
- package/esm/hosting/npm/src/src/http/protocol/endpoints/mailbox-admin.js +136 -0
- package/esm/hosting/npm/src/src/http/protocol/endpoints/oobi.js +171 -0
- package/esm/hosting/npm/src/src/http/protocol/endpoints/witness-http.js +98 -0
- package/esm/hosting/npm/src/src/http/protocol/responses.js +21 -0
- package/esm/hosting/npm/src/src/http/protocol/runtime-bridge.js +16 -0
- package/esm/hosting/npm/src/src/http/protocol/types.js +1 -0
- package/esm/hosting/npm/src/src/http/protocol-handler.js +68 -0
- package/esm/hosting/npm/src/src/http/source.js +118 -0
- package/esm/package.json +3 -0
- package/package.json +43 -4
- package/types/_dnt.shims.d.ts +6 -0
- package/types/_dnt.shims.d.ts.map +1 -0
- package/types/mod.d.ts +9 -0
- package/types/mod.d.ts.map +1 -0
- package/types/src/host/http-server.d.ts +46 -0
- package/types/src/host/http-server.d.ts.map +1 -0
- package/types/src/host/kernel.d.ts +37 -0
- package/types/src/host/kernel.d.ts.map +1 -0
- package/types/src/http/app.d.ts +22 -0
- package/types/src/http/app.d.ts.map +1 -0
- package/types/src/http/error-mapping.d.ts +7 -0
- package/types/src/http/error-mapping.d.ts.map +1 -0
- package/types/src/http/policy.d.ts +27 -0
- package/types/src/http/policy.d.ts.map +1 -0
- package/types/src/http/protocol/artifact-files.d.ts +11 -0
- package/types/src/http/protocol/artifact-files.d.ts.map +1 -0
- package/types/src/http/protocol/context.d.ts +14 -0
- package/types/src/http/protocol/context.d.ts.map +1 -0
- package/types/src/http/protocol/endpoints/did-resolution.d.ts +12 -0
- package/types/src/http/protocol/endpoints/did-resolution.d.ts.map +1 -0
- package/types/src/http/protocol/endpoints/dws-artifacts.d.ts +9 -0
- package/types/src/http/protocol/endpoints/dws-artifacts.d.ts.map +1 -0
- package/types/src/http/protocol/endpoints/generic-cesr-ingress.d.ts +21 -0
- package/types/src/http/protocol/endpoints/generic-cesr-ingress.d.ts.map +1 -0
- package/types/src/http/protocol/endpoints/health.d.ts +6 -0
- package/types/src/http/protocol/endpoints/health.d.ts.map +1 -0
- package/types/src/http/protocol/endpoints/mailbox-admin.d.ts +26 -0
- package/types/src/http/protocol/endpoints/mailbox-admin.d.ts.map +1 -0
- package/types/src/http/protocol/endpoints/oobi.d.ts +31 -0
- package/types/src/http/protocol/endpoints/oobi.d.ts.map +1 -0
- package/types/src/http/protocol/endpoints/witness-http.d.ts +13 -0
- package/types/src/http/protocol/endpoints/witness-http.d.ts.map +1 -0
- package/types/src/http/protocol/responses.d.ts +7 -0
- package/types/src/http/protocol/responses.d.ts.map +1 -0
- package/types/src/http/protocol/runtime-bridge.d.ts +13 -0
- package/types/src/http/protocol/runtime-bridge.d.ts.map +1 -0
- package/types/src/http/protocol/types.d.ts +78 -0
- package/types/src/http/protocol/types.d.ts.map +1 -0
- package/types/src/http/protocol-handler.d.ts +19 -0
- package/types/src/http/protocol-handler.d.ts.map +1 -0
- package/types/src/http/source.d.ts +25 -0
- package/types/src/http/source.d.ts.map +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type AgentRuntime, type Hab } from "keri-ts/runtime";
|
|
2
|
+
import type { OobiRouteRequest, ProtocolRequestContext, ProtocolRoute } from "../types.js";
|
|
3
|
+
/** Parse one OOBI-style request path into its route semantics. */
|
|
4
|
+
export declare function parseOobiRouteRequest(pathname: string): OobiRouteRequest | null;
|
|
5
|
+
/** Classify OOBI requests after mailbox-admin and witness-specific routes. */
|
|
6
|
+
export declare function classifyOobiRoute(context: ProtocolRequestContext): ProtocolRoute | null;
|
|
7
|
+
/** Serve one OOBI request from local accepted habitat state. */
|
|
8
|
+
export declare function handleOobiRoute(context: ProtocolRequestContext, request: OobiRouteRequest): Response;
|
|
9
|
+
/**
|
|
10
|
+
* Pick the default local AID whose Hab should answer a blind OOBI request when
|
|
11
|
+
* the request omits an AID.
|
|
12
|
+
*/
|
|
13
|
+
export declare function defaultOobiAid(runtime: AgentRuntime, serviceHab?: Hab, hostedPrefixes?: readonly string[]): string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Choose which local Hab should answer an OOBI request and return that Hab's
|
|
16
|
+
* AID.
|
|
17
|
+
*
|
|
18
|
+
* Preference order:
|
|
19
|
+
* - the requested AID itself when locally controlled
|
|
20
|
+
* - the explicit endpoint AID when it is locally controlled
|
|
21
|
+
* - the hosted endpoint matched from the request path
|
|
22
|
+
*/
|
|
23
|
+
export declare function selectResponderHab(runtime: AgentRuntime, hosted: {
|
|
24
|
+
kind: "none" | "one" | "ambiguous";
|
|
25
|
+
endpoint: {
|
|
26
|
+
eid: string;
|
|
27
|
+
url: string;
|
|
28
|
+
basePath: string;
|
|
29
|
+
} | null;
|
|
30
|
+
}, aid: string, eid?: string, hostedPrefixes?: readonly string[]): string | undefined;
|
|
31
|
+
//# sourceMappingURL=oobi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oobi.d.ts","sourceRoot":"","sources":["../../../../../src/src/http/protocol/endpoints/oobi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAuC,KAAK,GAAG,EAAuB,MAAM,iBAAiB,CAAC;AAExH,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3F,kEAAkE;AAClE,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,GACf,gBAAgB,GAAG,IAAI,CAoCzB;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,sBAAsB,GAC9B,aAAa,GAAG,IAAI,CAWtB;AAED,gEAAgE;AAChE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,EAC/B,OAAO,EAAE,gBAAgB,GACxB,QAAQ,CA0DV;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,YAAY,EACrB,UAAU,CAAC,EAAE,GAAG,EAChB,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,GACjC,MAAM,GAAG,SAAS,CAcpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE;IACN,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,CAAC;IACnC,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACjE,EACD,GAAG,EAAE,MAAM,EACX,GAAG,CAAC,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,GACjC,MAAM,GAAG,SAAS,CAqDpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AgentRuntime, type Hab, type WitnessReceiptPostOptions } from "keri-ts/runtime";
|
|
2
|
+
import type { ProtocolRequestContext, ProtocolRoute } from "../types.js";
|
|
3
|
+
/** Classify witness-only `/receipts` and `/query` routes ahead of generic ingress. */
|
|
4
|
+
export declare function classifyWitnessHttpRoute(context: ProtocolRequestContext): ProtocolRoute | null;
|
|
5
|
+
/** Handle one witness `/receipts` POST request; `options.local` follows the core receipt policy. */
|
|
6
|
+
export declare function handleWitnessReceiptPost(runtime: AgentRuntime, req: Request, witnessHab: Hab, options?: WitnessReceiptPostOptions): Promise<Response>;
|
|
7
|
+
/** Handle one witness `/receipts` GET request. */
|
|
8
|
+
export declare function handleWitnessReceiptGet(context: ProtocolRequestContext, witnessHab: Hab): Response;
|
|
9
|
+
/** Handle one witness `/query` GET request. */
|
|
10
|
+
export declare function handleWitnessQueryGet(context: ProtocolRequestContext, witnessHab: Hab): Response;
|
|
11
|
+
/** Serve the signed witness state-notice contract with explicit destination selection. */
|
|
12
|
+
export declare function handleWitnessKeyStateGet(context: ProtocolRequestContext, witnessHab: Hab): Response;
|
|
13
|
+
//# sourceMappingURL=witness-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"witness-http.d.ts","sourceRoot":"","sources":["../../../../../src/src/http/protocol/endpoints/witness-http.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,GAAG,EAMR,KAAK,yBAAyB,EAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzE,sFAAsF;AACtF,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,sBAAsB,GAC9B,aAAa,GAAG,IAAI,CAkCtB;AAED,oGAAoG;AACpG,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,GAAG,EACf,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,QAAQ,CAAC,CAmBnB;AAED,kDAAkD;AAClD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,GAAG,GACd,QAAQ,CAYV;AAED,+CAA+C;AAC/C,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,GAAG,GACd,QAAQ,CAgBV;AAED,0FAA0F;AAC1F,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,GAAG,GAAG,QAAQ,CAQnG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Return one CESR response body with the expected content type. */
|
|
2
|
+
export declare function cesrResponse(body: Uint8Array, status: number): Response;
|
|
3
|
+
/** Return one plain-text response. */
|
|
4
|
+
export declare function textResponse(message: string, status: number): Response;
|
|
5
|
+
/** Return the ordinary no-content JSON response used by ingress routes. */
|
|
6
|
+
export declare function jsonNoContentResponse(): Response;
|
|
7
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../../src/src/http/protocol/responses.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAKvE;AAED,sCAAsC;AACtC,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAKtE;AAED,2EAA2E;AAC3E,wBAAgB,qBAAqB,IAAI,QAAQ,CAKhD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Operation } from "effection";
|
|
2
|
+
import { type AgentCue, type AgentRuntime, type Deck, type Hab } from "keri-ts/runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Route HTTP cues and finish the existing query-delivery pass.
|
|
5
|
+
* Poster work is only admitted here; its independent worker owns network delivery.
|
|
6
|
+
* Request-owned direct replies remain with the HTTP request lifetime.
|
|
7
|
+
*
|
|
8
|
+
* @param runtime Borrowed composed runtime; caller owns its worker and store lifetime.
|
|
9
|
+
* @param serviceHab Optional hosted signer for cue production.
|
|
10
|
+
* @param cues Exact runtime source Deck; foreign Decks are rejected.
|
|
11
|
+
*/
|
|
12
|
+
export declare function drainRuntimeCues(runtime: AgentRuntime, serviceHab: Hab | undefined, cues: Deck<AgentCue>): Operation<void>;
|
|
13
|
+
//# sourceMappingURL=runtime-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bridge.d.ts","sourceRoot":"","sources":["../../../../src/src/http/protocol/runtime-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,IAAI,EAAE,KAAK,GAAG,EAAmB,MAAM,iBAAiB,CAAC;AAEzG;;;;;;;;GAQG;AACH,wBAAiB,gBAAgB,CAC/B,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,GAAG,GAAG,SAAS,EAC3B,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,GACnB,SAAS,CAAC,IAAI,CAAC,CAIjB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { AgentRuntime, Hab, HostedRouteResolution, ProtocolHostPolicy } from "keri-ts/runtime";
|
|
2
|
+
/** Shared request handler contract consumed by both Deno and Node hosts. */
|
|
3
|
+
export type ProtocolHandler = ((req: Request) => Promise<Response>) & {
|
|
4
|
+
/** Owned handlers close file responses before host drain; injected handlers may own no files. */
|
|
5
|
+
close?: () => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
/** One parsed OOBI route request. */
|
|
8
|
+
export interface OobiRouteRequest {
|
|
9
|
+
kind: "wellKnown" | "oobi";
|
|
10
|
+
aid: string | null;
|
|
11
|
+
said?: string;
|
|
12
|
+
role?: string;
|
|
13
|
+
eid?: string;
|
|
14
|
+
}
|
|
15
|
+
/** One request snapshot used by path-first route classification. */
|
|
16
|
+
export interface ProtocolRequestContext {
|
|
17
|
+
readonly req: Request;
|
|
18
|
+
readonly url: URL;
|
|
19
|
+
readonly pathname: string;
|
|
20
|
+
readonly method: string;
|
|
21
|
+
readonly runtime?: AgentRuntime;
|
|
22
|
+
readonly policy: ProtocolHostPolicy;
|
|
23
|
+
readonly hosted: HostedRouteResolution | null;
|
|
24
|
+
readonly mailboxAdmin: HostedRouteResolution | null;
|
|
25
|
+
readonly genericIngress: HostedRouteResolution | null;
|
|
26
|
+
readonly oobi: OobiRouteRequest | null;
|
|
27
|
+
}
|
|
28
|
+
/** Path-level route decision before any request body is read. */
|
|
29
|
+
export type ProtocolRoute = {
|
|
30
|
+
kind: "health";
|
|
31
|
+
} | {
|
|
32
|
+
kind: "didResolution";
|
|
33
|
+
did: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "dwsArtifact";
|
|
36
|
+
aid: string;
|
|
37
|
+
artifact: "did.json" | "keri.cesr";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "mailboxAdmin";
|
|
40
|
+
mailboxAid: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "witnessReceiptsPost";
|
|
43
|
+
witnessHab: Hab;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "witnessReceiptsGet";
|
|
46
|
+
witnessHab: Hab;
|
|
47
|
+
} | {
|
|
48
|
+
kind: "witnessQueryGet";
|
|
49
|
+
witnessHab: Hab;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "witnessKeyStateGet";
|
|
52
|
+
witnessHab: Hab;
|
|
53
|
+
} | {
|
|
54
|
+
kind: "oobi";
|
|
55
|
+
request: OobiRouteRequest;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "genericCesrIngress";
|
|
58
|
+
hosted: HostedRouteResolution;
|
|
59
|
+
} | {
|
|
60
|
+
kind: "ambiguousHostedPath";
|
|
61
|
+
message: string;
|
|
62
|
+
} | {
|
|
63
|
+
kind: "notFound";
|
|
64
|
+
};
|
|
65
|
+
/** Body-aware ingress decision for one already-inspected CESR request. */
|
|
66
|
+
export type CesrIngressRoute = {
|
|
67
|
+
kind: "witnessLocalIngress";
|
|
68
|
+
witnessHab: Hab;
|
|
69
|
+
} | {
|
|
70
|
+
kind: "runtimeIngress";
|
|
71
|
+
mailboxAid: string | null;
|
|
72
|
+
} | {
|
|
73
|
+
kind: "mailboxQueryStream";
|
|
74
|
+
mailboxAid: string | null;
|
|
75
|
+
pre: string | null;
|
|
76
|
+
topics: unknown;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/http/protocol/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEpG,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG;IACpE,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B,CAAC;AAEF,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAC3B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,oEAAoE;AACpE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpD,QAAQ,CAAC,cAAc,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACxC;AAED,iEAAiE;AACjE,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,UAAU,GAAG,WAAW,CAAA;CAAE,GACxE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,UAAU,EAAE,GAAG,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,UAAU,EAAE,GAAG,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,UAAU,EAAE,GAAG,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,UAAU,EAAE,GAAG,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzB,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,UAAU,EAAE,GAAG,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACrD;IACA,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared protocol-route composition for HTTP hosts.
|
|
3
|
+
*
|
|
4
|
+
* This module intentionally stays small: it builds request context, applies
|
|
5
|
+
* explicit route precedence, and dispatches to endpoint modules. Transport
|
|
6
|
+
* setup lives under `hosting/src/host`, while endpoint-specific HTTP semantics
|
|
7
|
+
* live under `hosting/src/http/protocol`.
|
|
8
|
+
*/
|
|
9
|
+
import { type AgentRuntime, type ProtocolHostPolicy } from "keri-ts/runtime";
|
|
10
|
+
import type { ProtocolHandler, ProtocolRequestContext, ProtocolRoute } from "./protocol/types.js";
|
|
11
|
+
export { buildProtocolRequestContext } from "./protocol/context.js";
|
|
12
|
+
export { classifyCesrIngressRoute } from "./protocol/endpoints/generic-cesr-ingress.js";
|
|
13
|
+
export { parseOobiRouteRequest } from "./protocol/endpoints/oobi.js";
|
|
14
|
+
export type { CesrIngressRoute, OobiRouteRequest, ProtocolHandler, ProtocolRequestContext, ProtocolRoute, } from "./protocol/types.js";
|
|
15
|
+
/** Build the shared protocol handler used by the Deno and Node HTTP hosts. */
|
|
16
|
+
export declare function createProtocolHandler(runtime?: AgentRuntime, policy?: ProtocolHostPolicy): ProtocolHandler;
|
|
17
|
+
/** Classify one request by explicit endpoint precedence. */
|
|
18
|
+
export declare function classifyProtocolRoute(context: ProtocolRequestContext): ProtocolRoute;
|
|
19
|
+
//# sourceMappingURL=protocol-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-handler.d.ts","sourceRoot":"","sources":["../../../src/src/http/protocol-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAoB7E,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElG,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,8EAA8E;AAC9E,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,YAAY,EACtB,MAAM,GAAE,kBAAuB,GAC9B,eAAe,CAQjB;AAED,4DAA4D;AAC5D,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,aAAa,CASf"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** One configured HTTPS response source; TLS supplies source identity, never issuer authority. */
|
|
2
|
+
import { type Operation } from "effection";
|
|
3
|
+
import { type HttpResponse } from "keri-ts/runtime";
|
|
4
|
+
import { Buffer } from "node:buffer";
|
|
5
|
+
/** An optional CA bundle augments operator trust; an IP URL may explicitly name a DNS certificate identity. */
|
|
6
|
+
export interface SourceConfig {
|
|
7
|
+
url: string;
|
|
8
|
+
caFile?: string;
|
|
9
|
+
certName?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Validated fixed source data; URL identity is retained exactly, not derived from a response. */
|
|
12
|
+
export declare class SourceTrust {
|
|
13
|
+
readonly url: string;
|
|
14
|
+
readonly caFile?: string;
|
|
15
|
+
readonly certName?: string;
|
|
16
|
+
readonly hostname: string;
|
|
17
|
+
readonly ca?: Buffer;
|
|
18
|
+
constructor({ url, caFile, certName }: SourceConfig);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Own one finite POST, absolute deadline, body reader and joined socket close.
|
|
22
|
+
* Node's TLS verifier checks CA plus the configured URL/name; request never follows redirects.
|
|
23
|
+
*/
|
|
24
|
+
export declare function sourceRequest(source: SourceTrust, body: Uint8Array, timeoutMs: number): Operation<HttpResponse>;
|
|
25
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/src/http/source.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,EAAQ,KAAK,SAAS,EAAoB,MAAM,WAAW,CAAC;AACnE,OAAO,EAAgB,KAAK,YAAY,EAAmC,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOrC,+GAA+G;AAC/G,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,kGAAkG;AAClG,qBAAa,WAAW;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;gBACT,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,YAAY;CAwBpD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,YAAY,CAAC,CAgD/G"}
|