@agentidentitytrustprotocol/aitp 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -10
- package/index.d.ts +120 -50
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -70,11 +70,16 @@ const hello = sess.buildHello(respManifest, ['demo.write']);
|
|
|
70
70
|
const { ackJson: helloAck, sessionId } = rsess.processHello(hello);
|
|
71
71
|
const commit = sess.processHelloAck(helloAck, sessionId);
|
|
72
72
|
const { ackJson: commitAck } = rsess.processCommit(commit);
|
|
73
|
-
const
|
|
73
|
+
const completed = sess.complete(commitAck);
|
|
74
|
+
// completed = { tct, claims, grantVoucher? }
|
|
75
|
+
// `tct` is an opaque compact-JWS string; `claims` is the decoded TCT.
|
|
74
76
|
|
|
75
77
|
// Each peer now holds a TCT the other issued it.
|
|
76
|
-
const ident = initiator.verifyTct(
|
|
78
|
+
const ident = initiator.verifyTct(completed.tct, 'demo.write');
|
|
77
79
|
console.log(ident.peerAid, ident.grants);
|
|
80
|
+
|
|
81
|
+
// `completed.grantVoucher` (when present) is what you pass to
|
|
82
|
+
// `buildDelegation(grantVoucher, delegateeAid, scope)` to delegate.
|
|
78
83
|
```
|
|
79
84
|
|
|
80
85
|
In a real deployment each message moves over HTTP: `buildHello` returns the
|
|
@@ -84,24 +89,46 @@ plus the value for the `X-Aitp-Session-Id` header, and so on.
|
|
|
84
89
|
## API
|
|
85
90
|
|
|
86
91
|
The full public surface is described in the generated `index.d.ts`; below
|
|
87
|
-
is a summary.
|
|
92
|
+
is a summary. Manifests, revocation lists, and handshake envelopes cross
|
|
93
|
+
the boundary as JSON strings; **TCTs, grant vouchers, and delegations are
|
|
94
|
+
opaque compact-JWS token strings** (`header.payload.signature`).
|
|
88
95
|
|
|
89
96
|
| Type | Default? | Notes |
|
|
90
97
|
|---------------------------|:--------:|----------------------------------------------------------------------------------------------------------------|
|
|
91
|
-
| `AitpAgent` | ✅ | `generate(opts?)` / `fromSeed(buffer, opts?)` (`opts.suite = "ed25519" \| "p256"`), `aid`, `buildManifest(opts)`, `newSession(jwks?, opts?)`, `newResponder(jwks?, opts?)`, `verifyTct(
|
|
92
|
-
| `InitiatorSession` | ✅ | `buildHello(peerManifest, grants, oidcMintJwt?)`, `processHelloAck(...)`, `complete(...)`
|
|
93
|
-
| `ResponderSession` | ✅ | `processHello(hello, oidcMintJwt?)` → `{ ackJson, sessionId }`, `processCommit(commit)` → `{ ackJson,
|
|
94
|
-
| `TctIdentity` | ✅ | `peerAid
|
|
95
|
-
| `DelegationVerified` | ✅ | `delegator`, `delegatee`, `issuedBy`, `grants`, `expiresAt`, `
|
|
98
|
+
| `AitpAgent` | ✅ | `generate(opts?)` / `fromSeed(buffer, opts?)` (`opts.suite = "ed25519" \| "p256"`), `aid`, `buildManifest(opts)`, `newSession(jwks?, opts?)`, `newResponder(jwks?, opts?)`, `verifyTct(token, grant, expectedAudience?, revokedJtis?)`, `buildDelegation(voucherToken, delegateeAid, scope, ttlSecs?)`, `issueTctForDelegatee(...)`, `signRevocationList(...)` |
|
|
99
|
+
| `InitiatorSession` | ✅ | `buildHello(peerManifest, grants, oidcMintJwt?)`, `processHelloAck(...)`, `complete(...)` → `{ tct, claims, grantVoucher? }` |
|
|
100
|
+
| `ResponderSession` | ✅ | `processHello(hello, oidcMintJwt?)` → `{ ackJson, sessionId }`, `processCommit(commit)` → `{ ackJson, completed: { tct, claims, grantVoucher? } }` |
|
|
101
|
+
| `TctIdentity` | ✅ | `peerAid` (issuer), `grants`, `expiresAt`, `jti` |
|
|
102
|
+
| `DelegationVerified` | ✅ | `delegator`, `delegatee`, `issuedBy`, `grants`, `expiresAt`, `cnfJkt` |
|
|
96
103
|
| `JwksProvider` | ✅ | OIDC JWKS map. `upsert(issuer, keys)`, `remove(issuer)`, `issuers()` |
|
|
97
|
-
| `TctStore` / `verifyTctCached()` | ✅ | Hot-path verify cache: skips the signature check for a byte-identical, still-valid TCT (keyed by SHA-256 of the
|
|
98
|
-
| `verifyDelegation()` | ✅ | RFC-AITP-0006 — strict
|
|
104
|
+
| `TctStore` / `verifyTctCached()` | ✅ | Hot-path verify cache: skips the signature check for a byte-identical, still-valid TCT (keyed by SHA-256 of the token bytes) |
|
|
105
|
+
| `verifyDelegation()` | ✅ | RFC-AITP-0006 — strict single-hop; rejects any multi-hop `chain` |
|
|
99
106
|
| `verifyManifestJson()` | ✅ | Control-plane manifest enrollment |
|
|
100
107
|
| `buildRenewalRequest()` / `processRenewalRequest()` | `experimental-renewal` | RFC-AITP-0005 §10 |
|
|
101
108
|
| `SessionBundleBuilder`, `verifySessionBundle()` | `experimental-bundle` | RFC-AITP-0010 |
|
|
102
109
|
| `computeSpkiHash()`, `SpkiPinVerifier` | `experimental-pinning` | HPKP outbound pinning |
|
|
103
110
|
| `verifyDelegationExperimentalMultihop()` | `experimental-multihop-delegation` | RFC-AITP-0011 (draft) multi-hop opt-in |
|
|
104
111
|
|
|
112
|
+
### Revocation
|
|
113
|
+
|
|
114
|
+
`verifyTct` / `verifyTctCached` accept an optional final `revokedJtis`
|
|
115
|
+
argument — an array of revoked TCT `jti` strings. Any TCT whose `jti` is in
|
|
116
|
+
the array is rejected even if its signature, audience, and expiry are
|
|
117
|
+
otherwise valid:
|
|
118
|
+
|
|
119
|
+
```javascript
|
|
120
|
+
const revoked = ['11111111-2222-3333-4444-555555555555'];
|
|
121
|
+
agent.verifyTct(tctToken, 'demo.write', null, revoked); // throws if revoked
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Obligation.** The SDK does **not** fetch or maintain the revoked set for
|
|
125
|
+
you; supplying it is the caller's responsibility. Source it from a
|
|
126
|
+
`RevocationList` you fetched and verified out-of-band (issue one with
|
|
127
|
+
`signRevocationList`). The set is passed up-front (rather than via a JS
|
|
128
|
+
callback invoked per-`jti`) to stay sound under napi threading constraints.
|
|
129
|
+
Omitting the argument leaves the revocation gate **off** — an unexpired but
|
|
130
|
+
revoked TCT will pass, so wire `revokedJtis` in wherever revocation matters.
|
|
131
|
+
|
|
105
132
|
### OIDC identity (RFC-AITP-0002)
|
|
106
133
|
|
|
107
134
|
```javascript
|
package/index.d.ts
CHANGED
|
@@ -85,36 +85,41 @@ export interface JsBundleOutcome {
|
|
|
85
85
|
*/
|
|
86
86
|
export declare function verifySessionBundle(bundleEnvelopeJson: string, verifierAid: string, nowUnixSecs?: number | undefined | null, revocationCheck?: (...args: any[]) => any | undefined | null): JsBundleOutcome
|
|
87
87
|
/**
|
|
88
|
-
* The verified delegation
|
|
88
|
+
* The verified delegation's salient fields. Returned from
|
|
89
89
|
* `verifyDelegation` and consumed by `AitpAgent.issueTctForDelegatee`.
|
|
90
90
|
*/
|
|
91
91
|
export interface JsDelegationVerified {
|
|
92
92
|
/**
|
|
93
|
-
* AID of the ultimate grantor (the original TCT issuer that gave
|
|
94
|
-
* to `issuedBy`).
|
|
95
|
-
*
|
|
93
|
+
* AID of the ultimate grantor (the original TCT issuer that gave
|
|
94
|
+
* grants to `issuedBy`). Equal to the delegation's `aud` and to the
|
|
95
|
+
* embedded voucher's `iss`. The responder side checks this matches
|
|
96
|
+
* its own AID before redeeming.
|
|
96
97
|
*/
|
|
97
98
|
delegator: string
|
|
98
|
-
/** AID of the recipient (C) — who will receive a fresh TCT. */
|
|
99
|
+
/** AID of the recipient (C) — who will receive a fresh TCT (`sub`). */
|
|
99
100
|
delegatee: string
|
|
100
|
-
/** AID of the agent that issued this delegation (B in the RFC). */
|
|
101
|
+
/** AID of the agent that issued this delegation (B in the RFC) (`iss`). */
|
|
101
102
|
issuedBy: string
|
|
102
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* Capabilities being delegated (`scope`). Always a subset of the
|
|
105
|
+
* root voucher's grants.
|
|
106
|
+
*/
|
|
103
107
|
grants: Array<string>
|
|
104
|
-
/** Unix-seconds expiry of the delegation token itself. */
|
|
108
|
+
/** Unix-seconds expiry of the delegation token itself (`exp`). */
|
|
105
109
|
expiresAt: number
|
|
106
110
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* fresh TCT
|
|
111
|
+
* RFC 7638 JWK thumbprint of the delegatee's key (`cnf.jkt`). In
|
|
112
|
+
* v0.2 this is derived from — and must match — the key encoded in
|
|
113
|
+
* `delegatee`'s AID; the fresh TCT's key binding is taken from the
|
|
114
|
+
* AID, not from this field.
|
|
110
115
|
*/
|
|
111
|
-
|
|
116
|
+
cnfJkt: string
|
|
112
117
|
}
|
|
113
118
|
/**
|
|
114
|
-
* Verify a
|
|
119
|
+
* Verify a delegation compact JWS under **strict AITP v0.2**
|
|
115
120
|
* (RFC-AITP-0006 single-hop). `verifierAid` is the verifier's own AID
|
|
116
|
-
* string —
|
|
117
|
-
*
|
|
121
|
+
* string — it MUST equal the delegation's `aud` (the root grantor), and
|
|
122
|
+
* the embedded voucher MUST verify under the verifier's own key.
|
|
118
123
|
*
|
|
119
124
|
* Any token carrying a non-empty `chain` (a draft RFC-AITP-0011 multi-hop
|
|
120
125
|
* delegation) is **rejected** with `DELEGATION_MULTIHOP_NOT_SUPPORTED`,
|
|
@@ -122,20 +127,21 @@ export interface JsDelegationVerified {
|
|
|
122
127
|
* the `experimental-multihop-delegation` feature and call
|
|
123
128
|
* `verifyDelegationExperimentalMultihop`.
|
|
124
129
|
*/
|
|
125
|
-
export declare function verifyDelegation(
|
|
130
|
+
export declare function verifyDelegation(token: string, verifierAid: string): JsDelegationVerified
|
|
126
131
|
/**
|
|
127
|
-
* Verify a
|
|
132
|
+
* Verify a delegation compact JWS allowing **draft RFC-AITP-0011
|
|
128
133
|
* multi-hop** chains up to `maxHops` total hops (`chain.length + 1`).
|
|
129
134
|
*
|
|
130
|
-
* This opts into behavior that is **not** part of
|
|
131
|
-
* compiled in under the
|
|
132
|
-
* default build exposes
|
|
135
|
+
* This opts into behavior that is **not** part of the v0.2 strict
|
|
136
|
+
* default. It is only compiled in under the
|
|
137
|
+
* `experimental-multihop-delegation` feature; a default build exposes
|
|
138
|
+
* only the strict `verifyDelegation`.
|
|
133
139
|
*
|
|
134
140
|
* `maxHops` defaults to `DEFAULT_MAX_HOPS` (3, the RFC-AITP-0011 §2
|
|
135
141
|
* recommended ceiling). Pass a smaller value for a tighter bound;
|
|
136
|
-
* `maxHops = 0` reverts to strict
|
|
142
|
+
* `maxHops = 0` reverts to strict single-hop (rejects any non-empty chain).
|
|
137
143
|
*/
|
|
138
|
-
export declare function verifyDelegationExperimentalMultihop(
|
|
144
|
+
export declare function verifyDelegationExperimentalMultihop(token: string, verifierAid: string, maxHops?: number | undefined | null): JsDelegationVerified
|
|
139
145
|
/**
|
|
140
146
|
* Compute the RFC 7638 JWK thumbprint of the public key embedded in
|
|
141
147
|
* an AID — the value an OIDC IdP MUST place in the JWT's `cnf.jkt`
|
|
@@ -160,20 +166,64 @@ export interface JsHelloAckResult {
|
|
|
160
166
|
/** Correlation id — set as the `X-Aitp-Session-Id` response header. */
|
|
161
167
|
sessionId: string
|
|
162
168
|
}
|
|
163
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* The salient claims of a TCT obtained at handshake completion. Mirrors
|
|
171
|
+
* `aitp_tct::TctClaims`; timestamps are Unix seconds as JS `number`s.
|
|
172
|
+
*/
|
|
173
|
+
export interface JsHandshakeTctClaims {
|
|
174
|
+
/** Issuer AID (`iss`) — the peer that minted and is bound by the TCT. */
|
|
175
|
+
iss: string
|
|
176
|
+
/** Subject AID (`sub`) — the holder the TCT authorizes. */
|
|
177
|
+
sub: string
|
|
178
|
+
/** Audience AID (`aud`). In v0.2 this equals `sub`. */
|
|
179
|
+
aud: string
|
|
180
|
+
/** Capability grants the TCT authorizes. */
|
|
181
|
+
grants: Array<string>
|
|
182
|
+
/** Issued-at, Unix seconds (`iat`). */
|
|
183
|
+
iat: number
|
|
184
|
+
/** Expiry, Unix seconds (`exp`). */
|
|
185
|
+
exp: number
|
|
186
|
+
/** TCT unique identifier (`jti`, UUID string). */
|
|
187
|
+
jti: string
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* A completed handshake: the TCT the peer issued to us (as an opaque
|
|
191
|
+
* compact-JWS token plus its decoded claims) and the optional companion
|
|
192
|
+
* grant voucher (`typ: aitp-grant+jwt`) used to mint delegations
|
|
193
|
+
* (RFC-AITP-0005 §8). `grantVoucher` is `null` when the issuing peer's
|
|
194
|
+
* policy forbids us from delegating.
|
|
195
|
+
*/
|
|
196
|
+
export interface JsCompletedHandshake {
|
|
197
|
+
/**
|
|
198
|
+
* The TCT as an opaque compact-JWS string. Pass verbatim to
|
|
199
|
+
* `verifyTct` / `verifyTctCached`.
|
|
200
|
+
*/
|
|
201
|
+
tct: string
|
|
202
|
+
/** The decoded (already-verified) TCT claims. */
|
|
203
|
+
claims: JsHandshakeTctClaims
|
|
204
|
+
/**
|
|
205
|
+
* The companion grant voucher (compact JWS), or `null`. Pass to
|
|
206
|
+
* `buildDelegation` to delegate the held grants.
|
|
207
|
+
*/
|
|
208
|
+
grantVoucher?: string
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Result of `processCommit`: response body plus the completed handshake
|
|
212
|
+
* (held TCT token, its claims, and the optional grant voucher).
|
|
213
|
+
*/
|
|
164
214
|
export interface JsCommitAckResult {
|
|
165
215
|
/** `MUTUAL_COMMIT_ACK` envelope JSON — set as the HTTP response body. */
|
|
166
216
|
ackJson: string
|
|
167
|
-
/**
|
|
168
|
-
|
|
217
|
+
/** The TCT (and voucher) the initiator issued to us. */
|
|
218
|
+
completed: JsCompletedHandshake
|
|
169
219
|
}
|
|
170
220
|
/** The verified peer identity carried by a TCT. */
|
|
171
221
|
export interface JsTctIdentity {
|
|
172
|
-
/** AID of the agent that issued (and is bound by) the TCT. */
|
|
222
|
+
/** AID of the agent that issued (and is bound by) the TCT (`iss`). */
|
|
173
223
|
peerAid: string
|
|
174
224
|
/** Capability grants the TCT authorizes. */
|
|
175
225
|
grants: Array<string>
|
|
176
|
-
/** Expiry, Unix seconds. */
|
|
226
|
+
/** Expiry, Unix seconds (`exp`). */
|
|
177
227
|
expiresAt: number
|
|
178
228
|
/** TCT unique identifier (`jti`). */
|
|
179
229
|
jti: string
|
|
@@ -235,30 +285,44 @@ export declare class AitpAgent {
|
|
|
235
285
|
*/
|
|
236
286
|
newResponder(jwks?: JwksProvider | undefined | null, opts?: SessionOpts | undefined | null): JsResponderSession
|
|
237
287
|
/**
|
|
238
|
-
* Verify a TCT
|
|
239
|
-
* an invalid, mis-audienced, expired, or
|
|
288
|
+
* Verify a compact-JWS TCT token and require `requiredGrant`.
|
|
289
|
+
* Rejects on an invalid, mis-audienced, expired, revoked, or
|
|
290
|
+
* under-scoped TCT.
|
|
240
291
|
*
|
|
241
292
|
* `expectedAudience` defaults to `null`, which means "verify as the
|
|
242
293
|
* holder" (RFC-AITP-0005 §9 receipt model — `this.aid` is used).
|
|
243
294
|
* Resource servers verifying a TCT presented by a peer should pass
|
|
244
|
-
* the TCT's own `
|
|
245
|
-
* equals `
|
|
295
|
+
* the TCT's own `aud` claim as `expectedAudience` (in v0.2 this
|
|
296
|
+
* equals `sub`).
|
|
297
|
+
*
|
|
298
|
+
* `revokedJtis` (F-1) is an optional list of revoked TCT `jti`
|
|
299
|
+
* strings; any TCT whose `jti` is in the list is rejected even if
|
|
300
|
+
* otherwise valid. Omit (or pass `null`) to disable the revocation
|
|
301
|
+
* gate. The caller is responsible for sourcing the revoked set (e.g.
|
|
302
|
+
* from a `RevocationList` it fetched and verified).
|
|
246
303
|
*/
|
|
247
|
-
verifyTct(
|
|
304
|
+
verifyTct(tctToken: string, requiredGrant: string, expectedAudience?: string | undefined | null, revokedJtis?: Array<string> | undefined | null): JsTctIdentity
|
|
248
305
|
/**
|
|
249
306
|
* Like `verifyTct`, but consults a `TctStore` first: a byte-identical,
|
|
250
307
|
* already-verified, still-valid TCT skips the signature check (the
|
|
251
308
|
* verification hot path for an agent that sees the same TCT on many
|
|
252
|
-
* requests). All cheap policy checks (expiry, audience, required grant
|
|
253
|
-
* still run on every call; only the
|
|
309
|
+
* requests). All cheap policy checks (expiry, audience, required grant,
|
|
310
|
+
* and the optional `revokedJtis` gate) still run on every call; only the
|
|
311
|
+
* signature check is elided.
|
|
312
|
+
*/
|
|
313
|
+
verifyTctCached(tctToken: string, requiredGrant: string, store: JsTctStore, expectedAudience?: string | undefined | null, revokedJtis?: Array<string> | undefined | null): JsTctIdentity
|
|
314
|
+
/**
|
|
315
|
+
* Build a delegation compact-JWS token from a held **grant voucher**
|
|
316
|
+
* (RFC-AITP-0006). `voucherToken` is the `grantVoucher` surfaced by
|
|
317
|
+
* `complete()` / `processCommit()`. The delegatee's key binding is
|
|
318
|
+
* derived from `delegateeAid` itself, so no separate public-key
|
|
319
|
+
* argument is needed in v0.2.
|
|
254
320
|
*/
|
|
255
|
-
|
|
256
|
-
/** Build a `DelegationEnvelope` JSON from a held TCT (RFC-AITP-0006). */
|
|
257
|
-
buildDelegation(heldTctEnvelopeJson: string, delegateeAid: string, delegateePubkeyB64U: string, scope: Array<string>, ttlSecs?: number | undefined | null): string
|
|
321
|
+
buildDelegation(voucherToken: string, delegateeAid: string, scope: Array<string>, ttlSecs?: number | undefined | null): string
|
|
258
322
|
/**
|
|
259
|
-
* Mint a fresh
|
|
260
|
-
* confirmed the delegation. The
|
|
261
|
-
* verified
|
|
323
|
+
* Mint a fresh compact-JWS TCT for a delegatee after the verifier has
|
|
324
|
+
* confirmed the delegation. The subject-key binding is derived from
|
|
325
|
+
* the verified delegation's `delegatee` AID.
|
|
262
326
|
*/
|
|
263
327
|
issueTctForDelegatee(verified: JsDelegationVerified, ttlSecs?: number | undefined | null): string
|
|
264
328
|
/**
|
|
@@ -269,16 +333,17 @@ export declare class AitpAgent {
|
|
|
269
333
|
signRevocationList(entries: Array<RevocationEntryInput>, expiresInSecs?: number | undefined | null): string
|
|
270
334
|
/**
|
|
271
335
|
* Holder side: build a `TctRenewalPayload` JSON for an in-band
|
|
272
|
-
* renewal of `
|
|
336
|
+
* renewal of `currentTctToken` — the holder's current TCT as a
|
|
337
|
+
* compact-JWS string (RFC-AITP-0005 §10).
|
|
273
338
|
*
|
|
274
339
|
* **Gated by the `experimental-renewal` Cargo feature.** Off in
|
|
275
340
|
* the default `.node` artifact; build with
|
|
276
341
|
* `napi build --release -- --features experimental-renewal`.
|
|
277
342
|
*/
|
|
278
|
-
buildRenewalRequest(
|
|
343
|
+
buildRenewalRequest(currentTctToken: string): string
|
|
279
344
|
/**
|
|
280
345
|
* Issuer side: verify a `TctRenewalPayload` JSON request and mint a
|
|
281
|
-
* fresh
|
|
346
|
+
* fresh TCT, returned as a compact-JWS token string.
|
|
282
347
|
*
|
|
283
348
|
* **Gated by the `experimental-renewal` Cargo feature.**
|
|
284
349
|
*/
|
|
@@ -301,8 +366,12 @@ export declare class SessionBundleBuilder {
|
|
|
301
366
|
sessionId(uuidStr: string): this
|
|
302
367
|
/** Override `issued_at` (unix seconds). Defaults to "now" at build. */
|
|
303
368
|
issuedAt(unixSecs: number): this
|
|
304
|
-
/**
|
|
305
|
-
|
|
369
|
+
/**
|
|
370
|
+
* Add a participant entry. `tctToken` is the participant's TCT as an
|
|
371
|
+
* opaque compact-JWS string (the `tct` field returned by `complete()`
|
|
372
|
+
* / `processCommit()`), carried into the bundle verbatim.
|
|
373
|
+
*/
|
|
374
|
+
participant(aid: string, tctToken: string): this
|
|
306
375
|
/** Construct, sign, and return the `SessionBundleEnvelope` JSON. */
|
|
307
376
|
build(): string
|
|
308
377
|
}
|
|
@@ -358,10 +427,11 @@ export declare class JsInitiatorSession {
|
|
|
358
427
|
/** Step 2 — process `MUTUAL_HELLO_ACK`, produce `MUTUAL_COMMIT`. */
|
|
359
428
|
processHelloAck(helloAckJson: string, sessionId: string): string
|
|
360
429
|
/**
|
|
361
|
-
* Step 3 — process `MUTUAL_COMMIT_ACK`. Returns the
|
|
362
|
-
*
|
|
430
|
+
* Step 3 — process `MUTUAL_COMMIT_ACK`. Returns the completed
|
|
431
|
+
* handshake: the TCT the peer issued to us (opaque compact-JWS
|
|
432
|
+
* token plus its decoded claims) and the optional grant voucher.
|
|
363
433
|
*/
|
|
364
|
-
complete(commitAckJson: string):
|
|
434
|
+
complete(commitAckJson: string): JsCompletedHandshake
|
|
365
435
|
}
|
|
366
436
|
/** Inbound handshake session — drives the responder side. */
|
|
367
437
|
export declare class JsResponderSession {
|
|
@@ -377,14 +447,14 @@ export declare class JsResponderSession {
|
|
|
377
447
|
export type JsTctStore = TctStore
|
|
378
448
|
/**
|
|
379
449
|
* A bounded, in-memory cache of **successful** TCT verifications, keyed by
|
|
380
|
-
* the SHA-256 of the exact TCT
|
|
450
|
+
* the SHA-256 of the exact compact-JWS TCT token bytes.
|
|
381
451
|
*
|
|
382
452
|
* Purpose: a high-throughput verifier (e.g. a writer agent checking a
|
|
383
453
|
* capability on every request) that repeatedly sees the *same* TCT can skip
|
|
384
454
|
* the Ed25519/P-256 signature verification after the first time.
|
|
385
455
|
*
|
|
386
456
|
* **Safety.** The key is a cryptographic hash of the exact signed bytes, so
|
|
387
|
-
* only a byte-identical
|
|
457
|
+
* only a byte-identical token — whose signature was already verified once
|
|
388
458
|
* — can hit. A tampered token hashes differently, misses, and is fully
|
|
389
459
|
* verified. The cheap policy checks (expiry, audience, required grant) are
|
|
390
460
|
* re-run on **every** hit; only the signature check is elided. Eviction is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentidentitytrustprotocol/aitp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Agent Identity Trust Protocol — Node.js SDK",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"registry": "https://registry.npmjs.org/"
|
|
54
54
|
},
|
|
55
55
|
"optionalDependencies": {
|
|
56
|
-
"@agentidentitytrustprotocol/aitp-darwin-x64": "0.
|
|
57
|
-
"@agentidentitytrustprotocol/aitp-darwin-arm64": "0.
|
|
58
|
-
"@agentidentitytrustprotocol/aitp-linux-x64-gnu": "0.
|
|
59
|
-
"@agentidentitytrustprotocol/aitp-linux-arm64-gnu": "0.
|
|
56
|
+
"@agentidentitytrustprotocol/aitp-darwin-x64": "0.3.0",
|
|
57
|
+
"@agentidentitytrustprotocol/aitp-darwin-arm64": "0.3.0",
|
|
58
|
+
"@agentidentitytrustprotocol/aitp-linux-x64-gnu": "0.3.0",
|
|
59
|
+
"@agentidentitytrustprotocol/aitp-linux-arm64-gnu": "0.3.0"
|
|
60
60
|
}
|
|
61
61
|
}
|