keri-ts 2.2.4 → 2.2.6
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/esm/keri/npm/src/_dnt.polyfills.js +14 -14
- package/esm/keri/npm/src/acdc/dhking.js +29 -2
- package/esm/keri/npm/src/acdc/observing.js +10 -3
- package/esm/keri/npm/src/acdc/query-resend.js +74 -0
- package/esm/keri/npm/src/acdc/regengine.js +39 -9
- package/esm/keri/npm/src/acdc/regeventing.js +5 -3
- package/esm/keri/npm/src/acdc/registering.js +19 -0
- package/esm/keri/npm/src/acdc/salting.js +4 -0
- package/esm/keri/npm/src/acdc/unblinding.js +38 -3
- package/esm/keri/npm/src/app/bootstrap/authenticating.js +32 -10
- package/esm/keri/npm/src/app/bootstrap/oobiery.js +363 -30
- package/esm/keri/npm/src/app/credentials/credential-importing.js +33 -4
- package/esm/keri/npm/src/app/credentials/root-replicator.js +27 -15
- package/esm/keri/npm/src/app/credentials/schema-resolving.js +5 -1
- package/esm/keri/npm/src/app/credentials/tel-publishing.js +16 -7
- package/esm/keri/npm/src/app/delivery/forwarding.js +205 -44
- package/esm/keri/npm/src/app/delivery/relaying.js +232 -0
- package/esm/keri/npm/src/app/delivery/respondant.js +8 -5
- package/esm/keri/npm/src/app/exchanges/exchange-messaging.js +1 -1
- package/esm/keri/npm/src/app/exchanges/exchanging.js +65 -9
- package/esm/keri/npm/src/app/identity/delegating.js +66 -9
- package/esm/keri/npm/src/app/identity/habbing.js +190 -71
- package/esm/keri/npm/src/app/identity/keeping.js +111 -39
- package/esm/keri/npm/src/app/identity/retire-identifier.js +98 -0
- package/esm/keri/npm/src/app/ipex/disclosure-replaying.js +116 -0
- package/esm/keri/npm/src/app/ipex/group-ipex.js +122 -25
- package/esm/keri/npm/src/app/ipex/group-issuance.js +137 -37
- package/esm/keri/npm/src/app/ipex/ipex-discloser.js +94 -31
- package/esm/keri/npm/src/app/ipex/ipex-grouping.js +53 -3
- package/esm/keri/npm/src/app/ipex/ipex-v2.js +7 -2
- package/esm/keri/npm/src/app/ipex/issuance.js +147 -44
- package/esm/keri/npm/src/app/ipex/pending-presentations.js +4 -2
- package/esm/keri/npm/src/app/ipex/presenting.js +3 -18
- package/esm/keri/npm/src/app/ipex/receive-issuance.js +2 -1
- package/esm/keri/npm/src/app/ipex/unblinding-workflow.js +39 -11
- package/esm/keri/npm/src/app/mailbox/agent-inbox.js +292 -0
- package/esm/keri/npm/src/app/mailbox/forward-handler.js +298 -52
- package/esm/keri/npm/src/app/mailbox/kel-publisher.js +26 -31
- package/esm/keri/npm/src/app/mailbox/mailbox-poller.js +70 -62
- package/esm/keri/npm/src/app/mailbox/mailboxing.js +20 -4
- package/esm/keri/npm/src/app/multisig/counseling.js +71 -27
- package/esm/keri/npm/src/app/multisig/group-members.js +41 -5
- package/esm/keri/npm/src/app/multisig/grouping.js +50 -2
- package/esm/keri/npm/src/app/multisig/multisig-workflows.js +3 -18
- package/esm/keri/npm/src/app/multisig/proposing.js +1 -16
- package/esm/keri/npm/src/app/multisig/rejoin-group.js +99 -0
- package/esm/keri/npm/src/app/multisig/replace-member.js +29 -8
- package/esm/keri/npm/src/app/protocol/parsering.js +45 -17
- package/esm/keri/npm/src/app/protocol/protocol-processing.js +47 -21
- package/esm/keri/npm/src/app/queries/query-replies.js +0 -22
- package/esm/keri/npm/src/app/queries/relay-refresh.js +81 -0
- package/esm/keri/npm/src/app/queries/witness-inquisitor.js +180 -34
- package/esm/keri/npm/src/app/runtime/agent-runtime.js +42 -73
- package/esm/keri/npm/src/app/runtime/cue-runtime.js +45 -5
- package/esm/keri/npm/src/app/runtime/ipex-auxiliaries.js +8 -1
- package/esm/keri/npm/src/app/runtime/operation-owners.js +26 -56
- package/esm/keri/npm/src/app/runtime/workflow-contract.js +7 -4
- package/esm/keri/npm/src/app/transport/http-client.js +20 -2
- package/esm/keri/npm/src/app/transport/message-source.js +2 -1
- package/esm/keri/npm/src/app/transport/messengering.js +39 -8
- package/esm/keri/npm/src/app/witness/ingress.js +7 -0
- package/esm/keri/npm/src/app/witness/receipt-client.js +43 -16
- package/esm/keri/npm/src/app/witness/receipting.js +62 -20
- package/esm/keri/npm/src/cli/messaging/multisig.js +4 -3
- package/esm/keri/npm/src/core/errors.js +73 -0
- package/esm/keri/npm/src/core/kel/delegation-ancestry.js +11 -2
- package/esm/keri/npm/src/core/kel/eventing.js +25 -28
- package/esm/keri/npm/src/core/kel/kever.js +15 -9
- package/esm/keri/npm/src/core/mailbox/kram-policy.js +16 -0
- package/esm/keri/npm/src/core/mailbox/kram-pruning.js +25 -6
- package/esm/keri/npm/src/core/mailbox/kram-time.js +34 -6
- package/esm/keri/npm/src/core/mailbox/kraming.js +58 -2
- package/esm/keri/npm/src/core/missing-anchor-query.js +20 -0
- package/esm/keri/npm/src/core/routing.js +18 -25
- package/esm/keri/npm/src/core/scheming.js +12 -5
- package/esm/keri/npm/src/core/wire-fields.js +126 -0
- package/esm/keri/npm/src/db/basing.js +4 -13
- package/esm/keri/npm/src/db/core/indexeddb-persistence.js +3 -2
- package/esm/keri/npm/src/db/core/webdber.js +85 -27
- package/esm/keri/npm/src/db/mailbox/mailboxing.js +13 -0
- package/esm/keri/npm/src/db/subing.js +4 -0
- package/esm/keri/npm/src/runtime/index.js +11 -5
- package/esm/keri/npm/src/time/mod.js +5 -0
- package/esm/keri/npm/src/vdr/credential-tsn-record.js +2 -7
- package/esm/keri/npm/src/vdr/eventing.js +71 -28
- package/esm/keri/npm/src/vdr/registry-tsn-record.js +3 -13
- package/esm/keri/npm/src/version.js +2 -2
- package/package.json +1 -1
- package/types/_dnt.polyfills.d.ts +9 -9
- package/types/_dnt.polyfills.d.ts.map +1 -1
- package/types/acdc/dhking.d.ts +8 -0
- package/types/acdc/dhking.d.ts.map +1 -1
- package/types/acdc/observing.d.ts +5 -1
- package/types/acdc/observing.d.ts.map +1 -1
- package/types/acdc/query-resend.d.ts +24 -0
- package/types/acdc/query-resend.d.ts.map +1 -0
- package/types/acdc/regengine.d.ts +19 -1
- package/types/acdc/regengine.d.ts.map +1 -1
- package/types/acdc/regeventing.d.ts.map +1 -1
- package/types/acdc/registering.d.ts +6 -0
- package/types/acdc/registering.d.ts.map +1 -1
- package/types/acdc/salting.d.ts.map +1 -1
- package/types/acdc/unblinding.d.ts +13 -1
- package/types/acdc/unblinding.d.ts.map +1 -1
- package/types/app/bootstrap/authenticating.d.ts +12 -2
- package/types/app/bootstrap/authenticating.d.ts.map +1 -1
- package/types/app/bootstrap/oobiery.d.ts +144 -7
- package/types/app/bootstrap/oobiery.d.ts.map +1 -1
- package/types/app/credentials/credential-importing.d.ts +8 -0
- package/types/app/credentials/credential-importing.d.ts.map +1 -1
- package/types/app/credentials/root-replicator.d.ts +19 -8
- package/types/app/credentials/root-replicator.d.ts.map +1 -1
- package/types/app/credentials/schema-resolving.d.ts.map +1 -1
- package/types/app/credentials/tel-publishing.d.ts +4 -2
- package/types/app/credentials/tel-publishing.d.ts.map +1 -1
- package/types/app/delivery/forwarding.d.ts +90 -5
- package/types/app/delivery/forwarding.d.ts.map +1 -1
- package/types/app/delivery/relaying.d.ts +144 -0
- package/types/app/delivery/relaying.d.ts.map +1 -0
- package/types/app/delivery/respondant.d.ts +9 -2
- package/types/app/delivery/respondant.d.ts.map +1 -1
- package/types/app/exchanges/exchanging.d.ts +36 -0
- package/types/app/exchanges/exchanging.d.ts.map +1 -1
- package/types/app/identity/delegating.d.ts +6 -0
- package/types/app/identity/delegating.d.ts.map +1 -1
- package/types/app/identity/habbing.d.ts +106 -19
- package/types/app/identity/habbing.d.ts.map +1 -1
- package/types/app/identity/keeping.d.ts +54 -19
- package/types/app/identity/keeping.d.ts.map +1 -1
- package/types/app/identity/retire-identifier.d.ts +24 -0
- package/types/app/identity/retire-identifier.d.ts.map +1 -0
- package/types/app/ipex/disclosure-replaying.d.ts +61 -0
- package/types/app/ipex/disclosure-replaying.d.ts.map +1 -0
- package/types/app/ipex/group-ipex.d.ts +60 -14
- package/types/app/ipex/group-ipex.d.ts.map +1 -1
- package/types/app/ipex/group-issuance.d.ts +54 -8
- package/types/app/ipex/group-issuance.d.ts.map +1 -1
- package/types/app/ipex/ipex-discloser.d.ts +39 -2
- package/types/app/ipex/ipex-discloser.d.ts.map +1 -1
- package/types/app/ipex/ipex-grouping.d.ts +23 -2
- package/types/app/ipex/ipex-grouping.d.ts.map +1 -1
- package/types/app/ipex/ipex-v2.d.ts +5 -2
- package/types/app/ipex/ipex-v2.d.ts.map +1 -1
- package/types/app/ipex/issuance.d.ts +46 -16
- package/types/app/ipex/issuance.d.ts.map +1 -1
- package/types/app/ipex/pending-presentations.d.ts +4 -2
- package/types/app/ipex/pending-presentations.d.ts.map +1 -1
- package/types/app/ipex/presenting.d.ts.map +1 -1
- package/types/app/ipex/receive-issuance.d.ts +2 -1
- package/types/app/ipex/receive-issuance.d.ts.map +1 -1
- package/types/app/ipex/unblinding-workflow.d.ts +13 -2
- package/types/app/ipex/unblinding-workflow.d.ts.map +1 -1
- package/types/app/mailbox/agent-inbox.d.ts +126 -0
- package/types/app/mailbox/agent-inbox.d.ts.map +1 -0
- package/types/app/mailbox/forward-handler.d.ts +114 -14
- package/types/app/mailbox/forward-handler.d.ts.map +1 -1
- package/types/app/mailbox/kel-publisher.d.ts +12 -22
- package/types/app/mailbox/kel-publisher.d.ts.map +1 -1
- package/types/app/mailbox/mailbox-poller.d.ts +40 -24
- package/types/app/mailbox/mailbox-poller.d.ts.map +1 -1
- package/types/app/mailbox/mailboxing.d.ts +19 -5
- package/types/app/mailbox/mailboxing.d.ts.map +1 -1
- package/types/app/multisig/counseling.d.ts +32 -11
- package/types/app/multisig/counseling.d.ts.map +1 -1
- package/types/app/multisig/group-members.d.ts +17 -1
- package/types/app/multisig/group-members.d.ts.map +1 -1
- package/types/app/multisig/grouping.d.ts +17 -1
- package/types/app/multisig/grouping.d.ts.map +1 -1
- package/types/app/multisig/multisig-workflows.d.ts +0 -8
- package/types/app/multisig/multisig-workflows.d.ts.map +1 -1
- package/types/app/multisig/proposing.d.ts +4 -19
- package/types/app/multisig/proposing.d.ts.map +1 -1
- package/types/app/multisig/rejoin-group.d.ts +119 -0
- package/types/app/multisig/rejoin-group.d.ts.map +1 -0
- package/types/app/multisig/replace-member.d.ts +15 -1
- package/types/app/multisig/replace-member.d.ts.map +1 -1
- package/types/app/protocol/parsering.d.ts +21 -2
- package/types/app/protocol/parsering.d.ts.map +1 -1
- package/types/app/protocol/protocol-processing.d.ts +25 -5
- package/types/app/protocol/protocol-processing.d.ts.map +1 -1
- package/types/app/queries/query-replies.d.ts +4 -8
- package/types/app/queries/query-replies.d.ts.map +1 -1
- package/types/app/queries/relay-refresh.d.ts +26 -0
- package/types/app/queries/relay-refresh.d.ts.map +1 -0
- package/types/app/queries/witness-inquisitor.d.ts +56 -5
- package/types/app/queries/witness-inquisitor.d.ts.map +1 -1
- package/types/app/runtime/agent-runtime.d.ts +34 -3
- package/types/app/runtime/agent-runtime.d.ts.map +1 -1
- package/types/app/runtime/cue-runtime.d.ts +15 -3
- package/types/app/runtime/cue-runtime.d.ts.map +1 -1
- package/types/app/runtime/ipex-auxiliaries.d.ts.map +1 -1
- package/types/app/runtime/operation-owners.d.ts +16 -26
- package/types/app/runtime/operation-owners.d.ts.map +1 -1
- package/types/app/runtime/workflow-contract.d.ts +21 -6
- package/types/app/runtime/workflow-contract.d.ts.map +1 -1
- package/types/app/transport/http-client.d.ts +9 -0
- package/types/app/transport/http-client.d.ts.map +1 -1
- package/types/app/transport/message-source.d.ts +6 -3
- package/types/app/transport/message-source.d.ts.map +1 -1
- package/types/app/transport/messengering.d.ts +10 -1
- package/types/app/transport/messengering.d.ts.map +1 -1
- package/types/app/witness/ingress.d.ts +1 -0
- package/types/app/witness/ingress.d.ts.map +1 -1
- package/types/app/witness/receipt-client.d.ts +19 -1
- package/types/app/witness/receipt-client.d.ts.map +1 -1
- package/types/app/witness/receipting.d.ts +24 -1
- package/types/app/witness/receipting.d.ts.map +1 -1
- package/types/cli/messaging/multisig.d.ts.map +1 -1
- package/types/core/cues.d.ts +53 -1
- package/types/core/cues.d.ts.map +1 -1
- package/types/core/errors.d.ts +32 -0
- package/types/core/errors.d.ts.map +1 -1
- package/types/core/kel/delegation-ancestry.d.ts.map +1 -1
- package/types/core/kel/eventing.d.ts.map +1 -1
- package/types/core/kel/kever-decisions.d.ts +3 -1
- package/types/core/kel/kever-decisions.d.ts.map +1 -1
- package/types/core/kel/kever.d.ts +7 -1
- package/types/core/kel/kever.d.ts.map +1 -1
- package/types/core/mailbox/kram-policy.d.ts +12 -0
- package/types/core/mailbox/kram-policy.d.ts.map +1 -1
- package/types/core/mailbox/kram-pruning.d.ts +5 -1
- package/types/core/mailbox/kram-pruning.d.ts.map +1 -1
- package/types/core/mailbox/kram-time.d.ts +26 -2
- package/types/core/mailbox/kram-time.d.ts.map +1 -1
- package/types/core/mailbox/kraming.d.ts +14 -1
- package/types/core/mailbox/kraming.d.ts.map +1 -1
- package/types/core/missing-anchor-query.d.ts +34 -0
- package/types/core/missing-anchor-query.d.ts.map +1 -0
- package/types/core/routing.d.ts +3 -7
- package/types/core/routing.d.ts.map +1 -1
- package/types/core/scheming.d.ts.map +1 -1
- package/types/core/wire-fields.d.ts +56 -0
- package/types/core/wire-fields.d.ts.map +1 -0
- package/types/db/basing.d.ts.map +1 -1
- package/types/db/core/indexeddb-persistence.d.ts +3 -2
- package/types/db/core/indexeddb-persistence.d.ts.map +1 -1
- package/types/db/core/webdber.d.ts +32 -6
- package/types/db/core/webdber.d.ts.map +1 -1
- package/types/db/exchange/exchange-records.d.ts +4 -0
- package/types/db/exchange/exchange-records.d.ts.map +1 -1
- package/types/db/mailbox/mailboxing.d.ts +10 -1
- package/types/db/mailbox/mailboxing.d.ts.map +1 -1
- package/types/db/subing.d.ts +2 -0
- package/types/db/subing.d.ts.map +1 -1
- package/types/runtime/index.d.ts +20 -14
- package/types/runtime/index.d.ts.map +1 -1
- package/types/time/mod.d.ts +2 -0
- package/types/time/mod.d.ts.map +1 -1
- package/types/vdr/credential-tsn-record.d.ts.map +1 -1
- package/types/vdr/eventing.d.ts +32 -1
- package/types/vdr/eventing.d.ts.map +1 -1
- package/types/vdr/registry-tsn-record.d.ts.map +1 -1
- package/types/version.d.ts +2 -2
- package/esm/keri/npm/src/app/runtime/signer-conditions.js +0 -51
- package/types/app/runtime/signer-conditions.d.ts +0 -32
- package/types/app/runtime/signer-conditions.d.ts.map +0 -1
|
@@ -3,7 +3,7 @@ import type { Baser } from "../../db/basing.js";
|
|
|
3
3
|
import type { Habery } from "../identity/habbing.js";
|
|
4
4
|
import { type DoerPacing } from "../runtime/doing.js";
|
|
5
5
|
import { type RuntimeClock } from "../runtime/runtime-clock.js";
|
|
6
|
-
import type
|
|
6
|
+
import { type HttpClient } from "../transport/http-client.js";
|
|
7
7
|
/**
|
|
8
8
|
* Return true when a well-known URL has been authorized into `wkas.`.
|
|
9
9
|
*
|
|
@@ -46,11 +46,21 @@ export declare class Authenticator {
|
|
|
46
46
|
/** Return the next pending `mfa.` auth record, if any. */
|
|
47
47
|
private nextPendingAuth;
|
|
48
48
|
/**
|
|
49
|
-
* Fetch one `mfa.` record and persist the terminal auth result.
|
|
49
|
+
* Fetch one `mfa.` record and persist the terminal auth result. A URL the HTTP client refuses, a refused or failed
|
|
50
|
+
* request, or a non-OK status each end this authentication as failed in `rmfa.` and remove its `mfa.` row, so the
|
|
51
|
+
* next pass takes the next one; any other error is a fault and propagates.
|
|
50
52
|
*
|
|
51
53
|
* @param url Exact pending well-known authentication URL.
|
|
52
54
|
* @param record Durable mfa record retained until response handling and cleanup establish terminal state.
|
|
53
55
|
*/
|
|
54
56
|
private processPendingAuth;
|
|
57
|
+
/**
|
|
58
|
+
* Request one well-known URL and read only its status; the response owner still joins body cleanup.
|
|
59
|
+
*
|
|
60
|
+
* @param url Pending well-known authentication URL.
|
|
61
|
+
* @returns The terminal state: `resolved` for an OK status, `http-<status>` otherwise, or the
|
|
62
|
+
* {@link OobiJobFailure} of a URL the client refuses or a refused or failed request.
|
|
63
|
+
*/
|
|
64
|
+
private authenticate;
|
|
55
65
|
}
|
|
56
66
|
//# sourceMappingURL=authenticating.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticating.d.ts","sourceRoot":"","sources":["../../../src/app/bootstrap/authenticating.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAU,MAAM,WAAW,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,KAAK,UAAU,EAAmC,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"authenticating.d.ts","sourceRoot":"","sources":["../../../src/app/bootstrap/authenticating.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAU,MAAM,WAAW,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,KAAK,UAAU,EAAmC,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,KAAK,UAAU,EAAwB,MAAM,6BAA6B,CAAC;AAMpF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,KAAK,EACT,GAAG,EAAE,MAAM,GACV,OAAO,CAMT;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAa;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAE1B;;;;;OAKG;gBACS,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU;IAKzC,sEAAsE;IACrE,WAAW,IAAI,SAAS,CAAC,IAAI,CAAC;IAe/B,yDAAyD;IACxD,MAAM,CAAC,KAAK,GAAE,YAA0B,EAAE,MAAM,GAAE,QAAQ,CAAC,UAAU,CAAmB,GAAG,SAAS,CAAC,KAAK,CAAC;IAI5G,4EAA4E;IAC5E,OAAO,CAAC,sBAAsB;IAsC9B,0DAA0D;IAC1D,OAAO,CAAC,eAAe;IAYvB;;;;;;;OAOG;IACH,OAAO,CAAE,kBAAkB;IA4B3B;;;;;;OAMG;IACH,OAAO,CAAE,YAAY;CActB"}
|
|
@@ -10,14 +10,38 @@ import { type Role } from "../../core/roles.js";
|
|
|
10
10
|
import type { Revery } from "../../core/routing.js";
|
|
11
11
|
import { type ReplyProcessDecision } from "../../core/routing.js";
|
|
12
12
|
import type { Baser } from "../../db/basing.js";
|
|
13
|
+
import type { Poster } from "../delivery/forwarding.js";
|
|
14
|
+
import { type Relay } from "../delivery/relaying.js";
|
|
13
15
|
import type { Exchanger, ExchangeRouteHandler } from "../exchanges/exchanging.js";
|
|
14
16
|
import type { Hab, Habery } from "../identity/habbing.js";
|
|
15
17
|
import type { Notifier } from "../notifications/notifying.js";
|
|
16
18
|
import type { ProtocolProcessor } from "../protocol/protocol-processing.js";
|
|
17
19
|
import { type DoerPacing } from "../runtime/doing.js";
|
|
18
20
|
import { type RuntimeClock } from "../runtime/runtime-clock.js";
|
|
19
|
-
import type
|
|
21
|
+
import { type HttpClient } from "../transport/http-client.js";
|
|
20
22
|
export declare const OOBI_REQUEST_ROUTE = "/oobis";
|
|
23
|
+
/**
|
|
24
|
+
* How long an edge's OOBI job waits for its relay to hold the answer before it fails: 30 seconds, measured from the
|
|
25
|
+
* job's first relay attempt on the composed clock. It matches KERIpy's `Oobiery.RetryDelay` and the default
|
|
26
|
+
* `bootstrapOobis` timeout; the keri-ts Oobiery has no other retry, and a direct fetch fails on its first non-OK
|
|
27
|
+
* answer.
|
|
28
|
+
*/
|
|
29
|
+
export declare const RELAY_OOBI_TIMEOUT_MS = 30000;
|
|
30
|
+
/**
|
|
31
|
+
* What an edge's Oobiery uses to resolve OOBIs through its relay agent instead of fetching third-party origins.
|
|
32
|
+
*
|
|
33
|
+
* For a job whose origin is not the relay's, the Oobiery asks the relay to resolve the URL (an `/oobis` exchange
|
|
34
|
+
* sent through `postman`) and then fetches the result from the relay's own OOBI endpoint, verifying what it
|
|
35
|
+
* ingests exactly as for a direct fetch. The relay's own OOBI is fetched directly.
|
|
36
|
+
*/
|
|
37
|
+
export interface OobiRelaying {
|
|
38
|
+
/** The relay agent; the only origin this Oobiery fetches. */
|
|
39
|
+
readonly relay: Relay;
|
|
40
|
+
/** Borrowed delivery owner that hands the `/oobis` request to the relay. */
|
|
41
|
+
readonly postman: Poster;
|
|
42
|
+
/** Borrowed clock that dates a job's relay wait and decides {@link RELAY_OOBI_TIMEOUT_MS}. */
|
|
43
|
+
readonly clock: RuntimeClock;
|
|
44
|
+
}
|
|
21
45
|
/**
|
|
22
46
|
* Runtime-tracked OOBI resolution job.
|
|
23
47
|
*
|
|
@@ -62,6 +86,30 @@ export interface OobiTerminalState {
|
|
|
62
86
|
*/
|
|
63
87
|
export declare function oobiTerminalState(db: Baser, url: string, kind?: OobiQueueKind): OobiTerminalState;
|
|
64
88
|
type OobiQueueKind = "oobis" | "woobi";
|
|
89
|
+
/**
|
|
90
|
+
* Why one OOBI or well-known authentication job failed because of its URL or what its remote party answered. It is
|
|
91
|
+
* the failed row's `state` (`eoobi.` or `rmfa.`) and the `oobiFailed` cue's `reason`.
|
|
92
|
+
* - `url-refused`: the URL is one the HTTP client refuses by construction ({@link isRequestableHttpUrl}), so it is
|
|
93
|
+
* failed before any request;
|
|
94
|
+
* - `egress-refused`: an edge's relay-only guard refused the origin (`RelayOnlyError`);
|
|
95
|
+
* - `transport-failed`: connecting, requesting or reading the body failed (`TransportError`);
|
|
96
|
+
* - `unparseable-response`: the body is not CESR (`WireParseError`);
|
|
97
|
+
* - `invalid-response-frame`: a frame parsed but a field in it did not decode while it was dispatched (any other
|
|
98
|
+
* cesr `ParserError`, or the `SyntaxError`/`RangeError` that `BigInt` and number decoding throw on a remote value).
|
|
99
|
+
*/
|
|
100
|
+
export type OobiJobFailure = "url-refused" | "egress-refused" | "transport-failed" | "unparseable-response" | "invalid-response-frame";
|
|
101
|
+
/**
|
|
102
|
+
* Classify an error that ended one OOBI or authentication job: the {@link OobiJobFailure} a remote party can cause,
|
|
103
|
+
* or null for a fault that must propagate and end the runtime (a store error such as `DatabaseError`, corrupt
|
|
104
|
+
* durable state, a programmer error such as `TypeError`, a plain `Error`).
|
|
105
|
+
*
|
|
106
|
+
* Limits: a cesr `ParserError`, `SyntaxError` or `RangeError` raised while decoding local stored state during the
|
|
107
|
+
* same dispatch is indistinguishable by class from one raised by a remote field, so it also ends only that job.
|
|
108
|
+
*
|
|
109
|
+
* @param error What escaped the job's request or response ingestion.
|
|
110
|
+
* @returns The failure to record, or null to rethrow.
|
|
111
|
+
*/
|
|
112
|
+
export declare function oobiJobFailure(error: unknown): OobiJobFailure | null;
|
|
65
113
|
/**
|
|
66
114
|
* Durable OOBI processing component for one `Habery`.
|
|
67
115
|
*
|
|
@@ -87,8 +135,15 @@ export declare class Oobiery {
|
|
|
87
135
|
readonly cues: Deck<AgentCue>;
|
|
88
136
|
/** Borrowed HTTP client; no network service is discovered through ingress. */
|
|
89
137
|
readonly http: HttpClient;
|
|
138
|
+
/** Relay collaborators of an edge; null resolves every OOBI directly. */
|
|
139
|
+
readonly relaying: OobiRelaying | null;
|
|
90
140
|
/** Prevent overlapping passes over this owner's durable job queue. */
|
|
91
141
|
private active;
|
|
142
|
+
/**
|
|
143
|
+
* URL of the last job handled with a relay, so a job left waiting does not starve the jobs after it: the next
|
|
144
|
+
* pass takes the first queued URL after this one. Always null without a relay.
|
|
145
|
+
*/
|
|
146
|
+
private relayCursor;
|
|
92
147
|
/**
|
|
93
148
|
* Bind byte intake and the actual reply verifier used by OOBI proof persistence.
|
|
94
149
|
*
|
|
@@ -97,10 +152,11 @@ export declare class Oobiery {
|
|
|
97
152
|
* @param rvy Actual shared reply verifier used for OOBI reply proof persistence.
|
|
98
153
|
* @param http Borrowed HTTP implementation selected by composition.
|
|
99
154
|
* @param cues Required application result Deck supplied by composition.
|
|
155
|
+
* @param relaying Relay collaborators of an edge runtime; null (a forwarder) resolves every OOBI directly.
|
|
100
156
|
*/
|
|
101
157
|
constructor(hby: Habery, protocol: ProtocolProcessor,
|
|
102
158
|
/** Borrowed reply verifier; route installation and proof writes share this owner. */
|
|
103
|
-
rvy: Revery, http: HttpClient, cues: Deck<AgentCue
|
|
159
|
+
rvy: Revery, http: HttpClient, cues: Deck<AgentCue>, relaying?: OobiRelaying | null);
|
|
104
160
|
/**
|
|
105
161
|
* Register `/introduce` on the shared reply router.
|
|
106
162
|
*
|
|
@@ -134,7 +190,10 @@ export declare class Oobiery {
|
|
|
134
190
|
* doer rather than root-owned queue plumbing.
|
|
135
191
|
*/
|
|
136
192
|
oobiDo(clock?: RuntimeClock, pacing?: Readonly<DoerPacing>): Operation<never>;
|
|
137
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* Select queued work, including a surviving in-flight row whose former process is gone. After a relay job, the
|
|
195
|
+
* first queued URL after it is taken, wrapping around, so jobs waiting on the relay take turns.
|
|
196
|
+
*/
|
|
138
197
|
private nextQueued;
|
|
139
198
|
/** Select a parent only after its current child attempts, including authentication, settle. */
|
|
140
199
|
private nextReadyMoobi;
|
|
@@ -144,7 +203,7 @@ export declare class Oobiery {
|
|
|
144
203
|
* Stores touched:
|
|
145
204
|
* - `oobis.` / `woobi.` as the durable queued worklists
|
|
146
205
|
* - `coobi.` while a fetched response is being processed
|
|
147
|
-
* - `eoobi.` on HTTP failure
|
|
206
|
+
* - `eoobi.` on HTTP failure or an {@link OobiJobFailure}; the queued row is removed so it is not re-read
|
|
148
207
|
* - `roobi.` after parser/routing success
|
|
149
208
|
*
|
|
150
209
|
* @param kind Durable OOBI queue family identifying the job path.
|
|
@@ -172,6 +231,53 @@ export declare class Oobiery {
|
|
|
172
231
|
* @param response Borrowed scoped HTTP response; complete processing precedes terminal state.
|
|
173
232
|
*/
|
|
174
233
|
private resolveCesrOobiResponse;
|
|
234
|
+
/**
|
|
235
|
+
* Dispatch one complete CESR OOBI response through this owner's Kevery and the shared semantic handlers, keeping
|
|
236
|
+
* the queued row and an in-flight `coobi.` row until the stream is consumed. Writes no terminal state.
|
|
237
|
+
*
|
|
238
|
+
* @param kind Durable OOBI queue family identifying the job path.
|
|
239
|
+
* @param url Exact OOBI URL used as the durable job key.
|
|
240
|
+
* @param queuedRecord Original durable job metadata retained until terminal publication.
|
|
241
|
+
* @param response Borrowed scoped HTTP response.
|
|
242
|
+
*/
|
|
243
|
+
private ingestCesrOobiResponse;
|
|
244
|
+
/**
|
|
245
|
+
* Resolve one job through the relay: ask it once, then fetch the result from the relay's own OOBI endpoint.
|
|
246
|
+
*
|
|
247
|
+
* The job stays in `oobis.` while it waits, dated from its first relay attempt; a pass that changes nothing
|
|
248
|
+
* writes nothing. It waits while the relay answers 404, is unreachable, or answers a controller OOBI without the
|
|
249
|
+
* controller's KEL. It fails at {@link RELAY_OOBI_TIMEOUT_MS}: `relay-unresolved` when the relay was asked,
|
|
250
|
+
* `relay-unserved` when it never could be (no accepted relay location, or no local identifier authorized the
|
|
251
|
+
* relay as its mailbox). Another non-OK answer fails at once as `http-<status>`, as a direct fetch does, an answer
|
|
252
|
+
* that is not CESR or whose frames do not decode fails at once with its {@link OobiJobFailure}, and a URL that names
|
|
253
|
+
* neither an identifier nor a SAID fails at once as `relay-unmappable-oobi`.
|
|
254
|
+
*
|
|
255
|
+
* @param relaying Relay collaborators of this edge.
|
|
256
|
+
* @param kind Durable OOBI queue family identifying the job path.
|
|
257
|
+
* @param url Exact third-party OOBI URL used as the durable job key; it is never fetched.
|
|
258
|
+
* @param record Pending durable job.
|
|
259
|
+
*/
|
|
260
|
+
private processRelayJob;
|
|
261
|
+
/**
|
|
262
|
+
* Fetch what the relay holds for one job and ingest it under the ordinary verification.
|
|
263
|
+
*
|
|
264
|
+
* @param kind Durable OOBI queue family identifying the job path.
|
|
265
|
+
* @param url Exact third-party OOBI URL used as the durable job key.
|
|
266
|
+
* @param record Waiting durable job metadata.
|
|
267
|
+
* @param meta Parsed OOBI URL metadata selecting the response interpretation.
|
|
268
|
+
* @param relayUrl URL on the relay's origin that serves the job's answer.
|
|
269
|
+
* @returns `resolved` after a terminal write, `waiting` when the relay does not hold the answer yet or cannot be
|
|
270
|
+
* reached, the refusing HTTP status, or the {@link OobiJobFailure} of an answer that cannot be ingested.
|
|
271
|
+
*/
|
|
272
|
+
private fetchFromRelay;
|
|
273
|
+
/**
|
|
274
|
+
* The local identifier that asks the relay to resolve an OOBI: one the relay serves, which has authorized the
|
|
275
|
+
* relay as its mailbox ({@link relayAuthorized}). A group cannot sign the request alone, so groups never ask.
|
|
276
|
+
*
|
|
277
|
+
* @param relay The configured relay agent.
|
|
278
|
+
* @returns The asking habitat, or null while the relay has no accepted location or no local identifier it serves.
|
|
279
|
+
*/
|
|
280
|
+
private relayAsker;
|
|
175
281
|
/** Handle schema data-OOBIs before generic JSON reply handling. */
|
|
176
282
|
private processSchemaOobiResponse;
|
|
177
283
|
/** Handle JSON OOBI responses that carry reply bodies instead of CESR streams. */
|
|
@@ -202,7 +308,16 @@ export declare class Oobiery {
|
|
|
202
308
|
tsgs?: TransIdxSigGroup[];
|
|
203
309
|
}): ReplyProcessDecision;
|
|
204
310
|
}
|
|
205
|
-
|
|
311
|
+
/**
|
|
312
|
+
* Register the `/oobis` exchange handler.
|
|
313
|
+
*
|
|
314
|
+
* @param hby Borrowed local identities and the durable OOBI queue.
|
|
315
|
+
* @param exchanger Exchanger receiving the route.
|
|
316
|
+
* @param notifier Optional operator notice producer.
|
|
317
|
+
* @param relaying Whether this host relays (the agent side of relay mode): requests are then accepted only from a
|
|
318
|
+
* served sender.
|
|
319
|
+
*/
|
|
320
|
+
export declare function loadOobiHandlers(hby: Habery, exchanger: Exchanger, notifier?: Notifier | null, relaying?: boolean): void;
|
|
206
321
|
/**
|
|
207
322
|
* Peer-to-peer OOBI request handler for `/oobis` exchange messages.
|
|
208
323
|
*
|
|
@@ -216,21 +331,43 @@ export declare function loadOobiHandlers(hby: Habery, exchanger: Exchanger, noti
|
|
|
216
331
|
*
|
|
217
332
|
* Local `keri-ts` adaptation:
|
|
218
333
|
* - verification stays lightweight and route-local: we only require a string
|
|
219
|
-
* `oobi` payload
|
|
334
|
+
* `oobi` payload that is an `http:` or `https:` URL without embedded
|
|
335
|
+
* credentials, which is what the HTTP client can request
|
|
220
336
|
* - durable follow-on work still belongs to `Oobiery` itself; this handler is
|
|
221
337
|
* just the exchange ingress seam that translates an EXN into queued resolver
|
|
222
338
|
* state
|
|
223
339
|
* - unlike KERIpy's DoDoer-centric runtime, the queued record is later
|
|
224
340
|
* advanced by the shared `AgentRuntime` turn that owns OOBI processing
|
|
341
|
+
* - on a relaying host (the agent side of relay mode) a request is accepted
|
|
342
|
+
* only from a served sender, by the same rule `/fwd` intake relays for
|
|
343
|
+
* ({@link servingHost}): the sender authorized a local habitat as its
|
|
344
|
+
* `mailbox` or `agent`. An edge resolves third-party OOBIs this way; nobody
|
|
345
|
+
* else can make the agent fetch a URL. Without relaying, any authenticated
|
|
346
|
+
* sender is accepted, as in KERIpy.
|
|
225
347
|
*/
|
|
226
348
|
export declare class OobiRequestHandler implements ExchangeRouteHandler {
|
|
227
349
|
static readonly resource = "/oobis";
|
|
228
350
|
readonly resource = "/oobis";
|
|
229
351
|
readonly hby: Habery;
|
|
230
352
|
readonly notifier: Notifier | null;
|
|
231
|
-
|
|
353
|
+
/** Whether requests are restricted to served senders. */
|
|
354
|
+
readonly relaying: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* @param hby Borrowed local identities and the durable OOBI queue.
|
|
357
|
+
* @param notifier Optional operator notice producer.
|
|
358
|
+
* @param relaying Restrict requests to served senders (a relaying host); false accepts any sender.
|
|
359
|
+
*/
|
|
360
|
+
constructor(hby: Habery, notifier?: Notifier | null, relaying?: boolean);
|
|
361
|
+
/**
|
|
362
|
+
* Accept a request carrying an `oobi` the HTTP client can request ({@link isRequestableHttpUrl}: HTTP(S), no
|
|
363
|
+
* embedded credentials); on a relaying host, only from a served sender. Anything else could never resolve.
|
|
364
|
+
*
|
|
365
|
+
* @param args Authenticated exchange and the receiving hosted endpoint, if the request named one.
|
|
366
|
+
* @returns False to reject the exchange.
|
|
367
|
+
*/
|
|
232
368
|
verify(args: {
|
|
233
369
|
serder: SerderKERI;
|
|
370
|
+
mailboxAid?: string | null;
|
|
234
371
|
}): boolean;
|
|
235
372
|
handle(args: {
|
|
236
373
|
serder: SerderKERI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oobiery.d.ts","sourceRoot":"","sources":["../../../src/app/bootstrap/oobiery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"oobiery.d.ts","sourceRoot":"","sources":["../../../src/app/bootstrap/oobiery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,EAA+B,UAAU,EAAkB,MAAM,SAAS,CAAC;AACrG,OAAO,EAAQ,KAAK,SAAS,EAAoB,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE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CAAC,IAAI,EAAE;QACX,MAAM,EAAE,UAAU,CAAC;KACpB,GAAG,IAAI;CA6BT;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,UAAU,CAQZ;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CA+BjE;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAIvD;AA4ED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -17,6 +17,14 @@ export interface CredentialImportResult {
|
|
|
17
17
|
* Later input failures preserve earlier accepted state. Receipts, replies and other messages still
|
|
18
18
|
* use normal dispatch; absence of an importer acceptance lookup is not an additional refusal policy.
|
|
19
19
|
*
|
|
20
|
+
* The input is retained history the caller already holds (for example an exported disclosure stream: KELs, the v2
|
|
21
|
+
* registry TEL, a Grant and its Admit), so every frame is dispatched with `DispatchOptions.retained`. Its v2
|
|
22
|
+
* exchanges skip KRAM, whose window their original stamps passed long ago; signatures, route verification and
|
|
23
|
+
* escrows are unchanged, and the accepted exchanges raise no notice and get no exchange lifetime. Targets: raw
|
|
24
|
+
* credentials, KEL and v1 TEL events, v2 `rip`/`bup` (accepted at their exact ordinal in the v2 registry store),
|
|
25
|
+
* and exchanges (accepted by the Exchanger; a v2 Admit also needs its Grant's reply row to name it). Importing the
|
|
26
|
+
* same input again changes nothing and reports the same acceptance.
|
|
27
|
+
*
|
|
20
28
|
* @param protocol Borrowed protocol dispatcher, sharing reger with its TEL/credential handlers.
|
|
21
29
|
* @param reger Borrowed credential/TEL store whose accepted records establish the result.
|
|
22
30
|
* @param bytes Borrowed finite CESR bundle; parser chunks are copied during intake.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-importing.d.ts","sourceRoot":"","sources":["../../../src/app/credentials/credential-importing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,SAAS,EAAQ,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"credential-importing.d.ts","sourceRoot":"","sources":["../../../src/app/credentials/credential-importing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,KAAK,SAAS,EAAQ,MAAM,WAAW,CAAC;AAIvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,2FAA2F;AAC3F,MAAM,WAAW,sBAAsB;IACrC,uHAAuH;IACvH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,0HAA0H;IAC1H,QAAQ,EAAE,OAAO,CAAC;IAClB,2FAA2F;IAC3F,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAyCD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAiB,sBAAsB,CACrC,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,YAAY,EACnB,SAAS,SAAQ,GAChB,SAAS,CAAC,sBAAsB,CAAC,CA+CnC"}
|
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
* receiving is idempotent.
|
|
15
15
|
*
|
|
16
16
|
* A pass runs for a group on the replicator's first pass, after its latest establishment
|
|
17
|
-
* changes (an accepted rotation)
|
|
18
|
-
*
|
|
19
|
-
* the
|
|
17
|
+
* changes (an accepted rotation) or its stored members change (they follow accepted state once
|
|
18
|
+
* every member's KEL is known), and when the Dhke completion cue prompts it, so a cue lost in a
|
|
19
|
+
* crash is recovered by the next start. The Counselor puts a group on the `changed` deck when it
|
|
20
|
+
* completes the group's establishment event or aligns its stored members, so the next pass
|
|
21
|
+
* re-derives it; the sweep finds the same changes later for a group nobody put there. Sending a
|
|
22
|
+
* root a member already holds to the group's current members is not a new consent, so nothing
|
|
23
|
+
* here asks anyone.
|
|
20
24
|
*
|
|
21
25
|
* A copy that cannot be prepared or delivered stays owed and is retried with a
|
|
22
26
|
* process-local backoff; `status` reports it until it goes.
|
|
@@ -24,6 +28,7 @@
|
|
|
24
28
|
import type { Operation } from "effection";
|
|
25
29
|
import type { DhkeReplicate } from "../../acdc/dhking.js";
|
|
26
30
|
import type { RegistryRoot } from "../../acdc/salting.js";
|
|
31
|
+
import type { Deck } from "../../core/deck.js";
|
|
27
32
|
import type { Poster } from "../delivery/forwarding.js";
|
|
28
33
|
import type { Hab } from "../identity/habbing.js";
|
|
29
34
|
import type { RuntimeClock } from "../runtime/runtime-clock.js";
|
|
@@ -51,6 +56,11 @@ export interface RootReplicatorDeps {
|
|
|
51
56
|
postman: Poster;
|
|
52
57
|
clock: RuntimeClock;
|
|
53
58
|
changes?: ChangeSink;
|
|
59
|
+
/**
|
|
60
|
+
* Prefixes of groups whose establishment event or stored members changed, which the Counselor pushes. Each pass
|
|
61
|
+
* drains it as if each group were prompted.
|
|
62
|
+
*/
|
|
63
|
+
changed?: Deck<string>;
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
56
66
|
* Derives, sends and records registry root copies for a wallet's local groups.
|
|
@@ -58,7 +68,8 @@ export interface RootReplicatorDeps {
|
|
|
58
68
|
* Holds no durable state of its own beyond `Baser.rrsn`; what is pending and the
|
|
59
69
|
* backoff are process-local and rebuilt from state. A host calls `prompt` (or
|
|
60
70
|
* `replicate`) for each Dhke cue and `processOnce` on its loop; both are safe to repeat,
|
|
61
|
-
* and overlapping `processOnce` calls never send one copy twice.
|
|
71
|
+
* and overlapping `processOnce` calls never send one copy twice. Groups on the `changed`
|
|
72
|
+
* deck are prompted by the next pass.
|
|
62
73
|
*/
|
|
63
74
|
export declare class RootReplicator {
|
|
64
75
|
#private;
|
|
@@ -76,8 +87,8 @@ export declare class RootReplicator {
|
|
|
76
87
|
timeoutMs?: number;
|
|
77
88
|
}): Operation<RootCopyResult[]>;
|
|
78
89
|
/**
|
|
79
|
-
* The fixed-tock pass: re-derive only the groups that were prompted, then send up
|
|
80
|
-
* due copies. A rotation nobody prompted for waits for {@link RootReplicator.sweep}.
|
|
90
|
+
* The fixed-tock pass: re-derive only the groups that were prompted or are on the `changed` deck, then send up
|
|
91
|
+
* to {@link RootSendsPerPass} due copies. A rotation nobody prompted for waits for {@link RootReplicator.sweep}.
|
|
81
92
|
*/
|
|
82
93
|
processDue({ timeoutMs }?: {
|
|
83
94
|
timeoutMs?: number;
|
|
@@ -97,8 +108,8 @@ export declare class RootReplicator {
|
|
|
97
108
|
status(): RootReplicatorStatus;
|
|
98
109
|
/**
|
|
99
110
|
* The full check: drop markers of groups that are gone (once) and re-derive each local group that is new or
|
|
100
|
-
* whose establishment event changed. One keyed read per local identifier, so a host runs it
|
|
101
|
-
* many tocks, not every tock.
|
|
111
|
+
* whose establishment event or stored members changed. One keyed read per local identifier, so a host runs it
|
|
112
|
+
* every many tocks, not every tock.
|
|
102
113
|
*/
|
|
103
114
|
sweep(): void;
|
|
104
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-replicator.d.ts","sourceRoot":"","sources":["../../../src/app/credentials/root-replicator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"root-replicator.d.ts","sourceRoot":"","sources":["../../../src/app/credentials/root-replicator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE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AAA;KAAO,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;IAK1G;;;OAGG;IACF,UAAU,CAAC,EAAE,SAA8B,EAAE,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC;IAsBzG;;;;OAIG;IACF,IAAI,CACH,IAAI,EAAE,GAAG,EACT,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE;QAAE,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAC/E,SAAS,CAAC,cAAc,EAAE,CAAC;IAc9B,gGAAgG;IAChG,OAAO,IAAI,OAAO;IAIlB,2DAA2D;IAC3D,MAAM,IAAI,oBAAoB;IAsC9B;;;;OAIG;IACH,KAAK,IAAI,IAAI;CA0Cd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-resolving.d.ts","sourceRoot":"","sources":["../../../src/app/credentials/schema-resolving.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-resolving.d.ts","sourceRoot":"","sources":["../../../src/app/credentials/schema-resolving.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjC,uEAAuE;AACvE,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAiBvE;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,OAAO,GAAG,IAAI,CAShB"}
|
|
@@ -9,8 +9,10 @@ import { type Receiptor } from "../witness/receipting.js";
|
|
|
9
9
|
* Advance one captured set of protocol escrows. Receipt collection includes
|
|
10
10
|
* fanout; a crash before its commit repeats that ordinary finite operation.
|
|
11
11
|
* Dissemination replays accepted TEL evidence to the anchor's historical witness
|
|
12
|
-
* cohort and commits ctel only after every local transmission finished.
|
|
13
|
-
*
|
|
12
|
+
* cohort and commits ctel only after every local transmission finished. A witness
|
|
13
|
+
* that is unreachable, refuses or does not receipt ends only that target: its
|
|
14
|
+
* escrow is retained and the next pass retries it, without an outbox. Local faults
|
|
15
|
+
* (missing issuer Hab, storage) still throw.
|
|
14
16
|
*/
|
|
15
17
|
export declare function publishPendingTel(hby: Habery, publication: TelPublication, receiptor: Receiptor, http: HttpClient, clock: RuntimeClock): Operation<void>;
|
|
16
18
|
//# sourceMappingURL=tel-publishing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tel-publishing.d.ts","sourceRoot":"","sources":["../../../src/app/credentials/tel-publishing.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"tel-publishing.d.ts","sourceRoot":"","sources":["../../../src/app/credentials/tel-publishing.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;;;;;GAQG;AACH,wBAAiB,iBAAiB,CAChC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,cAAc,EAC3B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,YAAY,GAClB,SAAS,CAAC,IAAI,CAAC,CAqBjB"}
|
|
@@ -6,6 +6,7 @@ import type { Habery } from "../identity/habbing.js";
|
|
|
6
6
|
import type { ProtocolProcessor } from "../protocol/protocol-processing.js";
|
|
7
7
|
import type { RuntimeClock } from "../runtime/runtime-clock.js";
|
|
8
8
|
import type { HttpClient } from "../transport/http-client.js";
|
|
9
|
+
import { type Relay } from "./relaying.js";
|
|
9
10
|
/** Prepared signed source; Poster copies its bytes before publishing an ordinary admission. */
|
|
10
11
|
export interface PosterMsg {
|
|
11
12
|
/**
|
|
@@ -66,6 +67,14 @@ export type PosterOutcome = {
|
|
|
66
67
|
export declare class PeerVersionError extends ValidationError {
|
|
67
68
|
readonly name: string;
|
|
68
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* A queued message whose own bytes cannot be prepared for sending: they are not complete CESR, or a forwarded
|
|
72
|
+
* delivery's source is not exactly one complete message. It describes the event, never this node, so it fails that
|
|
73
|
+
* delivery and the Poster continues with the next.
|
|
74
|
+
*/
|
|
75
|
+
export declare class UnsendableMessageError extends ValidationError {
|
|
76
|
+
readonly name: string;
|
|
77
|
+
}
|
|
69
78
|
/**
|
|
70
79
|
* Deliver queued signed messages using KERIpy's ordinary Poster role traversal.
|
|
71
80
|
*
|
|
@@ -73,6 +82,13 @@ export declare class PeerVersionError extends ValidationError {
|
|
|
73
82
|
* storage). Only recipients without those roles use one witness. Transport
|
|
74
83
|
* completion and opt-in outcomes do not prove remote protocol acceptance. Finite
|
|
75
84
|
* stream admissions use the first present role through the same execution owner.
|
|
85
|
+
*
|
|
86
|
+
* With a relay (an edge runtime) there is no role traversal: every recipient other
|
|
87
|
+
* than the relay gets one `/fwd` delivery to the relay, which does the forwarding,
|
|
88
|
+
* and the relay itself gets the message directly. `sent` then means the relay
|
|
89
|
+
* accepted the wrapper, not that the final recipient received it. A forwarded
|
|
90
|
+
* delivery fails with `RelayUnauthorizedError`, sending nothing, until its wrapper
|
|
91
|
+
* signer (a group's local member) has authorized the relay as its mailbox.
|
|
76
92
|
*/
|
|
77
93
|
export declare class Poster {
|
|
78
94
|
/** Borrowed habitat collection and backing accepted protocol state. */
|
|
@@ -101,6 +117,8 @@ export declare class Poster {
|
|
|
101
117
|
private joined?;
|
|
102
118
|
/** Borrowed same-socket protocol receiver; null explicitly selects send-only capability. */
|
|
103
119
|
private readonly protocol;
|
|
120
|
+
/** The agent every message goes through (an edge); null delivers directly (a forwarder). */
|
|
121
|
+
readonly relay: Relay | null;
|
|
104
122
|
/**
|
|
105
123
|
* Bind actual collaborators; Poster owns queue/I/O lifetimes and borrows their stores.
|
|
106
124
|
*
|
|
@@ -109,9 +127,10 @@ export declare class Poster {
|
|
|
109
127
|
* @param protocol Borrowed same-database processor for TCP replies; null permits send-only work.
|
|
110
128
|
* @param http Borrowed HTTP implementation selected by composition.
|
|
111
129
|
* @param clock Borrowed clock for transport deadlines; times are milliseconds.
|
|
130
|
+
* @param relay The agent every message goes through; null selects ordinary direct role traversal.
|
|
112
131
|
* @throws RangeError if protocol state belongs to a different database.
|
|
113
132
|
*/
|
|
114
|
-
constructor(hby: Habery, mbx: Mailboxer | null, protocol: ProtocolProcessor | null, http: HttpClient, clock: RuntimeClock);
|
|
133
|
+
constructor(hby: Habery, mbx: Mailboxer | null, protocol: ProtocolProcessor | null, http: HttpClient, clock: RuntimeClock, relay: Relay | null);
|
|
115
134
|
/**
|
|
116
135
|
* Admit signed source bytes; callers must observe an outcome before reporting transmission.
|
|
117
136
|
*
|
|
@@ -191,7 +210,11 @@ export declare class Poster {
|
|
|
191
210
|
/**
|
|
192
211
|
* Resolve and execute one event using sequential current endpoints.
|
|
193
212
|
* Observed HTTP refusal and TransportError permit remaining targets to run.
|
|
194
|
-
*
|
|
213
|
+
* The event's bytes are decoded once; bytes that are not complete CESR fail the
|
|
214
|
+
* event. `PeerVersionError` and `UnsendableMessageError` from preparation fail
|
|
215
|
+
* only that target: both are decided from the event's own bytes and the peer's
|
|
216
|
+
* accepted version before any store write or I/O for the target. Other
|
|
217
|
+
* construction/storage/cleanup errors are faults and propagate so process can
|
|
195
218
|
* publish or report the failed outcome before exposing the error.
|
|
196
219
|
*
|
|
197
220
|
* @param evt Concrete source-message record; completion/failure lookup uses object identity, not message SAID.
|
|
@@ -207,7 +230,10 @@ export declare class Poster {
|
|
|
207
230
|
*
|
|
208
231
|
* Controller and agent roles each retain all endpoints. An indirect role picks
|
|
209
232
|
* one random provider, unless an explicitly composed store owns an eligible local
|
|
210
|
-
* AID.
|
|
233
|
+
* AID. An agent role whose endpoint is a local AID with a composed store is that
|
|
234
|
+
* same local store target (given a topic), as the hosted agent keeps the recipient's
|
|
235
|
+
* mail for pickup. Empty location maps retain role selection and become execution failures.
|
|
236
|
+
* With a relay, the relay alone is the route (see {@link relayRoutes}).
|
|
211
237
|
*
|
|
212
238
|
* @param hab Local signing habitat borrowing accepted role/location state.
|
|
213
239
|
* @param recipient Resolved final recipient AID.
|
|
@@ -216,10 +242,43 @@ export declare class Poster {
|
|
|
216
242
|
* @returns Ordered role groups; no eligible role returns an empty array.
|
|
217
243
|
*/
|
|
218
244
|
private findBytesRoutes;
|
|
245
|
+
/**
|
|
246
|
+
* Route through the relay: one `forward` route to the relay for every other recipient, never a direct fallback,
|
|
247
|
+
* and one `direct` route when the recipient is the relay. Recipient end roles are not read.
|
|
248
|
+
*
|
|
249
|
+
* @param hab Local sending habitat; its wrapper signer must have authorized the relay as mailbox.
|
|
250
|
+
* @param relay The configured relay agent.
|
|
251
|
+
* @param recipient Resolved final recipient AID.
|
|
252
|
+
* @param topic Recipient mailbox topic; the forwarded route requires a nonempty topic.
|
|
253
|
+
* @returns One route to the relay, or none while {@link relayRefusal} refuses the relay for this sender.
|
|
254
|
+
*/
|
|
255
|
+
private relayRoutes;
|
|
256
|
+
/**
|
|
257
|
+
* The identifier whose mailbox authorization of the relay a delivery needs: the `/fwd` wrapper's signer (see
|
|
258
|
+
* {@link Poster.wrapperSigner}), the same `i` the agent reads to decide it serves the sender. For a group source
|
|
259
|
+
* that is the local member, not the group. A message addressed to the relay is not wrapped and needs none (null).
|
|
260
|
+
*
|
|
261
|
+
* @param hab Local sending habitat.
|
|
262
|
+
* @param relay The configured relay agent.
|
|
263
|
+
* @param recipient Resolved final recipient AID.
|
|
264
|
+
* @returns The wrapper signer's AID, or null when the recipient is the relay.
|
|
265
|
+
*/
|
|
266
|
+
private relaySigner;
|
|
267
|
+
/**
|
|
268
|
+
* The habitat that signs a `/fwd` wrapper for `hab`. A group cannot sign the wrapper alone: one member's signature
|
|
269
|
+
* does not meet a threshold above one, and the host would escrow the wrapper. The local member wraps; the payload
|
|
270
|
+
* keeps whatever signatures it carries.
|
|
271
|
+
*
|
|
272
|
+
* @param hab Local sending habitat, possibly a group.
|
|
273
|
+
* @returns `hab` itself, or the group's local member.
|
|
274
|
+
* @throws ValidationError when a group has no local member metadata.
|
|
275
|
+
*/
|
|
276
|
+
private wrapperSigner;
|
|
219
277
|
/**
|
|
220
278
|
* Whether `src` has any eligible role (controller, agent, mailbox or witness) from which to reach `dest`, as
|
|
221
279
|
* delivery would find it now. A pure read of accepted endpoint state: it says nothing about whether the
|
|
222
|
-
* endpoint answers. A proposer uses it to refuse before it creates anything it could not publish.
|
|
280
|
+
* endpoint answers. A proposer uses it to refuse before it creates anything it could not publish. With a relay,
|
|
281
|
+
* it is whether {@link relayRefusal} accepts the relay for this sender.
|
|
223
282
|
*/
|
|
224
283
|
canReach(src: string, dest: string, topic?: string): boolean;
|
|
225
284
|
/**
|
|
@@ -229,10 +288,33 @@ export declare class Poster {
|
|
|
229
288
|
* @param route Selected direct or forwarded endpoint group.
|
|
230
289
|
* @param endpoint One selected endpoint AID and URL from the route.
|
|
231
290
|
* @param evt Original signed source and concrete ordinary/stream operation.
|
|
291
|
+
* @param frames The event's bytes, decoded once by {@link messageFrames}.
|
|
232
292
|
* @returns A prepared remote target, or stored after authorized local mailbox publication.
|
|
233
293
|
* @throws PeerVersionError when the wire needs a v2 reader that this peer is known not to be.
|
|
294
|
+
* @throws UnsendableMessageError when a forwarded ordinary message is not exactly one message.
|
|
234
295
|
*/
|
|
235
296
|
private prepareBytesTarget;
|
|
297
|
+
/**
|
|
298
|
+
* Whether the configured relay is already known to hold what it needs to verify `signer`'s `/fwd` wrappers, so
|
|
299
|
+
* the whole-KEL introduction can be left out.
|
|
300
|
+
*
|
|
301
|
+
* The relay verifies a wrapper against the signer's current key state, which the signer's latest establishment
|
|
302
|
+
* event fixes; interaction events do not change it. The evidence is `Baser.kpub`, the record the KEL publisher
|
|
303
|
+
* keeps per (identifier, mailbox) of the establishment event whose KEL (delegation chain included, and only once a
|
|
304
|
+
* delegated establishment is anchored) the mailbox was last given. The relay is the signer's mailbox, so the
|
|
305
|
+
* publisher and the mailbox admin request keep that record. Any other endpoint, and any mismatch or missing
|
|
306
|
+
* record, keeps today's full introduction.
|
|
307
|
+
*
|
|
308
|
+
* Known limit: a 2xx is not acceptance, and a relay that lost its store answers a `/fwd` from a sender it no
|
|
309
|
+
* longer knows with the same 204 acknowledgement and drops it. Nothing in the `/fwd` path signals that today; the
|
|
310
|
+
* sender's next mailbox poll gets the relay's 403, which makes `KelPublisher` clear the record and repost the KEL.
|
|
311
|
+
* Wrappers sent in between are lost until then.
|
|
312
|
+
*
|
|
313
|
+
* @param signer Local habitat that signs the wrapper (a group's local member).
|
|
314
|
+
* @param eid Endpoint AID the prepared wire goes to.
|
|
315
|
+
* @returns True only when `eid` is the relay and the record holds `signer`'s current establishment heads.
|
|
316
|
+
*/
|
|
317
|
+
private relayHoldsKel;
|
|
236
318
|
/**
|
|
237
319
|
* Prepare complete signed wire and its introduction before opening transport.
|
|
238
320
|
*
|
|
@@ -240,8 +322,11 @@ export declare class Poster {
|
|
|
240
322
|
* @param recipient Final recipient AID, distinct from the intermediary endpoint.
|
|
241
323
|
* @param topic Recipient mailbox topic used by the forwarding envelope.
|
|
242
324
|
* @param evt Original signed source and operation; outer envelopes may be rebuilt.
|
|
325
|
+
* @param frames The event's decoded messages: exactly one for an ordinary event, each forwarded alone in a stream.
|
|
243
326
|
* @param endpoint Mailbox/witness endpoint selected for this attempt.
|
|
244
|
-
* @returns Stored for a local endpoint,
|
|
327
|
+
* @returns Stored for a local endpoint, unsignable when the wrapper signer cannot sign now, or signed forwarding
|
|
328
|
+
* wire with its introduction.
|
|
329
|
+
* @throws UnsendableMessageError when an ordinary event is not exactly one message.
|
|
245
330
|
*/
|
|
246
331
|
private prepareForwardedTarget;
|
|
247
332
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forwarding.d.ts","sourceRoot":"","sources":["../../../src/app/delivery/forwarding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"forwarding.d.ts","sourceRoot":"","sources":["../../../src/app/delivery/forwarding.ts"],"names":[],"mappings":"AAaA,OAAO,EAAQ,K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