@keri-ts/hosting 2.1.0 → 2.2.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.
@@ -7,6 +7,9 @@ export const DEFAULT_TUFA_CORS_POLICY = Object.freeze({
7
7
  "Content-Type",
8
8
  "CESR-ATTACHMENT",
9
9
  "CESR-DESTINATION",
10
+ // keri-ts sends these cross-origin: genus on v2 detached POSTs, Authorization for witness TOTP codes.
11
+ "CESR-Genus",
12
+ "Authorization",
10
13
  "Oobi-Aid",
11
14
  ]),
12
15
  exposeHeaders: Object.freeze([
@@ -1,6 +1,6 @@
1
1
  /** Universal Resolver compatible DID route. */
2
2
  import { run } from "effection";
3
- import { didResolutionError, parseDidKeriIdentifier, resolveDidKeri, resolveDidWebs, runtimeOobiConverged, } from "keri-ts/runtime";
3
+ import { beginOobi, didResolutionError, oobiStatus, parseDidKeriIdentifier, resolveDidKeri, resolveDidWebs, } from "keri-ts/runtime";
4
4
  const IDENTIFIERS_PREFIX = "/1.0/identifiers/";
5
5
  /** Classify `/1.0/identifiers/{did}` requests. */
6
6
  export function classifyDidResolutionRoute(context) {
@@ -45,12 +45,13 @@ export async function handleDidResolutionRoute(context, did) {
45
45
  throw new Error("Legacy credential registry is unavailable in this runtime.");
46
46
  // The host owns workers. This request only queues introductions and observes state.
47
47
  for (const oobi of oobis)
48
- context.runtime.oobiery.resolve(oobi);
48
+ beginOobi({ oobiery: context.runtime.oobiery }, oobi);
49
49
  const deadline = Date.now() + 30_000;
50
- while (!oobis.every((url) => runtimeOobiConverged(context.runtime, url))) {
50
+ // Wait on these URLs' own records, not on unrelated pending runtime work.
51
+ while (!oobis.every((url) => oobiStatus(context.runtime.hby, url).state !== "pending")) {
51
52
  context.req.signal.throwIfAborted();
52
53
  if (Date.now() >= deadline)
53
- throw new Error("DID introductions did not converge within 30000ms.");
54
+ throw new Error("DID introductions did not resolve within 30000ms.");
54
55
  await new Promise((resolve) => setTimeout(resolve, 25));
55
56
  }
56
57
  result = resolveDidKeri(context.runtime.hby, rgy, canonical);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keri-ts/hosting",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "HTTP host lifecycle, application middleware and protocol route composition",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,10 +32,10 @@
32
32
  "node": ">=20.3"
33
33
  },
34
34
  "dependencies": {
35
- "cesr-ts": "2.1.0",
35
+ "cesr-ts": "2.2.0",
36
36
  "effection": "^3.6.0",
37
37
  "hono": "^4.7.11",
38
- "keri-ts": "2.1.0",
38
+ "keri-ts": "2.2.0",
39
39
  "@deno/shim-deno": "~0.18.0"
40
40
  },
41
41
  "devDependencies": {
@@ -1 +1 @@
1
- {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../src/src/http/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAqB,MAAM,MAAM,CAAC;AAGpD,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B;AAED,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CACzC;AAED,eA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BAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,EACT,MAAM,EAAE,iBAAiB,GACxB,IAAI,CAEN;AAiCD,yEAAyE;AACzE,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,cAAc,GACrB,IAAI,CAcN"}
@@ -1 +1 @@
1
- {"version":3,"file":"did-resolution.d.ts","sourceRoot":"","sources":["../../../../../src/src/http/protocol/endpoints/did-resolution.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIzE,kDAAkD;AAClD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,sBAAsB,GAC9B,aAAa,GAAG,IAAI,CAStB;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,sBAAsB,EAC/B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,QAAQ,CAAC,CAuDnB"}
1
+ {"version":3,"file":"did-resolution.d.ts","sourceRoot":"","sources":["../../../../../src/src/http/protocol/endpoints/did-resolution.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIzE,kDAAkD;AAClD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,sBAAsB,GAC9B,aAAa,GAAG,IAAI,CAStB;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,sBAAsB,EAC/B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,QAAQ,CAAC,CAwDnB"}