@agenticprimitives/edge-cloudflare 0.0.0-alpha.23 → 0.0.0-alpha.25
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/dist/client-certificate.d.ts +41 -0
- package/dist/client-certificate.d.ts.map +1 -0
- package/dist/client-certificate.js +238 -0
- package/dist/client-certificate.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/transport-evidence.d.ts +34 -0
- package/dist/transport-evidence.d.ts.map +1 -1
- package/dist/transport-evidence.js +49 -1
- package/dist/transport-evidence.js.map +1 -1
- package/package.json +7 -5
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type WorkloadIdentifier } from '@agenticprimitives/admission';
|
|
2
|
+
/** Longest certificate this reads. Cloudflare omits a leaf above 10 KB (`certRFC9440TooLarge`); this matches it. */
|
|
3
|
+
export declare const MAX_CLIENT_CERTIFICATE_BYTES: number;
|
|
4
|
+
/** What a certificate says, before anything has been computed from it. */
|
|
5
|
+
export interface ParsedClientCertificate {
|
|
6
|
+
/** The DER SubjectPublicKeyInfo, exactly as it sits in the certificate. */
|
|
7
|
+
spki: Uint8Array;
|
|
8
|
+
/** The key's algorithm, when it is one this reads; `null` for any other (RSA included). */
|
|
9
|
+
keyAlgorithm: 'P-256' | 'Ed25519' | null;
|
|
10
|
+
/** Every `uniformResourceIdentifier` name of the subjectAltName extension, in order. */
|
|
11
|
+
uriNames: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Walk a DER certificate to its SubjectPublicKeyInfo and its URI subject-alternative names. `null` when the bytes are
|
|
15
|
+
* not one well-formed `Certificate` (trailing bytes, a broken length, a duplicate subjectAltName, a non-ASCII URI).
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseClientCertificate(der: Uint8Array): ParsedClientCertificate | null;
|
|
18
|
+
/**
|
|
19
|
+
* Decode a forwarded certificate: RFC 9440 `:base64-DER:` (what Cloudflare's `tlsClientAuth.certRFC9440` and the
|
|
20
|
+
* `Client-Cert` header carry), a PEM `CERTIFICATE` block, or bare base64 DER. `null` for anything else.
|
|
21
|
+
*/
|
|
22
|
+
export declare function decodeForwardedCertificate(value: string | undefined | null): Uint8Array | null;
|
|
23
|
+
/** Lower-case hex SHA-256 of the bytes (the certificate fingerprint Cloudflare reports). */
|
|
24
|
+
export declare function sha256Hex(bytes: Uint8Array): Promise<string>;
|
|
25
|
+
/** What the boundary may report about the key and the name, once it knows the certificate is the validated one. */
|
|
26
|
+
export interface ClientCertificateKeyEvidence {
|
|
27
|
+
/** RFC 7638 thumbprint of the certificate's public key (P-256 or Ed25519 only). */
|
|
28
|
+
clientPublicKeyJwkThumbprint?: string;
|
|
29
|
+
/** `sha256:<hex>` of the DER SubjectPublicKeyInfo. */
|
|
30
|
+
clientPublicKeySpkiSha256?: string;
|
|
31
|
+
/** The one `spiffe://` or `wimse://` URI name, when there is exactly one workload URI and it is well formed. */
|
|
32
|
+
workloadIdentifier?: WorkloadIdentifier;
|
|
33
|
+
}
|
|
34
|
+
/** The workload identifier a set of URI names carries: exactly one `spiffe://` / `wimse://` name, or none at all. */
|
|
35
|
+
export declare function workloadIdentifierOfUris(uris: readonly string[]): WorkloadIdentifier | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* The key thumbprint, SPKI hash and workload identifier of a certificate. Reads; never throws. An unsupported key
|
|
38
|
+
* type yields no thumbprint (and no SPKI hash is withheld for that — the hash names bytes, not a key type).
|
|
39
|
+
*/
|
|
40
|
+
export declare function clientCertificateKeyEvidence(der: Uint8Array): Promise<ClientCertificateKeyEvidence | null>;
|
|
41
|
+
//# sourceMappingURL=client-certificate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-certificate.d.ts","sourceRoot":"","sources":["../src/client-certificate.ts"],"names":[],"mappings":"AAYA,OAAO,EAAgD,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAErH,oHAAoH;AACpH,eAAO,MAAM,4BAA4B,QAAY,CAAC;AAiEtD,0EAA0E;AAC1E,MAAM,WAAW,uBAAuB;IACtC,2EAA2E;IAC3E,IAAI,EAAE,UAAU,CAAC;IACjB,2FAA2F;IAC3F,YAAY,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACzC,wFAAwF;IACxF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,UAAU,GAAG,uBAAuB,GAAG,IAAI,CA4DtF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAiB9F;AAID,4FAA4F;AAC5F,wBAAsB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAElE;AAED,mHAAmH;AACnH,MAAM,WAAW,4BAA4B;IAC3C,mFAAmF;IACnF,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,sDAAsD;IACtD,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,gHAAgH;IAChH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,qHAAqH;AACrH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,kBAAkB,GAAG,SAAS,CAehG;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CAsBhH"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// The key and the workload identifier a client certificate carries (spec 450 §5.2, review M-2).
|
|
2
|
+
//
|
|
3
|
+
// A SMALL, DEPENDENCY-FREE DER WALKER. It reads exactly two things out of an X.509 leaf certificate (RFC 5280):
|
|
4
|
+
// • the SubjectPublicKeyInfo, which WebCrypto imports (`spki`) and exports as a JWK for its RFC 7638 thumbprint;
|
|
5
|
+
// • the URI names of the subjectAltName extension, of which a `spiffe://` or `wimse://` one is the workload
|
|
6
|
+
// identifier.
|
|
7
|
+
// It verifies NOTHING — no signature, no chain, no window. That is the TLS terminator's job, and this module's output
|
|
8
|
+
// is only ever used when the terminator said it validated THIS certificate (`transport-evidence.ts` binds the bytes to
|
|
9
|
+
// the handshake by fingerprint). Anything it cannot read exactly is `null`: never a guess, never a throw.
|
|
10
|
+
//
|
|
11
|
+
// Workers-neutral: WebCrypto and plain Uint8Array only.
|
|
12
|
+
import { rfc7638Thumbprint, parseWimseAgentIdentifier } from '@agenticprimitives/admission';
|
|
13
|
+
/** Longest certificate this reads. Cloudflare omits a leaf above 10 KB (`certRFC9440TooLarge`); this matches it. */
|
|
14
|
+
export const MAX_CLIENT_CERTIFICATE_BYTES = 10 * 1024;
|
|
15
|
+
/** One DER TLV at `pos`, bounded by `limit`. Only single-octet tags and definite, minimal lengths (DER). */
|
|
16
|
+
function readTlv(b, pos, limit) {
|
|
17
|
+
if (pos + 2 > limit)
|
|
18
|
+
return null;
|
|
19
|
+
const tag = b[pos];
|
|
20
|
+
if ((tag & 0x1f) === 0x1f)
|
|
21
|
+
return null; // multi-octet tag: never in the fields read here
|
|
22
|
+
let len = b[pos + 1];
|
|
23
|
+
let p = pos + 2;
|
|
24
|
+
if (len & 0x80) {
|
|
25
|
+
const n = len & 0x7f;
|
|
26
|
+
if (n === 0 || n > 3 || p + n > limit)
|
|
27
|
+
return null; // indefinite form is BER, not DER; > 16 MB is not a cert
|
|
28
|
+
len = 0;
|
|
29
|
+
for (let i = 0; i < n; i++)
|
|
30
|
+
len = (len << 8) | b[p + i];
|
|
31
|
+
if (b[p] === 0 || len < 0x80)
|
|
32
|
+
return null; // non-minimal length encoding
|
|
33
|
+
p += n;
|
|
34
|
+
}
|
|
35
|
+
if (p + len > limit)
|
|
36
|
+
return null;
|
|
37
|
+
return { tag, start: p, end: p + len, head: pos };
|
|
38
|
+
}
|
|
39
|
+
/** The children of a constructed TLV, or null when they do not tile it exactly. */
|
|
40
|
+
function children(b, t) {
|
|
41
|
+
const out = [];
|
|
42
|
+
let p = t.start;
|
|
43
|
+
while (p < t.end) {
|
|
44
|
+
const c = readTlv(b, p, t.end);
|
|
45
|
+
if (!c)
|
|
46
|
+
return null;
|
|
47
|
+
out.push(c);
|
|
48
|
+
p = c.end;
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
const SEQUENCE = 0x30;
|
|
53
|
+
const OID = 0x06;
|
|
54
|
+
const BOOLEAN = 0x01;
|
|
55
|
+
const OCTET_STRING = 0x04;
|
|
56
|
+
/** `[3] EXPLICIT Extensions` in TBSCertificate. */
|
|
57
|
+
const EXTENSIONS_TAG = 0xa3;
|
|
58
|
+
/** GeneralName `[6] uniformResourceIdentifier IA5String` (implicit, primitive). */
|
|
59
|
+
const GN_URI = 0x86;
|
|
60
|
+
/** 2.5.29.17 subjectAltName */
|
|
61
|
+
const OID_SAN = [0x55, 0x1d, 0x11];
|
|
62
|
+
/** 1.2.840.10045.2.1 id-ecPublicKey */
|
|
63
|
+
const OID_EC_PUBLIC_KEY = [0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01];
|
|
64
|
+
/** 1.2.840.10045.3.1.7 prime256v1 / P-256 */
|
|
65
|
+
const OID_P256 = [0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07];
|
|
66
|
+
/** 1.3.101.112 id-Ed25519 */
|
|
67
|
+
const OID_ED25519 = [0x2b, 0x65, 0x70];
|
|
68
|
+
const eq = (b, t, want) => t.tag === OID && t.end - t.start === want.length && want.every((v, i) => b[t.start + i] === v);
|
|
69
|
+
/**
|
|
70
|
+
* Walk a DER certificate to its SubjectPublicKeyInfo and its URI subject-alternative names. `null` when the bytes are
|
|
71
|
+
* not one well-formed `Certificate` (trailing bytes, a broken length, a duplicate subjectAltName, a non-ASCII URI).
|
|
72
|
+
*/
|
|
73
|
+
export function parseClientCertificate(der) {
|
|
74
|
+
if (!(der instanceof Uint8Array) || der.length === 0 || der.length > MAX_CLIENT_CERTIFICATE_BYTES)
|
|
75
|
+
return null;
|
|
76
|
+
const cert = readTlv(der, 0, der.length);
|
|
77
|
+
if (!cert || cert.tag !== SEQUENCE || cert.end !== der.length)
|
|
78
|
+
return null;
|
|
79
|
+
const top = children(der, cert);
|
|
80
|
+
// Certificate ::= SEQUENCE { tbsCertificate, signatureAlgorithm, signatureValue }
|
|
81
|
+
if (!top || top.length !== 3 || top[0].tag !== SEQUENCE)
|
|
82
|
+
return null;
|
|
83
|
+
const tbs = children(der, top[0]);
|
|
84
|
+
if (!tbs)
|
|
85
|
+
return null;
|
|
86
|
+
// TBSCertificate ::= SEQUENCE { [0] version OPTIONAL, serialNumber, signature, issuer, validity, subject,
|
|
87
|
+
// subjectPublicKeyInfo, [1] issuerUID OPTIONAL, [2] subjectUID OPTIONAL, [3] extensions OPTIONAL }
|
|
88
|
+
let i = tbs[0]?.tag === 0xa0 ? 1 : 0;
|
|
89
|
+
i += 5; // serialNumber, signature, issuer, validity, subject
|
|
90
|
+
const spkiTlv = tbs[i];
|
|
91
|
+
if (!spkiTlv || spkiTlv.tag !== SEQUENCE)
|
|
92
|
+
return null;
|
|
93
|
+
const spkiParts = children(der, spkiTlv);
|
|
94
|
+
if (!spkiParts || spkiParts.length !== 2 || spkiParts[0].tag !== SEQUENCE || spkiParts[1].tag !== 0x03)
|
|
95
|
+
return null;
|
|
96
|
+
const algParts = children(der, spkiParts[0]);
|
|
97
|
+
if (!algParts || algParts.length < 1)
|
|
98
|
+
return null;
|
|
99
|
+
let keyAlgorithm = null;
|
|
100
|
+
if (eq(der, algParts[0], OID_EC_PUBLIC_KEY) && algParts.length === 2 && eq(der, algParts[1], OID_P256))
|
|
101
|
+
keyAlgorithm = 'P-256';
|
|
102
|
+
else if (eq(der, algParts[0], OID_ED25519) && algParts.length === 1)
|
|
103
|
+
keyAlgorithm = 'Ed25519';
|
|
104
|
+
const uriNames = [];
|
|
105
|
+
let sanSeen = false;
|
|
106
|
+
for (const field of tbs.slice(i + 1)) {
|
|
107
|
+
if (field.tag !== EXTENSIONS_TAG)
|
|
108
|
+
continue;
|
|
109
|
+
const wrapped = children(der, field);
|
|
110
|
+
if (!wrapped || wrapped.length !== 1 || wrapped[0].tag !== SEQUENCE)
|
|
111
|
+
return null;
|
|
112
|
+
const exts = children(der, wrapped[0]);
|
|
113
|
+
if (!exts)
|
|
114
|
+
return null;
|
|
115
|
+
for (const ext of exts) {
|
|
116
|
+
// Extension ::= SEQUENCE { extnID, critical BOOLEAN DEFAULT FALSE, extnValue OCTET STRING }
|
|
117
|
+
if (ext.tag !== SEQUENCE)
|
|
118
|
+
return null;
|
|
119
|
+
const parts = children(der, ext);
|
|
120
|
+
if (!parts || parts.length < 2 || parts.length > 3 || parts[0].tag !== OID)
|
|
121
|
+
return null;
|
|
122
|
+
if (!eq(der, parts[0], OID_SAN))
|
|
123
|
+
continue;
|
|
124
|
+
if (sanSeen)
|
|
125
|
+
return null; // RFC 5280 §4.2: an extension appears at most once
|
|
126
|
+
sanSeen = true;
|
|
127
|
+
if (parts.length === 3 && parts[1].tag !== BOOLEAN)
|
|
128
|
+
return null;
|
|
129
|
+
const value = parts[parts.length - 1];
|
|
130
|
+
if (value.tag !== OCTET_STRING)
|
|
131
|
+
return null;
|
|
132
|
+
const names = readTlv(der, value.start, value.end);
|
|
133
|
+
if (!names || names.tag !== SEQUENCE || names.end !== value.end)
|
|
134
|
+
return null;
|
|
135
|
+
const gns = children(der, names);
|
|
136
|
+
if (!gns)
|
|
137
|
+
return null;
|
|
138
|
+
for (const gn of gns) {
|
|
139
|
+
if (gn.tag !== GN_URI)
|
|
140
|
+
continue;
|
|
141
|
+
let s = '';
|
|
142
|
+
for (let p = gn.start; p < gn.end; p++) {
|
|
143
|
+
const c = der[p];
|
|
144
|
+
if (c < 0x21 || c > 0x7e)
|
|
145
|
+
return null; // IA5, and no space or control in a URI
|
|
146
|
+
s += String.fromCharCode(c);
|
|
147
|
+
}
|
|
148
|
+
uriNames.push(s);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return { spki: der.slice(spkiTlv.head, spkiTlv.end), keyAlgorithm, uriNames };
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Decode a forwarded certificate: RFC 9440 `:base64-DER:` (what Cloudflare's `tlsClientAuth.certRFC9440` and the
|
|
156
|
+
* `Client-Cert` header carry), a PEM `CERTIFICATE` block, or bare base64 DER. `null` for anything else.
|
|
157
|
+
*/
|
|
158
|
+
export function decodeForwardedCertificate(value) {
|
|
159
|
+
if (typeof value !== 'string')
|
|
160
|
+
return null;
|
|
161
|
+
let s = value.trim();
|
|
162
|
+
if (s.length === 0 || s.length > MAX_CLIENT_CERTIFICATE_BYTES * 2)
|
|
163
|
+
return null;
|
|
164
|
+
const pem = /^-----BEGIN CERTIFICATE-----([\s\S]*?)-----END CERTIFICATE-----$/.exec(s);
|
|
165
|
+
if (pem)
|
|
166
|
+
s = pem[1].replace(/\s+/g, '');
|
|
167
|
+
else if (s.startsWith(':') && s.endsWith(':') && s.length >= 2)
|
|
168
|
+
s = s.slice(1, -1);
|
|
169
|
+
if (!/^[A-Za-z0-9+/]+={0,2}$/.test(s) || s.length % 4 !== 0)
|
|
170
|
+
return null;
|
|
171
|
+
let bin;
|
|
172
|
+
try {
|
|
173
|
+
bin = atob(s);
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
const out = new Uint8Array(bin.length);
|
|
179
|
+
for (let i = 0; i < bin.length; i++)
|
|
180
|
+
out[i] = bin.charCodeAt(i);
|
|
181
|
+
return out;
|
|
182
|
+
}
|
|
183
|
+
const hex = (b) => Array.from(new Uint8Array(b), (x) => x.toString(16).padStart(2, '0')).join('');
|
|
184
|
+
/** Lower-case hex SHA-256 of the bytes (the certificate fingerprint Cloudflare reports). */
|
|
185
|
+
export async function sha256Hex(bytes) {
|
|
186
|
+
return hex(await crypto.subtle.digest('SHA-256', bytes));
|
|
187
|
+
}
|
|
188
|
+
/** The workload identifier a set of URI names carries: exactly one `spiffe://` / `wimse://` name, or none at all. */
|
|
189
|
+
export function workloadIdentifierOfUris(uris) {
|
|
190
|
+
const candidates = uris.filter((u) => /^(spiffe|wimse):\/\//i.test(u));
|
|
191
|
+
// SPIFFE X.509-SVID: exactly one URI SAN. Two workload names is two claims, and choosing one is a guess.
|
|
192
|
+
if (candidates.length !== 1)
|
|
193
|
+
return undefined;
|
|
194
|
+
const u = candidates[0];
|
|
195
|
+
if (/^spiffe:\/\//.test(u)) {
|
|
196
|
+
// spiffe://<trust-domain>/<path>: lower-case trust domain, a non-empty path, no query/fragment/port/userinfo.
|
|
197
|
+
if (!/^spiffe:\/\/[a-z0-9._-]+(\/[A-Za-z0-9._-]+)+$/.test(u))
|
|
198
|
+
return undefined;
|
|
199
|
+
if (u.split('/').slice(3).some((seg) => seg === '.' || seg === '..'))
|
|
200
|
+
return undefined;
|
|
201
|
+
return { type: 'SPIFFEIdentifier', value: u };
|
|
202
|
+
}
|
|
203
|
+
// wimse://<trust-domain>/agent/eip155/<chainId>/<address>, read by admission's own parser and re-spelled in its one
|
|
204
|
+
// canonical form, so the resolver's byte comparison holds.
|
|
205
|
+
const w = parseWimseAgentIdentifier(u);
|
|
206
|
+
return w ? { type: 'WimseIdentifier', value: `wimse://${w.trustDomain}/agent/eip155/${w.chainId}/${w.address}` } : undefined;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The key thumbprint, SPKI hash and workload identifier of a certificate. Reads; never throws. An unsupported key
|
|
210
|
+
* type yields no thumbprint (and no SPKI hash is withheld for that — the hash names bytes, not a key type).
|
|
211
|
+
*/
|
|
212
|
+
export async function clientCertificateKeyEvidence(der) {
|
|
213
|
+
const parsed = parseClientCertificate(der);
|
|
214
|
+
if (!parsed)
|
|
215
|
+
return null;
|
|
216
|
+
const out = {};
|
|
217
|
+
try {
|
|
218
|
+
out.clientPublicKeySpkiSha256 = `sha256:${await sha256Hex(parsed.spki)}`;
|
|
219
|
+
if (parsed.keyAlgorithm) {
|
|
220
|
+
const algorithm = parsed.keyAlgorithm === 'P-256' ? { name: 'ECDSA', namedCurve: 'P-256' } : { name: 'Ed25519' };
|
|
221
|
+
const usages = ['verify'];
|
|
222
|
+
const key = await crypto.subtle.importKey('spki', parsed.spki, algorithm, true, usages);
|
|
223
|
+
const jwk = (await crypto.subtle.exportKey('jwk', key));
|
|
224
|
+
const thumb = await rfc7638Thumbprint(jwk);
|
|
225
|
+
if (thumb)
|
|
226
|
+
out.clientPublicKeyJwkThumbprint = thumb;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// A key WebCrypto refuses is a key nobody can bind: no thumbprint. Not a throw that would 400 a baseline request.
|
|
231
|
+
delete out.clientPublicKeyJwkThumbprint;
|
|
232
|
+
}
|
|
233
|
+
const id = workloadIdentifierOfUris(parsed.uriNames);
|
|
234
|
+
if (id)
|
|
235
|
+
out.workloadIdentifier = id;
|
|
236
|
+
return out;
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=client-certificate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-certificate.js","sourceRoot":"","sources":["../src/client-certificate.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,EAAE;AACF,gHAAgH;AAChH,mHAAmH;AACnH,8GAA8G;AAC9G,kBAAkB;AAClB,sHAAsH;AACtH,uHAAuH;AACvH,0GAA0G;AAC1G,EAAE;AACF,wDAAwD;AAExD,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAA2B,MAAM,8BAA8B,CAAC;AAErH,oHAAoH;AACpH,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,IAAI,CAAC;AAYtD,4GAA4G;AAC5G,SAAS,OAAO,CAAC,CA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 export { dispatchToBinding } from './dispatch.js';
|
|
|
7
7
|
export type { DispatchInit } from './dispatch.js';
|
|
8
8
|
export { cfTlsClientAuthOf, transportEvidenceFromCf, transportEvidenceFromRequest, } from './transport-evidence.js';
|
|
9
9
|
export type { CfTlsClientAuth, TransportEvidenceOptions } from './transport-evidence.js';
|
|
10
|
+
export { transportEvidenceWithClientKeyFromCf, transportEvidenceWithClientKeyFromRequest, forwardedClientCertificateOf, } from './transport-evidence.js';
|
|
11
|
+
export type { ClientKeyEvidenceOptions } from './transport-evidence.js';
|
|
12
|
+
export { parseClientCertificate, decodeForwardedCertificate, clientCertificateKeyEvidence, workloadIdentifierOfUris, MAX_CLIENT_CERTIFICATE_BYTES, } from './client-certificate.js';
|
|
13
|
+
export type { ParsedClientCertificate, ClientCertificateKeyEvidence } from './client-certificate.js';
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACpF,YAAY,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACpF,YAAY,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAIzF,OAAO,EACL,oCAAoC,EACpC,yCAAyC,EACzC,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,4 +7,8 @@ export { dispatchToBinding } from './dispatch.js';
|
|
|
7
7
|
// Optional mTLS evidence (spec 339 §10). Produces evidence; decides nothing — admission decides
|
|
8
8
|
// what a certificate is worth (ADR-0043). Absent evidence is a NORMAL request.
|
|
9
9
|
export { cfTlsClientAuthOf, transportEvidenceFromCf, transportEvidenceFromRequest, } from './transport-evidence.js';
|
|
10
|
+
// Spec 450 §5.2 (review M-2): the key and the workload URI name of the certificate the handshake validated — only
|
|
11
|
+
// when the forwarded bytes hash to the handshake's fingerprint. Never a guess, never a throw.
|
|
12
|
+
export { transportEvidenceWithClientKeyFromCf, transportEvidenceWithClientKeyFromRequest, forwardedClientCertificateOf, } from './transport-evidence.js';
|
|
13
|
+
export { parseClientCertificate, decodeForwardedCertificate, clientCertificateKeyEvidence, workloadIdentifierOfUris, MAX_CLIENT_CERTIFICATE_BYTES, } from './client-certificate.js';
|
|
10
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,0EAA0E;AAE1E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGpE,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAGpF,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,gGAAgG;AAChG,+EAA+E;AAC/E,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,0EAA0E;AAE1E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGpE,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAGpF,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEhH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,gGAAgG;AAChG,+EAA+E;AAC/E,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AAGjC,kHAAkH;AAClH,8FAA8F;AAC9F,OAAO,EACL,oCAAoC,EACpC,yCAAyC,EACzC,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC"}
|
|
@@ -19,6 +19,13 @@ export interface CfTlsClientAuth {
|
|
|
19
19
|
certSubjectDN?: string;
|
|
20
20
|
certIssuerDN?: string;
|
|
21
21
|
certSerial?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The client leaf certificate in RFC 9440 form (`:base64-DER:`); empty when none was presented or it exceeded
|
|
24
|
+
* 10 KB. Declared by `@cloudflare/workers-types` (`IncomingRequestCfPropertiesTLSClientAuth.certRFC9440`).
|
|
25
|
+
*/
|
|
26
|
+
certRFC9440?: string;
|
|
27
|
+
/** `true` when the leaf exceeded 10 KB and was omitted from `certRFC9440`. */
|
|
28
|
+
certRFC9440TooLarge?: boolean;
|
|
22
29
|
}
|
|
23
30
|
export interface TransportEvidenceOptions {
|
|
24
31
|
/**
|
|
@@ -42,4 +49,31 @@ export declare function transportEvidenceFromCf(tls: CfTlsClientAuth | undefined
|
|
|
42
49
|
export declare function cfTlsClientAuthOf(request: Request): CfTlsClientAuth | undefined;
|
|
43
50
|
/** Convenience: evidence straight off a request. Always returns something — HTTPS at minimum. */
|
|
44
51
|
export declare function transportEvidenceFromRequest(request: Request, opts?: TransportEvidenceOptions): OptionalTransportEvidence;
|
|
52
|
+
export interface ClientKeyEvidenceOptions extends TransportEvidenceOptions {
|
|
53
|
+
/**
|
|
54
|
+
* Where the certificate's bytes come from. Exactly ONE source, chosen by configuration — never one tried after the
|
|
55
|
+
* other (ADR-0013):
|
|
56
|
+
* • omitted ⇒ Cloudflare's `request.cf.tlsClientAuth.certRFC9440` (RFC 9440 `:base64-DER:`), set by the platform;
|
|
57
|
+
* • a header name ⇒ that request header (RFC 9440 `:base64-DER:`, PEM, or bare base64 DER), for a deployment
|
|
58
|
+
* where an upstream terminator forwards the certificate. No header name is assumed: the deployment names it.
|
|
59
|
+
* Either way the bytes are used only when their SHA-256 equals the fingerprint of the certificate the handshake
|
|
60
|
+
* validated, so a forwarded value a caller set cannot name a key the handshake did not see.
|
|
61
|
+
*/
|
|
62
|
+
clientCertificateHeader?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Transport evidence plus, when the handshake proved it, the RFC 7638 thumbprint of the client certificate's key
|
|
66
|
+
* (`clientPublicKeyJwkThumbprint`), its SPKI hash and its one `spiffe://` / `wimse://` URI name (`workloadIdentifier`).
|
|
67
|
+
*
|
|
68
|
+
* The key facts are added ONLY when all of these hold: Cloudflare says a certificate was presented, verified
|
|
69
|
+
* (`SUCCESS`), not revoked and in its window; the certificate bytes decode and parse; and their SHA-256 equals
|
|
70
|
+
* `certFingerprintSHA256`. Any other case returns the evidence `transportEvidenceFromCf` returns — no thumbprint, no
|
|
71
|
+
* identifier, no throw. The engine then confirms no workload binding (`WORKLOAD_KEY_MISMATCH` /
|
|
72
|
+
* no identifier), which is the fail-closed answer.
|
|
73
|
+
*/
|
|
74
|
+
export declare function transportEvidenceWithClientKeyFromCf(tls: CfTlsClientAuth | undefined, certificate: string | undefined | null, opts?: TransportEvidenceOptions): Promise<OptionalTransportEvidence>;
|
|
75
|
+
/** The certificate bytes from the ONE configured source (see `ClientKeyEvidenceOptions.clientCertificateHeader`). */
|
|
76
|
+
export declare function forwardedClientCertificateOf(request: Request, opts?: Pick<ClientKeyEvidenceOptions, 'clientCertificateHeader'>): string | undefined;
|
|
77
|
+
/** `transportEvidenceWithClientKeyFromCf` straight off a request. Always resolves — HTTPS at minimum. */
|
|
78
|
+
export declare function transportEvidenceWithClientKeyFromRequest(request: Request, opts?: ClientKeyEvidenceOptions): Promise<OptionalTransportEvidence>;
|
|
45
79
|
//# sourceMappingURL=transport-evidence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport-evidence.d.ts","sourceRoot":"","sources":["../src/transport-evidence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transport-evidence.d.ts","sourceRoot":"","sources":["../src/transport-evidence.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,yBAAyB,EAAsB,MAAM,8BAA8B,CAAC;AAGlG;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,0BAA0B;IAC1B,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAID;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,eAAe,GAAG,SAAS,EAChC,IAAI,GAAE,wBAA6B,GAClC,yBAAyB,CA2C3B;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAG/E;AAED,iGAAiG;AACjG,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,wBAA6B,GAClC,yBAAyB,CAE3B;AAID,MAAM,WAAW,wBAAyB,SAAQ,wBAAwB;IACxE;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAsB,oCAAoC,CACxD,GAAG,EAAE,eAAe,GAAG,SAAS,EAChC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACtC,IAAI,GAAE,wBAA6B,GAClC,OAAO,CAAC,yBAAyB,CAAC,CAgBpC;AAED,qHAAqH;AACrH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAE,IAAI,CAAC,wBAAwB,EAAE,yBAAyB,CAAM,GAAG,MAAM,GAAG,SAAS,CAMvJ;AAED,yGAAyG;AACzG,wBAAsB,yCAAyC,CAC7D,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,wBAA6B,GAClC,OAAO,CAAC,yBAAyB,CAAC,CAEpC"}
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
// buys exactly nothing rather than being trusted because it exists.
|
|
17
17
|
//
|
|
18
18
|
// WHAT THIS DELIBERATELY DOES NOT DO:
|
|
19
|
-
// • parse the certificate
|
|
19
|
+
// • parse the certificate in the synchronous path — `transportEvidenceWithClientKeyFromCf` (below) reads the key and
|
|
20
|
+
// the URI name out of the certificate, and only out of the one the handshake validated (spec 450 §5.2)
|
|
20
21
|
// • resolve a SPIFFE ID to an agent (that needs a signed WorkloadIdentityBinding, spec 339 §11)
|
|
21
22
|
// • decide anything
|
|
23
|
+
import { clientCertificateKeyEvidence, decodeForwardedCertificate, sha256Hex } from './client-certificate.js';
|
|
22
24
|
const norm = (v) => v?.trim().toLowerCase().replace(/^sha256:/, '');
|
|
23
25
|
/**
|
|
24
26
|
* Map a Cloudflare request's TLS client-auth result to admission evidence.
|
|
@@ -69,4 +71,50 @@ export function cfTlsClientAuthOf(request) {
|
|
|
69
71
|
export function transportEvidenceFromRequest(request, opts = {}) {
|
|
70
72
|
return transportEvidenceFromCf(cfTlsClientAuthOf(request), opts);
|
|
71
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Transport evidence plus, when the handshake proved it, the RFC 7638 thumbprint of the client certificate's key
|
|
76
|
+
* (`clientPublicKeyJwkThumbprint`), its SPKI hash and its one `spiffe://` / `wimse://` URI name (`workloadIdentifier`).
|
|
77
|
+
*
|
|
78
|
+
* The key facts are added ONLY when all of these hold: Cloudflare says a certificate was presented, verified
|
|
79
|
+
* (`SUCCESS`), not revoked and in its window; the certificate bytes decode and parse; and their SHA-256 equals
|
|
80
|
+
* `certFingerprintSHA256`. Any other case returns the evidence `transportEvidenceFromCf` returns — no thumbprint, no
|
|
81
|
+
* identifier, no throw. The engine then confirms no workload binding (`WORKLOAD_KEY_MISMATCH` /
|
|
82
|
+
* no identifier), which is the fail-closed answer.
|
|
83
|
+
*/
|
|
84
|
+
export async function transportEvidenceWithClientKeyFromCf(tls, certificate, opts = {}) {
|
|
85
|
+
const base = transportEvidenceFromCf(tls, opts);
|
|
86
|
+
if (!base.mtls || base.validation.certificateValid !== true)
|
|
87
|
+
return base;
|
|
88
|
+
const handshakeFingerprint = norm(tls?.certFingerprintSHA256);
|
|
89
|
+
if (!handshakeFingerprint || !/^[0-9a-f]{64}$/.test(handshakeFingerprint))
|
|
90
|
+
return base;
|
|
91
|
+
const der = decodeForwardedCertificate(certificate);
|
|
92
|
+
if (!der)
|
|
93
|
+
return base;
|
|
94
|
+
let keyEvidence;
|
|
95
|
+
try {
|
|
96
|
+
if ((await sha256Hex(der)) !== handshakeFingerprint)
|
|
97
|
+
return base;
|
|
98
|
+
keyEvidence = await clientCertificateKeyEvidence(der);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return base;
|
|
102
|
+
}
|
|
103
|
+
if (!keyEvidence)
|
|
104
|
+
return base;
|
|
105
|
+
return { ...base, ...keyEvidence };
|
|
106
|
+
}
|
|
107
|
+
/** The certificate bytes from the ONE configured source (see `ClientKeyEvidenceOptions.clientCertificateHeader`). */
|
|
108
|
+
export function forwardedClientCertificateOf(request, opts = {}) {
|
|
109
|
+
if (opts.clientCertificateHeader !== undefined) {
|
|
110
|
+
if (typeof opts.clientCertificateHeader !== 'string' || opts.clientCertificateHeader.trim() === '')
|
|
111
|
+
return undefined;
|
|
112
|
+
return request.headers.get(opts.clientCertificateHeader) ?? undefined;
|
|
113
|
+
}
|
|
114
|
+
return cfTlsClientAuthOf(request)?.certRFC9440 || undefined;
|
|
115
|
+
}
|
|
116
|
+
/** `transportEvidenceWithClientKeyFromCf` straight off a request. Always resolves — HTTPS at minimum. */
|
|
117
|
+
export async function transportEvidenceWithClientKeyFromRequest(request, opts = {}) {
|
|
118
|
+
return transportEvidenceWithClientKeyFromCf(cfTlsClientAuthOf(request), forwardedClientCertificateOf(request, opts), opts);
|
|
119
|
+
}
|
|
72
120
|
//# sourceMappingURL=transport-evidence.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport-evidence.js","sourceRoot":"","sources":["../src/transport-evidence.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,mGAAmG;AACnG,qGAAqG;AACrG,qGAAqG;AACrG,+EAA+E;AAC/E,EAAE;AACF,qFAAqF;AACrF,mGAAmG;AACnG,qGAAqG;AACrG,gGAAgG;AAChG,EAAE;AACF,mGAAmG;AACnG,iGAAiG;AACjG,mGAAmG;AACnG,oEAAoE;AACpE,EAAE;AACF,sCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"transport-evidence.js","sourceRoot":"","sources":["../src/transport-evidence.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,mGAAmG;AACnG,qGAAq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EAAE;IACjI,IAAI,IAAI,CAAC,uBAAuB,KAAK,SAAS,EAAE,CAAC;QAC/C,IAAI,OAAO,IAAI,CAAC,uBAAuB,KAAK,QAAQ,IAAI,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,OAAO,SAAS,CAAC;QACrH,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,SAAS,CAAC;IACxE,CAAC;IACD,OAAO,iBAAiB,CAAC,OAAO,CAAC,EAAE,WAAW,IAAI,SAAS,CAAC;AAC9D,CAAC;AAED,yGAAyG;AACzG,MAAM,CAAC,KAAK,UAAU,yCAAyC,CAC7D,OAAgB,EAChB,OAAiC,EAAE;IAEnC,OAAO,oCAAoC,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAC7H,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/edge-cloudflare",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.25",
|
|
4
4
|
"description": "Cloudflare adapter for @agenticprimitives/edge-runtime: Request→AdmissionRequest extraction (exact-byte preserving), the Workers rate-limiter binding as a SoftRateLimiter, and Service-Binding dispatch. Imports the platform runtime; the edge core never does.",
|
|
5
5
|
"homepage": "https://agenticprimitives.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -36,14 +36,16 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@agenticprimitives/surface-catalog": "^0.0.0-alpha.6",
|
|
39
|
-
"@agenticprimitives/edge-runtime": "^0.0.0-alpha.
|
|
39
|
+
"@agenticprimitives/edge-runtime": "^0.0.0-alpha.25",
|
|
40
40
|
"@agenticprimitives/rate-control": "^0.0.0-alpha.6"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"vitest": "^4.1.11",
|
|
44
|
+
"viem": "^2.52.2",
|
|
44
45
|
"@agenticprimitives/surface-catalog": "0.0.0-alpha.6",
|
|
45
|
-
"@agenticprimitives/edge-runtime": "0.0.0-alpha.
|
|
46
|
-
"@agenticprimitives/rate-control": "0.0.0-alpha.6"
|
|
46
|
+
"@agenticprimitives/edge-runtime": "0.0.0-alpha.25",
|
|
47
|
+
"@agenticprimitives/rate-control": "0.0.0-alpha.6",
|
|
48
|
+
"@agenticprimitives/agent-profile": "1.0.0-alpha.50"
|
|
47
49
|
},
|
|
48
50
|
"keywords": [
|
|
49
51
|
"agentic",
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
"agentic-trust"
|
|
59
61
|
],
|
|
60
62
|
"dependencies": {
|
|
61
|
-
"@agenticprimitives/admission": "0.0.0-alpha.
|
|
63
|
+
"@agenticprimitives/admission": "0.0.0-alpha.24"
|
|
62
64
|
},
|
|
63
65
|
"scripts": {
|
|
64
66
|
"build": "tsc -p tsconfig.build.json",
|