@agenticprimitives/agent-resolution 0.0.0-alpha.20 → 0.0.0-alpha.22
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/README.md +15 -9
- package/dist/compose.d.ts +58 -7
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +116 -62
- package/dist/compose.js.map +1 -1
- package/dist/endpoint-control.d.ts +120 -13
- package/dist/endpoint-control.d.ts.map +1 -1
- package/dist/endpoint-control.js +215 -51
- package/dist/endpoint-control.js.map +1 -1
- package/dist/errors.d.ts +16 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -0
- package/dist/errors.js.map +1 -1
- package/dist/freshness.d.ts +79 -5
- package/dist/freshness.d.ts.map +1 -1
- package/dist/freshness.js +149 -35
- package/dist/freshness.js.map +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/projection.d.ts +17 -3
- package/dist/projection.d.ts.map +1 -1
- package/dist/projection.js +20 -2
- package/dist/projection.js.map +1 -1
- package/dist/proof.d.ts +120 -18
- package/dist/proof.d.ts.map +1 -1
- package/dist/proof.js +279 -73
- package/dist/proof.js.map +1 -1
- package/dist/publication.d.ts +62 -6
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +28 -1
- package/dist/publication.js.map +1 -1
- package/dist/records.d.ts +3 -0
- package/dist/records.d.ts.map +1 -1
- package/dist/records.js.map +1 -1
- package/package.json +3 -3
- package/spec.md +5 -2
|
@@ -2,30 +2,39 @@ import { type CanonicalAgentId } from '@agenticprimitives/types';
|
|
|
2
2
|
import { type ResolutionFailure } from './errors.js';
|
|
3
3
|
import type { EndpointControlProofV1 } from './publication.js';
|
|
4
4
|
import type { Erc1271Verifier } from './proof.js';
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* How strongly control of the endpoint was established. Ordered weakest → strongest.
|
|
7
|
+
*
|
|
8
|
+
* `agent-asserted` is NOT control and never satisfies a control requirement — it is listed so a
|
|
9
|
+
* result can say truthfully what was presented. (The former `cryptographic` grade is gone: it named
|
|
10
|
+
* the agent's own signature over its own challenge, NAME-5.)
|
|
11
|
+
*/
|
|
6
12
|
export type EndpointControlAssurance =
|
|
7
13
|
/** Nothing verified. */
|
|
8
14
|
'none'
|
|
15
|
+
/** The agent signed "this is my endpoint". Nobody dialled it. An assertion, never control. */
|
|
16
|
+
| 'agent-asserted'
|
|
9
17
|
/** A well-formed, correctly-bound, fresh observation by a trusted observer. NOT re-checked here. */
|
|
10
18
|
| 'observed'
|
|
11
|
-
/**
|
|
12
|
-
| '
|
|
19
|
+
/** THIS verifier chose a nonce, dialled the endpoint, and the endpoint served the agent's signature over it. */
|
|
20
|
+
| 'verifier-dialled';
|
|
21
|
+
/** The grades that count as endpoint control. `agent-asserted` is deliberately absent. */
|
|
22
|
+
export declare function isEndpointControl(a: EndpointControlAssurance | undefined): a is 'observed' | 'verifier-dialled';
|
|
13
23
|
/**
|
|
14
|
-
* The body an agent signs to
|
|
24
|
+
* The body an agent signs to ASSERT an endpoint is its own (`signed-challenge`).
|
|
15
25
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* cannot be presented by a different one.
|
|
26
|
+
* This is an assertion, not control: the agent chose `challenge` and nobody dialled `uri`. Binding
|
|
27
|
+
* `uri` + `surfaceId` + `agentId` only stops the assertion being re-filed for another surface/agent.
|
|
19
28
|
*/
|
|
20
29
|
export interface EndpointChallengeBody {
|
|
21
30
|
uri: string;
|
|
22
31
|
agentId: CanonicalAgentId;
|
|
23
32
|
surfaceId: string;
|
|
24
|
-
/**
|
|
33
|
+
/** Chosen by the AGENT — which is exactly why this body proves nothing about the endpoint. */
|
|
25
34
|
challenge: string;
|
|
26
35
|
issuedAt: string;
|
|
27
36
|
}
|
|
28
|
-
/** Evidence for `method: 'signed-challenge'` —
|
|
37
|
+
/** Evidence for `method: 'signed-challenge'` — an agent ASSERTION (see `verifyEndpointAssertion`). */
|
|
29
38
|
export interface SignedChallengeEvidenceV1 {
|
|
30
39
|
kind: 'signed-challenge';
|
|
31
40
|
body: EndpointChallengeBody;
|
|
@@ -64,7 +73,19 @@ export interface VerifyEndpointControlOptions {
|
|
|
64
73
|
}
|
|
65
74
|
export interface EndpointControlResult {
|
|
66
75
|
ok: boolean;
|
|
67
|
-
|
|
76
|
+
/** `observed` or `verifier-dialled` when `ok`; `none` otherwise. Never `agent-asserted`. */
|
|
77
|
+
assurance: 'none' | 'observed' | 'verifier-dialled';
|
|
78
|
+
failures: readonly ResolutionFailure[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The result of checking an agent's ASSERTION that an endpoint is its own. Deliberately has no `ok`
|
|
82
|
+
* and a literal `control: false`, so it cannot be read as — or assigned to — a control verdict.
|
|
83
|
+
*/
|
|
84
|
+
export interface EndpointAssertionResult {
|
|
85
|
+
kind: 'endpoint-assertion';
|
|
86
|
+
/** The agent validly signed "uri/surface is mine". Says nothing about who answers at `uri`. */
|
|
87
|
+
asserted: boolean;
|
|
88
|
+
control: false;
|
|
68
89
|
failures: readonly ResolutionFailure[];
|
|
69
90
|
}
|
|
70
91
|
/**
|
|
@@ -77,11 +98,97 @@ export interface EndpointControlResult {
|
|
|
77
98
|
* `https://evil@acme.example` is a classic confusion vector.
|
|
78
99
|
*/
|
|
79
100
|
export declare function normalizeEndpointUri(uri: string): string | null;
|
|
80
|
-
/** The digest an agent signs for `signed-challenge
|
|
101
|
+
/** The digest an agent signs for a `signed-challenge` ASSERTION. */
|
|
81
102
|
export declare function endpointChallengeDigest(body: EndpointChallengeBody): Promise<`0x${string}`>;
|
|
82
103
|
/**
|
|
83
|
-
* Verify that the publisher controls the endpoint
|
|
84
|
-
* unverifiable evidence yields `ok: false
|
|
104
|
+
* Verify RECORDED evidence that the publisher controls the endpoint — a trusted observer's dial.
|
|
105
|
+
* Fail-closed: any missing, mis-bound, stale, or unverifiable evidence yields `ok: false`; an
|
|
106
|
+
* unrecognized method is a failure; and a `signed-challenge` (the agent's own assertion) is REFUSED.
|
|
107
|
+
* To establish control yourself, use `establishEndpointControl`.
|
|
85
108
|
*/
|
|
86
109
|
export declare function verifyEndpointControl(proof: EndpointControlProofV1, opts: VerifyEndpointControlOptions): Promise<EndpointControlResult>;
|
|
110
|
+
/**
|
|
111
|
+
* Check an agent's ASSERTION that `uri`/`surfaceId` is its own (`signed-challenge` evidence).
|
|
112
|
+
*
|
|
113
|
+
* NOT endpoint control. The result type has no `ok`; `control` is the literal `false`. Useful only
|
|
114
|
+
* to say "the agent did sign this claim" — which the publication signature already says.
|
|
115
|
+
*/
|
|
116
|
+
export declare function verifyEndpointAssertion(evidence: SignedChallengeEvidenceV1, opts: Pick<VerifyEndpointControlOptions, 'uri' | 'surfaceId' | 'agentId' | 'verifier'>): Promise<EndpointAssertionResult>;
|
|
117
|
+
export declare const ENDPOINT_CONTROL_CHALLENGE_TYPE: "ap.endpoint-control-challenge/1";
|
|
118
|
+
/**
|
|
119
|
+
* What the VERIFIER sends to the endpoint, and exactly what the agent behind the endpoint signs.
|
|
120
|
+
* Binds nonce + endpoint uri + surface + agent + expiry; `type` domain-separates it from every
|
|
121
|
+
* other body an agent signs (an assertion signature can never be replayed as a dial response).
|
|
122
|
+
*/
|
|
123
|
+
export interface EndpointControlChallengeV1 {
|
|
124
|
+
type: typeof ENDPOINT_CONTROL_CHALLENGE_TYPE;
|
|
125
|
+
/** 0x-hex, ≥ 128 bits, generated by the verifier with WebCrypto. */
|
|
126
|
+
nonce: `0x${string}`;
|
|
127
|
+
uri: string;
|
|
128
|
+
surfaceId: string;
|
|
129
|
+
agentId: CanonicalAgentId;
|
|
130
|
+
issuedAt: string;
|
|
131
|
+
expiresAt: string;
|
|
132
|
+
}
|
|
133
|
+
/** What the endpoint serves back: the challenge it was sent, echoed, and the agent's signature over it. */
|
|
134
|
+
export interface EndpointControlResponseV1 {
|
|
135
|
+
challenge: EndpointControlChallengeV1;
|
|
136
|
+
signature: `0x${string}`;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The dial — INJECTED; this package does no network I/O. A conforming dialer sends `challenge` to
|
|
140
|
+
* `uri`, does NOT follow redirects off the endpoint, and returns what the endpoint served together
|
|
141
|
+
* with the URL the bytes were actually served from. `null` = the endpoint did not answer.
|
|
142
|
+
*/
|
|
143
|
+
export type EndpointDialPort = (request: {
|
|
144
|
+
uri: string;
|
|
145
|
+
challenge: EndpointControlChallengeV1;
|
|
146
|
+
}) => Promise<{
|
|
147
|
+
servedFrom: string;
|
|
148
|
+
response: unknown;
|
|
149
|
+
} | null>;
|
|
150
|
+
/**
|
|
151
|
+
* Single-use ledger for verifier nonces — INJECTED (this package holds no state). `consume` returns
|
|
152
|
+
* `true` exactly once per nonce; anything else (false, a throw) is a refusal.
|
|
153
|
+
*/
|
|
154
|
+
export interface EndpointNonceLedger {
|
|
155
|
+
consume(nonce: `0x${string}`, expiresAt: string): Promise<boolean>;
|
|
156
|
+
}
|
|
157
|
+
export interface EstablishEndpointControlOptions {
|
|
158
|
+
uri: string;
|
|
159
|
+
surfaceId: string;
|
|
160
|
+
agentId: CanonicalAgentId;
|
|
161
|
+
/** ISO-8601 clock, injected. Read once to issue and once after the dial. */
|
|
162
|
+
now: () => string;
|
|
163
|
+
verifier: Erc1271Verifier;
|
|
164
|
+
dial: EndpointDialPort;
|
|
165
|
+
nonces: EndpointNonceLedger;
|
|
166
|
+
/** Challenge lifetime. Default 5 minutes, capped at 1 hour. */
|
|
167
|
+
ttlMs?: number;
|
|
168
|
+
}
|
|
169
|
+
export type EstablishEndpointControlResult = {
|
|
170
|
+
ok: true;
|
|
171
|
+
assurance: 'verifier-dialled';
|
|
172
|
+
challenge: EndpointControlChallengeV1;
|
|
173
|
+
/** The url the endpoint served the response from, as the dialer reported it. */
|
|
174
|
+
servedFrom: string;
|
|
175
|
+
dialledAt: string;
|
|
176
|
+
failures: readonly [];
|
|
177
|
+
} | {
|
|
178
|
+
ok: false;
|
|
179
|
+
assurance: 'none';
|
|
180
|
+
failures: readonly ResolutionFailure[];
|
|
181
|
+
};
|
|
182
|
+
/** The digest the agent behind the endpoint signs for a verifier's challenge. */
|
|
183
|
+
export declare function endpointControlChallengeDigest(c: EndpointControlChallengeV1): Promise<`0x${string}`>;
|
|
184
|
+
/**
|
|
185
|
+
* Establish endpoint control: generate a nonce, single-use it, dial the endpoint, and verify that
|
|
186
|
+
* the endpoint served the agent's signature over THIS challenge.
|
|
187
|
+
*
|
|
188
|
+
* The nonce is generated HERE and cannot be supplied — a challenge the agent chose is the finding.
|
|
189
|
+
* Fail-closed at every step: no WebCrypto, a ledger that refuses or throws, an endpoint that does
|
|
190
|
+
* not answer, a response from another endpoint, a nonce not echoed, a body that differs in any
|
|
191
|
+
* field, an expired challenge, or a signature that does not verify — all `ok: false`.
|
|
192
|
+
*/
|
|
193
|
+
export declare function establishEndpointControl(opts: EstablishEndpointControlOptions): Promise<EstablishEndpointControlResult>;
|
|
87
194
|
//# sourceMappingURL=endpoint-control.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-control.d.ts","sourceRoot":"","sources":["../src/endpoint-control.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoint-control.d.ts","sourceRoot":"","sources":["../src/endpoint-control.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAAW,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB;AAClC,wBAAwB;AACtB,MAAM;AACR,8FAA8F;GAC5F,gBAAgB;AAClB,oGAAoG;GAClG,UAAU;AACZ,gHAAgH;GAC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AC;IACtC,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAAE,CAAC;AAyB7E,iFAAiF;AACjF,wBAAsB,8BAA8B,CAAC,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAE1G;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,8BAA8B,CAAC,CAiGzC"}
|
package/dist/endpoint-control.js
CHANGED
|
@@ -1,25 +1,36 @@
|
|
|
1
|
-
// Endpoint
|
|
1
|
+
// Endpoint control (spec 338 §3; AR-L4; spec 445 / NAME-5).
|
|
2
2
|
//
|
|
3
|
-
// THE
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// THE PROPERTY, OVER THE WHOLE OBJECT:
|
|
4
|
+
// "Endpoint control" means the party in control of the ENDPOINT cooperated with a challenge the
|
|
5
|
+
// VERIFIER chose. Three things must all be true, and this file refuses when any is missing:
|
|
6
|
+
// 1. the verifier generated the nonce (≥ 128 bits, WebCrypto) — never the agent;
|
|
7
|
+
// 2. the proof was SERVED BY the endpoint, to a dial the verifier made (the dial is an injected
|
|
8
|
+
// port — this package does no network I/O — and its result carries what the endpoint served
|
|
9
|
+
// and where it was served from);
|
|
10
|
+
// 3. what is signed binds nonce + endpoint uri + surface + agent + expiry, and the nonce is
|
|
11
|
+
// single-use.
|
|
6
12
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
13
|
+
// WHAT IS NOT CONTROL (the finding this closes):
|
|
14
|
+
// A `signed-challenge` proof stored beside a publication is the AGENT'S OWN signature over a
|
|
15
|
+
// challenge IT chose. Nobody dialled the endpoint, so a victim's URI passes. It adds nothing to the
|
|
16
|
+
// publication signature, which already says "my endpoint is this URI". It is therefore an
|
|
17
|
+
// ASSERTION: `verifyEndpointAssertion` returns a result with no `ok` and `control: false`, and
|
|
18
|
+
// `verifyEndpointControl` REFUSES it.
|
|
11
19
|
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
// `cryptographic`. Do not read `observed` as "we re-checked it": it means "a party we trust to
|
|
17
|
-
// observe said so, recently, about the right thing."
|
|
20
|
+
// The observation-based methods (`http-challenge`, `dns`, `verifiable-presentation`,
|
|
21
|
+
// `transport-handshake`) are a THIRD PARTY's dial: verified here for binding + freshness + trusted
|
|
22
|
+
// observer and reported as `observed`. Do not read `observed` as "we re-checked it": it means "a
|
|
23
|
+
// party we trust to observe said so, recently, about the right thing."
|
|
18
24
|
//
|
|
19
|
-
// A caller
|
|
25
|
+
// A caller reads `assurance`, not just `ok` — and only `verifier-dialled` means this verifier
|
|
26
|
+
// established control itself.
|
|
20
27
|
import { canonicalizeJson } from '@agenticprimitives/types';
|
|
21
28
|
import { digestOf, signingDigest } from './canonicalization.js';
|
|
22
29
|
import { failure } from './errors.js';
|
|
30
|
+
/** The grades that count as endpoint control. `agent-asserted` is deliberately absent. */
|
|
31
|
+
export function isEndpointControl(a) {
|
|
32
|
+
return a === 'observed' || a === 'verifier-dialled';
|
|
33
|
+
}
|
|
23
34
|
const DEFAULT_MAX_OBSERVATION_AGE_MS = 24 * 60 * 60 * 1000;
|
|
24
35
|
/** CAIP-10 → address, for the signature read. */
|
|
25
36
|
function addressOf(id) {
|
|
@@ -54,13 +65,15 @@ function sameEndpoint(a, b) {
|
|
|
54
65
|
const nb = normalizeEndpointUri(b);
|
|
55
66
|
return na !== null && nb !== null && na === nb;
|
|
56
67
|
}
|
|
57
|
-
/** The digest an agent signs for `signed-challenge
|
|
68
|
+
/** The digest an agent signs for a `signed-challenge` ASSERTION. */
|
|
58
69
|
export async function endpointChallengeDigest(body) {
|
|
59
70
|
return signingDigest(await digestOf(JSON.parse(canonicalizeJson(body))));
|
|
60
71
|
}
|
|
61
72
|
/**
|
|
62
|
-
* Verify that the publisher controls the endpoint
|
|
63
|
-
* unverifiable evidence yields `ok: false
|
|
73
|
+
* Verify RECORDED evidence that the publisher controls the endpoint — a trusted observer's dial.
|
|
74
|
+
* Fail-closed: any missing, mis-bound, stale, or unverifiable evidence yields `ok: false`; an
|
|
75
|
+
* unrecognized method is a failure; and a `signed-challenge` (the agent's own assertion) is REFUSED.
|
|
76
|
+
* To establish control yourself, use `establishEndpointControl`.
|
|
64
77
|
*/
|
|
65
78
|
export async function verifyEndpointControl(proof, opts) {
|
|
66
79
|
const failures = [];
|
|
@@ -107,39 +120,9 @@ export async function verifyEndpointControl(proof, opts) {
|
|
|
107
120
|
}));
|
|
108
121
|
}
|
|
109
122
|
if (evidence.kind === 'signed-challenge') {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
if (b.surfaceId !== opts.surfaceId) {
|
|
115
|
-
return deny(failure('publication_endpoint_proof_missing', 'challenge binds a different surface'));
|
|
116
|
-
}
|
|
117
|
-
if (b.agentId !== opts.agentId) {
|
|
118
|
-
return deny(failure('publication_endpoint_proof_missing', 'challenge binds a different agent'));
|
|
119
|
-
}
|
|
120
|
-
// A short challenge is guessable, which would let anyone who can predict it forge control.
|
|
121
|
-
if (!b.challenge || b.challenge.length < 16) {
|
|
122
|
-
return deny(failure('publication_endpoint_proof_missing', 'challenge has insufficient entropy'));
|
|
123
|
-
}
|
|
124
|
-
const signer = addressOf(opts.agentId);
|
|
125
|
-
if (!signer) {
|
|
126
|
-
return deny(failure('publication_endpoint_proof_missing', 'agent id carries no verifiable address'));
|
|
127
|
-
}
|
|
128
|
-
let valid = false;
|
|
129
|
-
try {
|
|
130
|
-
valid = await opts.verifier.verifyHash({
|
|
131
|
-
address: signer,
|
|
132
|
-
hash: await endpointChallengeDigest(b),
|
|
133
|
-
signature: evidence.signature,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
catch {
|
|
137
|
-
valid = false;
|
|
138
|
-
}
|
|
139
|
-
if (!valid) {
|
|
140
|
-
return deny(failure('publication_endpoint_proof_missing', 'endpoint challenge signature did not verify'));
|
|
141
|
-
}
|
|
142
|
-
return { ok: true, assurance: 'cryptographic', failures: [] };
|
|
123
|
+
// NAME-5: the agent's own signature over a challenge it chose is an assertion. Nobody dialled
|
|
124
|
+
// the endpoint, so it is refused as control however well it verifies.
|
|
125
|
+
return deny(failure('publication_endpoint_proof_missing', 'a signed-challenge proof is the agent\'s own assertion, not endpoint control — dial the endpoint (establishEndpointControl) or present a trusted observation', { method: 'signed-challenge' }));
|
|
143
126
|
}
|
|
144
127
|
// ─── Observation-based methods ────────────────────────────────────────────
|
|
145
128
|
const trusted = opts.trustedObservers ?? [];
|
|
@@ -171,4 +154,185 @@ export async function verifyEndpointControl(proof, opts) {
|
|
|
171
154
|
}
|
|
172
155
|
return { ok: true, assurance: 'observed', failures: [] };
|
|
173
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Check an agent's ASSERTION that `uri`/`surfaceId` is its own (`signed-challenge` evidence).
|
|
159
|
+
*
|
|
160
|
+
* NOT endpoint control. The result type has no `ok`; `control` is the literal `false`. Useful only
|
|
161
|
+
* to say "the agent did sign this claim" — which the publication signature already says.
|
|
162
|
+
*/
|
|
163
|
+
export async function verifyEndpointAssertion(evidence, opts) {
|
|
164
|
+
const no = (message) => ({
|
|
165
|
+
kind: 'endpoint-assertion',
|
|
166
|
+
asserted: false,
|
|
167
|
+
control: false,
|
|
168
|
+
failures: [failure('publication_endpoint_proof_missing', message)],
|
|
169
|
+
});
|
|
170
|
+
const b = evidence?.body;
|
|
171
|
+
if (!evidence || evidence.kind !== 'signed-challenge' || !b)
|
|
172
|
+
return no('not a signed-challenge assertion');
|
|
173
|
+
if (!sameEndpoint(b.uri, opts.uri))
|
|
174
|
+
return no('assertion binds a different uri');
|
|
175
|
+
if (b.surfaceId !== opts.surfaceId)
|
|
176
|
+
return no('assertion binds a different surface');
|
|
177
|
+
if (b.agentId !== opts.agentId)
|
|
178
|
+
return no('assertion binds a different agent');
|
|
179
|
+
const signer = addressOf(opts.agentId);
|
|
180
|
+
if (!signer)
|
|
181
|
+
return no('agent id carries no verifiable address');
|
|
182
|
+
let valid = false;
|
|
183
|
+
try {
|
|
184
|
+
valid = await opts.verifier.verifyHash({
|
|
185
|
+
address: signer,
|
|
186
|
+
hash: await endpointChallengeDigest(b),
|
|
187
|
+
signature: evidence.signature,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
valid = false;
|
|
192
|
+
}
|
|
193
|
+
if (!valid)
|
|
194
|
+
return no('assertion signature did not verify');
|
|
195
|
+
return { kind: 'endpoint-assertion', asserted: true, control: false, failures: [] };
|
|
196
|
+
}
|
|
197
|
+
// ─── Verifier-dialled endpoint control (NAME-5) ──────────────────────────────
|
|
198
|
+
export const ENDPOINT_CONTROL_CHALLENGE_TYPE = 'ap.endpoint-control-challenge/1';
|
|
199
|
+
/** Minimum nonce entropy. 16 bytes = 128 bits; we generate 32. */
|
|
200
|
+
const MIN_NONCE_BYTES = 16;
|
|
201
|
+
const NONCE_BYTES = 32;
|
|
202
|
+
const DEFAULT_CHALLENGE_TTL_MS = 5 * 60 * 1000;
|
|
203
|
+
const MAX_CHALLENGE_TTL_MS = 60 * 60 * 1000;
|
|
204
|
+
function hexOf(bytes) {
|
|
205
|
+
let out = '0x';
|
|
206
|
+
for (const b of bytes)
|
|
207
|
+
out += b.toString(16).padStart(2, '0');
|
|
208
|
+
return out;
|
|
209
|
+
}
|
|
210
|
+
function isNonce(v) {
|
|
211
|
+
return typeof v === 'string' && /^0x[0-9a-f]+$/.test(v) && v.length >= 2 + MIN_NONCE_BYTES * 2;
|
|
212
|
+
}
|
|
213
|
+
/** The canonical body, field by field — never the object as served. */
|
|
214
|
+
function challengeBody(c) {
|
|
215
|
+
return {
|
|
216
|
+
type: c.type,
|
|
217
|
+
nonce: c.nonce,
|
|
218
|
+
uri: c.uri,
|
|
219
|
+
surfaceId: c.surfaceId,
|
|
220
|
+
agentId: c.agentId,
|
|
221
|
+
issuedAt: c.issuedAt,
|
|
222
|
+
expiresAt: c.expiresAt,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/** The digest the agent behind the endpoint signs for a verifier's challenge. */
|
|
226
|
+
export async function endpointControlChallengeDigest(c) {
|
|
227
|
+
return signingDigest(await digestOf(JSON.parse(canonicalizeJson(challengeBody(c)))));
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Establish endpoint control: generate a nonce, single-use it, dial the endpoint, and verify that
|
|
231
|
+
* the endpoint served the agent's signature over THIS challenge.
|
|
232
|
+
*
|
|
233
|
+
* The nonce is generated HERE and cannot be supplied — a challenge the agent chose is the finding.
|
|
234
|
+
* Fail-closed at every step: no WebCrypto, a ledger that refuses or throws, an endpoint that does
|
|
235
|
+
* not answer, a response from another endpoint, a nonce not echoed, a body that differs in any
|
|
236
|
+
* field, an expired challenge, or a signature that does not verify — all `ok: false`.
|
|
237
|
+
*/
|
|
238
|
+
export async function establishEndpointControl(opts) {
|
|
239
|
+
const deny = (f) => ({ ok: false, assurance: 'none', failures: [f] });
|
|
240
|
+
const missing = (m, d) => deny(failure('publication_endpoint_proof_missing', m, d));
|
|
241
|
+
if (typeof opts?.dial !== 'function')
|
|
242
|
+
return missing('no dial port — an endpoint nobody dialled is not controlled');
|
|
243
|
+
if (typeof opts?.nonces?.consume !== 'function')
|
|
244
|
+
return missing('no nonce ledger — a challenge that can be reused proves nothing');
|
|
245
|
+
if (typeof opts?.verifier?.verifyHash !== 'function')
|
|
246
|
+
return missing('no signature verifier');
|
|
247
|
+
if (typeof opts?.now !== 'function')
|
|
248
|
+
return deny(failure('malformed', '`now` must be an injected clock'));
|
|
249
|
+
const normalized = normalizeEndpointUri(opts.uri);
|
|
250
|
+
if (normalized === null)
|
|
251
|
+
return missing('surface uri is not a normalizable endpoint', { surfaceId: opts.surfaceId });
|
|
252
|
+
const signer = addressOf(opts.agentId);
|
|
253
|
+
if (!signer)
|
|
254
|
+
return missing('agent id carries no verifiable address');
|
|
255
|
+
const issuedAt = opts.now();
|
|
256
|
+
const issuedMs = Date.parse(issuedAt);
|
|
257
|
+
if (typeof issuedAt !== 'string' || Number.isNaN(issuedMs))
|
|
258
|
+
return deny(failure('malformed', '`now()` must return ISO-8601'));
|
|
259
|
+
const ttl = opts.ttlMs ?? DEFAULT_CHALLENGE_TTL_MS;
|
|
260
|
+
if (!Number.isFinite(ttl) || ttl <= 0 || ttl > MAX_CHALLENGE_TTL_MS)
|
|
261
|
+
return deny(failure('malformed', 'challenge ttl must be in (0, 1h]'));
|
|
262
|
+
const webcrypto = globalThis.crypto;
|
|
263
|
+
if (typeof webcrypto?.getRandomValues !== 'function')
|
|
264
|
+
return missing('WebCrypto is unavailable — no verifier nonce can be generated');
|
|
265
|
+
const nonce = hexOf(webcrypto.getRandomValues(new Uint8Array(NONCE_BYTES)));
|
|
266
|
+
const challenge = {
|
|
267
|
+
type: ENDPOINT_CONTROL_CHALLENGE_TYPE,
|
|
268
|
+
nonce,
|
|
269
|
+
uri: opts.uri,
|
|
270
|
+
surfaceId: opts.surfaceId,
|
|
271
|
+
agentId: opts.agentId,
|
|
272
|
+
issuedAt,
|
|
273
|
+
expiresAt: new Date(issuedMs + ttl).toISOString(),
|
|
274
|
+
};
|
|
275
|
+
// Single-use BEFORE the dial: a nonce the ledger has seen (or cannot record) is never sent.
|
|
276
|
+
let first = false;
|
|
277
|
+
try {
|
|
278
|
+
first = (await opts.nonces.consume(nonce, challenge.expiresAt)) === true;
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
first = false;
|
|
282
|
+
}
|
|
283
|
+
if (!first)
|
|
284
|
+
return deny(failure('endpoint_challenge_replayed', 'verifier nonce was already used or could not be recorded'));
|
|
285
|
+
let dialled;
|
|
286
|
+
try {
|
|
287
|
+
dialled = await opts.dial({ uri: opts.uri, challenge });
|
|
288
|
+
}
|
|
289
|
+
catch {
|
|
290
|
+
dialled = null; // a dial that errored reached nobody (ADR-0013)
|
|
291
|
+
}
|
|
292
|
+
if (!dialled || typeof dialled !== 'object')
|
|
293
|
+
return missing('the endpoint did not answer the dial');
|
|
294
|
+
// The response must have been served BY the endpoint we challenged.
|
|
295
|
+
if (typeof dialled.servedFrom !== 'string' || !sameEndpoint(dialled.servedFrom, opts.uri)) {
|
|
296
|
+
return missing('the response was served from a different endpoint', { servedFrom: String(dialled.servedFrom) });
|
|
297
|
+
}
|
|
298
|
+
const r = dialled.response;
|
|
299
|
+
const echoed = r && typeof r === 'object' ? r.challenge : undefined;
|
|
300
|
+
if (!echoed || typeof echoed !== 'object' || typeof r.signature !== 'string' || !/^0x[0-9a-fA-F]*$/.test(r.signature)) {
|
|
301
|
+
return missing('the endpoint served no well-formed challenge response');
|
|
302
|
+
}
|
|
303
|
+
if (!isNonce(echoed.nonce) || echoed.nonce !== nonce) {
|
|
304
|
+
return deny(failure('endpoint_challenge_replayed', 'the response does not echo the verifier-chosen nonce'));
|
|
305
|
+
}
|
|
306
|
+
if (echoed.type !== ENDPOINT_CONTROL_CHALLENGE_TYPE ||
|
|
307
|
+
echoed.uri !== challenge.uri ||
|
|
308
|
+
echoed.surfaceId !== challenge.surfaceId ||
|
|
309
|
+
echoed.agentId !== challenge.agentId ||
|
|
310
|
+
echoed.issuedAt !== challenge.issuedAt ||
|
|
311
|
+
echoed.expiresAt !== challenge.expiresAt) {
|
|
312
|
+
return missing('the response binds a different uri, surface, agent or expiry than the challenge');
|
|
313
|
+
}
|
|
314
|
+
// Expiry on the clock AFTER the dial — a slow or held response does not outlive its challenge.
|
|
315
|
+
const dialledAt = opts.now();
|
|
316
|
+
const dialledMs = Date.parse(dialledAt);
|
|
317
|
+
if (typeof dialledAt !== 'string' || Number.isNaN(dialledMs))
|
|
318
|
+
return deny(failure('malformed', '`now()` must return ISO-8601'));
|
|
319
|
+
if (dialledMs < issuedMs || dialledMs >= Date.parse(challenge.expiresAt)) {
|
|
320
|
+
return deny(failure('publication_endpoint_proof_expired', 'the challenge expired before the endpoint answered'));
|
|
321
|
+
}
|
|
322
|
+
// The signature is over OUR challenge (recomputed from our own fields, not the echoed object).
|
|
323
|
+
let valid = false;
|
|
324
|
+
try {
|
|
325
|
+
valid = await opts.verifier.verifyHash({
|
|
326
|
+
address: signer,
|
|
327
|
+
hash: await endpointControlChallengeDigest(challenge),
|
|
328
|
+
signature: r.signature,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
valid = false;
|
|
333
|
+
}
|
|
334
|
+
if (!valid)
|
|
335
|
+
return missing('the endpoint did not serve the agent\'s signature over the verifier\'s challenge');
|
|
336
|
+
return { ok: true, assurance: 'verifier-dialled', challenge, servedFrom: dialled.servedFrom, dialledAt, failures: [] };
|
|
337
|
+
}
|
|
174
338
|
//# sourceMappingURL=endpoint-control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-control.js","sourceRoot":"","sources":["../src/endpoint-control.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,sGAAsG;AACtG,qGAAqG;AACrG,kEAAkE;AAClE,EAAE;AACF,0DAA0D;AAC1D,sGAAsG;AACtG,qGAAqG;AACrG,2EAA2E;AAC3E,EAAE;AACF,gGAAgG;AAChG,iGAAiG;AACjG,oGAAoG;AACpG,8FAA8F;AAC9F,iGAAiG;AACjG,uDAAuD;AACvD,EAAE;AACF,mGAAmG;AAEnG,OAAO,EAAE,gBAAgB,EAAyB,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,OAAO,EAA0B,MAAM,aAAa,CAAC;AA6E9D,MAAM,8BAA8B,GAAG,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0B;SACzC,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,KAAK,GAAG,KAAK,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC,kFAAkF,CAAC,CAAC;IAE/G,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AACzH,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
/** Precise, local-only reason code. Never send this to an unauthenticated remote party. */
|
|
2
2
|
export type ResolutionErrorCode = 'publication_signature_invalid' | 'publication_digest_mismatch'
|
|
3
3
|
/** The post-resolve peer gate refused: whoever answered is not provably the agent we resolved. */
|
|
4
|
-
| 'peer_gate_refused' | 'publication_agent_mismatch' | 'publication_publisher_unauthorized' | 'publication_not_yet_valid' | 'publication_expired' | 'publication_status_not_active' | 'publication_sequence_rollback' | 'publication_equivocation' | 'publication_continuity_broken'
|
|
4
|
+
| 'peer_gate_refused' | 'publication_agent_mismatch' | 'publication_publisher_unauthorized' | 'publication_not_yet_valid' | 'publication_expired' | 'publication_status_not_active' | 'publication_sequence_rollback' | 'publication_equivocation' | 'publication_continuity_broken'
|
|
5
|
+
/** NAME-3: the publication is by a publisher a `compromised` tombstone for this agent named. */
|
|
6
|
+
| 'publication_publisher_tombstoned'
|
|
7
|
+
/**
|
|
8
|
+
* NAME-3: the publication is on a different channel than the one this verifier is entitled to read
|
|
9
|
+
* (or the verifier stated none). Decided before sequence is looked at.
|
|
10
|
+
*/
|
|
11
|
+
| 'publication_channel_mismatch'
|
|
12
|
+
/** NAME-3: the publication's agent-wide `keyEpoch` is below the highest this verifier has seen. */
|
|
13
|
+
| 'publication_key_epoch_retired'
|
|
14
|
+
/** NAME-3: a retired publication FORMAT (`specVersion`). Refused by name; nothing else is evaluated. */
|
|
15
|
+
| 'publication_format_unsupported'
|
|
16
|
+
/** NAME-3: verified with NO continuity state — a rollback could not have been detected. */
|
|
17
|
+
| 'publication_continuity_unanchored'
|
|
18
|
+
/** NAME-5: the verifier's endpoint-control nonce was already used, or was not echoed. */
|
|
19
|
+
| 'endpoint_challenge_replayed' | 'publication_endpoint_proof_missing' | 'publication_endpoint_proof_expired' | 'publication_transport_key_invalid' | 'publication_surface_exposure_violation' | 'grant_unknown' | 'grant_expired' | 'grant_not_yet_valid' | 'grant_revoked' | 'grant_subject_mismatch' | 'grant_proof_of_possession_failed' | 'grant_audience_mismatch' | 'grant_target_mismatch' | 'grant_action_not_permitted' | 'grant_resolution_budget_exhausted' | 'grant_challenge_replayed'
|
|
5
20
|
/** A STORED grant violates its own invariants. Distinct from `malformed`: this is only decidable
|
|
6
21
|
* AFTER a lookup, so it must deny uniformly or it becomes a grant-existence oracle. */
|
|
7
22
|
| 'grant_shape_invalid' | 'invitation_signature_invalid' | 'invitation_expired' | 'invitation_binding_mismatch' | 'policy_resolution_disabled' | 'projection_not_permitted' | 'reference_unsupported' | 'malformed';
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAYA,2FAA2F;AAC3F,MAAM,MAAM,mBAAmB,GAE3B,+BAA+B,GAC/B,6BAA6B;AAC/B,kGAAkG;GAChG,mBAAmB,GACnB,4BAA4B,GAC5B,oCAAoC,GACpC,2BAA2B,GAC3B,qBAAqB,GACrB,+BAA+B,GAC/B,+BAA+B,GAC/B,0BAA0B,GAC1B,+BAA+B,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAYA,2FAA2F;AAC3F,MAAM,MAAM,mBAAmB,GAE3B,+BAA+B,GAC/B,6BAA6B;AAC/B,kGAAkG;GAChG,mBAAmB,GACnB,4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,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,wBAAgB,OAAO,CACrB,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,iBAAiB,CAEnB"}
|
package/dist/errors.js
CHANGED
|
@@ -23,6 +23,12 @@ const WIRE = {
|
|
|
23
23
|
publication_sequence_rollback: 'publication_invalid',
|
|
24
24
|
publication_equivocation: 'publication_conflict',
|
|
25
25
|
publication_continuity_broken: 'publication_invalid',
|
|
26
|
+
publication_publisher_tombstoned: 'publication_invalid',
|
|
27
|
+
publication_channel_mismatch: 'publication_invalid',
|
|
28
|
+
publication_key_epoch_retired: 'publication_invalid',
|
|
29
|
+
publication_format_unsupported: 'publication_invalid',
|
|
30
|
+
publication_continuity_unanchored: 'publication_invalid',
|
|
31
|
+
endpoint_challenge_replayed: 'publication_invalid',
|
|
26
32
|
publication_endpoint_proof_missing: 'publication_invalid',
|
|
27
33
|
publication_endpoint_proof_expired: 'publication_invalid',
|
|
28
34
|
publication_transport_key_invalid: 'publication_invalid',
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,EAAE;AACF,uDAAuD;AACvD,EAAE;AACF,kGAAkG;AAClG,2FAA2F;AAC3F,sGAAsG;AACtG,kFAAkF;AAClF,EAAE;AACF,8FAA8F;AAC9F,6EAA6E;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,EAAE;AACF,uDAAuD;AACvD,EAAE;AACF,kGAAkG;A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