@agentidentitytrustprotocol/aitp 0.4.1 → 0.6.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 CHANGED
@@ -36,7 +36,7 @@ minimal build can opt out with `--no-default-features`:
36
36
 
37
37
  | Feature | Enables | RFC |
38
38
  |-----------------------|--------------------------------------------------------------------------|----------------------|
39
- | `renewal` | `AitpAgent.buildRenewalRequest` / `processRenewalRequest` | RFC-AITP-0005 §10 |
39
+ | `renewal` | `AitpAgent.buildRenewalRequest` / `processRenewalRequest` | RFC-AITP-0013 |
40
40
  | `session-bundle` | `SessionBundleBuilder`, `verifySessionBundle` | RFC-AITP-0010 |
41
41
  | `spki-pinning` | `computeSpkiHash`, `SpkiPinVerifier` | HPKP (RFC 7469) |
42
42
  | `multihop-delegation` | `verifyDelegationMultihop` | RFC-AITP-0011 |
@@ -105,7 +105,7 @@ opaque compact-JWS token strings** (`header.payload.signature`).
105
105
  | `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) |
106
106
  | `verifyDelegation()` | ✅ | RFC-AITP-0006 — strict single-hop; rejects any multi-hop `chain` |
107
107
  | `verifyManifestJson()` | ✅ | Control-plane manifest enrollment |
108
- | `buildRenewalRequest()` / `processRenewalRequest()` | `renewal` | RFC-AITP-0005 §10 |
108
+ | `buildRenewalRequest()` / `processRenewalRequest()` | `renewal` | RFC-AITP-0013 |
109
109
  | `SessionBundleBuilder`, `verifySessionBundle()` | `session-bundle` | RFC-AITP-0010 |
110
110
  | `computeSpkiHash()`, `SpkiPinVerifier` | `spki-pinning` | HPKP outbound pinning |
111
111
  | `verifyDelegationMultihop()` | `multihop-delegation` | RFC-AITP-0011 (draft) multi-hop opt-in |
package/index.d.ts CHANGED
@@ -129,17 +129,17 @@ export interface JsDelegationVerified {
129
129
  export declare function verifyDelegation(token: string, verifierAid: string): JsDelegationVerified
130
130
  /**
131
131
  * Verify a delegation compact JWS allowing **RFC-AITP-0011 multi-hop**
132
- * chains up to `maxHops` total hops (`chain.length + 1`).
132
+ * chains up to `maxDelegationHops` total hops (`chain.length + 1`).
133
133
  *
134
134
  * The strict single-hop `verifyDelegation` is the safe default; this
135
135
  * function additionally allows multi-hop chains. Present by default (the
136
136
  * `multihop-delegation` feature); a `--no-default-features` build omits it.
137
137
  *
138
- * `maxHops` defaults to `DEFAULT_MAX_HOPS` (3, the RFC-AITP-0011 §2
138
+ * `maxDelegationHops` defaults to `DEFAULT_MAX_DELEGATION_HOPS` (3, the RFC-AITP-0011 §2
139
139
  * recommended ceiling). Pass a smaller value for a tighter bound;
140
- * `maxHops = 0` reverts to strict single-hop (rejects any non-empty chain).
140
+ * `maxDelegationHops = 0` reverts to strict single-hop (rejects any non-empty chain).
141
141
  */
142
- export declare function verifyDelegationMultihop(token: string, verifierAid: string, maxHops?: number | undefined | null): JsDelegationVerified
142
+ export declare function verifyDelegationMultihop(token: string, verifierAid: string, maxDelegationHops?: number | undefined | null): JsDelegationVerified
143
143
  /**
144
144
  * Compute the RFC 7638 JWK thumbprint of the public key embedded in
145
145
  * an AID — the value an OIDC IdP MUST place in the JWT's `cnf.jkt`
@@ -157,6 +157,33 @@ export declare function computeAidJkt(aid: string): string
157
157
  * a 32-byte Buffer. Throws if `certDer` is not a parseable certificate.
158
158
  */
159
159
  export declare function computeSpkiHash(certDer: Buffer): Buffer
160
+ /**
161
+ * Verify a `RevocationListEnvelope` JSON string against a pinned issuer.
162
+ *
163
+ * Resolves on success; on failure throws an `Error` whose **`code`** property
164
+ * is one of `signature_invalid`, `issuer_mismatch`, `version_unknown`,
165
+ * `expired`, `malformed`. Branch on `error.code`, never on `error.message`:
166
+ * the code is the contract, the message wording is not.
167
+ *
168
+ * Establishes **authenticity and non-expiry only** — that the snapshot was
169
+ * signed by the holder of `expectedIssuerAid` and that its `expires_at` has
170
+ * not passed. It deliberately does not check `published_at` staleness:
171
+ * RFC-AITP-0008 §3 puts freshness policy at the consuming peer, and
172
+ * collapsing authenticity and freshness into a single switch is how a
173
+ * `soft_fail` mode ends up reporting a *forged* snapshot as not-revoked.
174
+ * The caller owns the staleness budget.
175
+ */
176
+ export declare function verifyRevocationList(envelopeJson: string, expectedIssuerAid: string, nowUnixSecs?: number | undefined | null): void
177
+ /**
178
+ * The exact bytes a revocation snapshot's signature is computed over:
179
+ * `JCS(revocation_list)` — the **inner** body, not the transport wrapper.
180
+ *
181
+ * Exposed so a caller needing the signed bytes (an independent verifier, an
182
+ * HSM signing path, a debugging tool) obtains them rather than reconstructing
183
+ * the shape at the call site. Reconstructing it is how signer, verifier and
184
+ * conformance fixture drifted apart before 0.5.0.
185
+ */
186
+ export declare function revocationSigningBytes(envelopeJson: string): Buffer
160
187
  /** Result of `processHello`: response body plus session id. */
161
188
  export interface JsHelloAckResult {
162
189
  /** `MUTUAL_HELLO_ACK` envelope JSON — set as the HTTP response body. */
@@ -332,7 +359,7 @@ export declare class AitpAgent {
332
359
  /**
333
360
  * Holder side: build a `TctRenewalPayload` JSON for an in-band
334
361
  * renewal of `currentTctToken` — the holder's current TCT as a
335
- * compact-JWS string (RFC-AITP-0005 §10).
362
+ * compact-JWS string (RFC-AITP-0013).
336
363
  *
337
364
  * Behind the `renewal` Cargo feature, which is **on by default**; a
338
365
  * `--no-default-features` build omits it.
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { AitpAgent, SessionBundleBuilder, verifySessionBundle, verifyDelegation, verifyDelegationMultihop, computeAidJkt, JwksProvider, computeSpkiHash, SpkiPinVerifier, JsInitiatorSession, JsResponderSession, TctStore, verifyManifestJson } = nativeBinding
313
+ const { AitpAgent, SessionBundleBuilder, verifySessionBundle, verifyDelegation, verifyDelegationMultihop, computeAidJkt, JwksProvider, computeSpkiHash, SpkiPinVerifier, verifyRevocationList, revocationSigningBytes, JsInitiatorSession, JsResponderSession, TctStore, verifyManifestJson } = nativeBinding
314
314
 
315
315
  module.exports.AitpAgent = AitpAgent
316
316
  module.exports.SessionBundleBuilder = SessionBundleBuilder
@@ -321,6 +321,8 @@ module.exports.computeAidJkt = computeAidJkt
321
321
  module.exports.JwksProvider = JwksProvider
322
322
  module.exports.computeSpkiHash = computeSpkiHash
323
323
  module.exports.SpkiPinVerifier = SpkiPinVerifier
324
+ module.exports.verifyRevocationList = verifyRevocationList
325
+ module.exports.revocationSigningBytes = revocationSigningBytes
324
326
  module.exports.JsInitiatorSession = JsInitiatorSession
325
327
  module.exports.JsResponderSession = JsResponderSession
326
328
  module.exports.TctStore = TctStore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentidentitytrustprotocol/aitp",
3
- "version": "0.4.1",
3
+ "version": "0.6.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.4.1",
57
- "@agentidentitytrustprotocol/aitp-darwin-arm64": "0.4.1",
58
- "@agentidentitytrustprotocol/aitp-linux-x64-gnu": "0.4.1",
59
- "@agentidentitytrustprotocol/aitp-linux-arm64-gnu": "0.4.1"
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"
60
60
  }
61
61
  }