@agentidentitytrustprotocol/aitp 0.6.0 → 0.7.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.
Files changed (2) hide show
  1. package/index.d.ts +31 -5
  2. package/package.json +5 -5
package/index.d.ts CHANGED
@@ -125,8 +125,15 @@ export interface JsDelegationVerified {
125
125
  * delegation) is **rejected** with `DELEGATION_MULTIHOP_NOT_SUPPORTED`,
126
126
  * matching the Rust core default. To allow multi-hop chains, call
127
127
  * `verifyDelegationMultihop` instead.
128
+ *
129
+ * `revokedJtis` is an optional list of revoked `jti` strings — the
130
+ * verifier's own deny list. When non-empty, a token whose
131
+ * `voucher.src_jti` is in it is rejected after every signature check passes
132
+ * (RFC-AITP-0006 §4 step 7, ordered per RFC-AITP-0008 §3.3). **Verifiers
133
+ * SHOULD supply it.** Omitting it silently redeems a delegation whose
134
+ * source TCT has been revoked, which step 7 states as a MUST-reject.
128
135
  */
129
- export declare function verifyDelegation(token: string, verifierAid: string): JsDelegationVerified
136
+ export declare function verifyDelegation(token: string, verifierAid: string, revokedJtis?: Array<string> | undefined | null): JsDelegationVerified
130
137
  /**
131
138
  * Verify a delegation compact JWS allowing **RFC-AITP-0011 multi-hop**
132
139
  * chains up to `maxDelegationHops` total hops (`chain.length + 1`).
@@ -138,8 +145,21 @@ export declare function verifyDelegation(token: string, verifierAid: string): Js
138
145
  * `maxDelegationHops` defaults to `DEFAULT_MAX_DELEGATION_HOPS` (3, the RFC-AITP-0011 §2
139
146
  * recommended ceiling). Pass a smaller value for a tighter bound;
140
147
  * `maxDelegationHops = 0` reverts to strict single-hop (rejects any non-empty chain).
148
+ *
149
+ * `revokedJtis`, when non-empty, is consulted twice — both only after every
150
+ * signature check: once for the root `voucher.src_jti` (RFC-AITP-0006 §4
151
+ * step 7), and once for every hop's `jti`, meaning each chain entry and the
152
+ * outer token (RFC-AITP-0011 §6). Both are MUST-rejects, and a revoked hop
153
+ * invalidates every hop downstream of it — there is no partial-validity
154
+ * model.
155
+ *
156
+ * Note that §6 specifies each hop `jti` be checked against the deny list of
157
+ * *that hop's issuer*, which one flat list cannot express, so it is applied
158
+ * to every hop regardless of issuer. That can only reject more, never
159
+ * accept a revoked hop, but it does mean a list aggregated across several
160
+ * issuers lets any contributor revoke any hop.
141
161
  */
142
- export declare function verifyDelegationMultihop(token: string, verifierAid: string, maxDelegationHops?: number | undefined | null): JsDelegationVerified
162
+ export declare function verifyDelegationMultihop(token: string, verifierAid: string, maxDelegationHops?: number | undefined | null, revokedJtis?: Array<string> | undefined | null): JsDelegationVerified
143
163
  /**
144
164
  * Compute the RFC 7638 JWK thumbprint of the public key embedded in
145
165
  * an AID — the value an OIDC IdP MUST place in the JWT's `cnf.jkt`
@@ -254,9 +274,15 @@ export interface JsTctIdentity {
254
274
  jti: string
255
275
  }
256
276
  /**
257
- * Verify a `ManifestEnvelope` JSON string. Throws on signature,
258
- * proof-of-possession, expiry, or identity-hint shape failures.
259
- * Used by the AITP Control Plane during agent enrollment.
277
+ * Verify a `ManifestEnvelope` JSON string. Used by the AITP Control Plane
278
+ * during agent enrollment, and by any consumer reading an AID or endpoint
279
+ * out of a peer's manifest.
280
+ *
281
+ * On failure throws an `Error` whose **`code`** property is one of
282
+ * `signature_invalid`, `pop_failed`, `aid_mismatch`, `expired`,
283
+ * `version_unknown`, `identity_hint_malformed`,
284
+ * `incompatible_identity_type`, `malformed`. Branch on `error.code`, never
285
+ * on `error.message`: the code is the contract, the wording is not.
260
286
  */
261
287
  export declare function verifyManifestJson(manifestEnvelopeJson: string): void
262
288
  /** An AITP agent: a signing key and (once built) its Manifest. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentidentitytrustprotocol/aitp",
3
- "version": "0.6.0",
3
+ "version": "0.7.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.6.0",
57
- "@agentidentitytrustprotocol/aitp-darwin-arm64": "0.6.0",
58
- "@agentidentitytrustprotocol/aitp-linux-x64-gnu": "0.6.0",
59
- "@agentidentitytrustprotocol/aitp-linux-arm64-gnu": "0.6.0"
56
+ "@agentidentitytrustprotocol/aitp-darwin-x64": "0.7.0",
57
+ "@agentidentitytrustprotocol/aitp-darwin-arm64": "0.7.0",
58
+ "@agentidentitytrustprotocol/aitp-linux-x64-gnu": "0.7.0",
59
+ "@agentidentitytrustprotocol/aitp-linux-arm64-gnu": "0.7.0"
60
60
  }
61
61
  }