@akai-workflow-builder/cli-sdk 0.1.16 → 0.2.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/CHANGELOG.md +29 -0
- package/dist/ctx/build-ctx.d.ts.map +1 -1
- package/dist/ctx/build-ctx.js +27 -1
- package/dist/ctx/safe-fetch.d.ts +11 -0
- package/dist/ctx/safe-fetch.d.ts.map +1 -1
- package/dist/ctx/safe-fetch.js +92 -1
- package/dist/define-cli.d.ts.map +1 -1
- package/dist/define-cli.js +26 -0
- package/dist/define-connection.d.ts.map +1 -1
- package/dist/define-connection.js +71 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/manifest/index.d.ts +1 -1
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/manifest/json-schema.d.ts +4 -0
- package/dist/manifest/json-schema.d.ts.map +1 -1
- package/dist/manifest/json-schema.js +37 -0
- package/dist/manifest/to-schema.js +10 -1
- package/dist/manifest/types.d.ts +15 -0
- package/dist/manifest/types.d.ts.map +1 -1
- package/dist/tool.d.ts.map +1 -1
- package/dist/tool.js +29 -1
- package/dist/types.d.ts +70 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,35 @@ All notable changes to `@akai-workflow-builder/cli-sdk` are documented here.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [0.2.0](https://github.com/akai-workflow-builder/akai-cli-sdk/compare/cli-sdk-v0.1.17...cli-sdk-v0.2.0) (2026-07-21)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **ctx:** mutual-TLS client certificates via network.clientCert (v0.1.15) ([#49](https://github.com/akai-workflow-builder/akai-cli-sdk/issues/49)) ([4579aae](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/4579aaeede18f3d77433d3714ed42883bec34e81))
|
|
13
|
+
* **errors:** AkaiToolError.fromHttpStatus + describeError helpers ([#48](https://github.com/akai-workflow-builder/akai-cli-sdk/issues/48)) ([dc13816](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/dc13816db7cfbf591a4be3b222db5bf97ae00aad))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **ci:** let semantic-release manage npm auth ([#55](https://github.com/akai-workflow-builder/akai-cli-sdk/issues/55)) ([be167bc](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/be167bc488e6809e8b7b596ccb4ac90674da3bda))
|
|
19
|
+
|
|
20
|
+
## [0.1.17] - 2026-07-02
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- `NetworkOptions.clientCert` — mutual-TLS client identity for tools whose
|
|
25
|
+
upstream demands a client certificate on the TLS handshake (e.g. ADP /
|
|
26
|
+
MasterTax web services). Declared by secret-key reference
|
|
27
|
+
(`{ certSecretKey, keySecretKey }`, both PEM secrets); `defineCLI()`
|
|
28
|
+
cross-checks the keys against `secrets[]` and the tool's `secretKeys`,
|
|
29
|
+
`buildCtx()` resolves the values and fails closed (`AkaiSecretError`) when
|
|
30
|
+
either is unset, and `ctx.fetch` presents the identity on every request via
|
|
31
|
+
a `node:https`-backed transport (no new dependencies). The safe-fetch init
|
|
32
|
+
allow-list is unchanged — handlers still cannot supply TLS material or
|
|
33
|
+
dispatchers through `init`. Emitted on the manifest as the optional
|
|
34
|
+
`clientCert` field of http tools (additive; no `$schemaVersion` bump).
|
|
35
|
+
|
|
7
36
|
## [0.1.8] - 2026-06-17
|
|
8
37
|
|
|
9
38
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-ctx.d.ts","sourceRoot":"","sources":["../../src/ctx/build-ctx.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YA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MAAM,CAAC;IAC1B,6GAA6G;IAC7G,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,sGAAsG;IACtG,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,8CAA8C;IAC9C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AA4ED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CA8DxD"}
|
package/dist/ctx/build-ctx.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createSafePath } from './safe-path.js';
|
|
|
4
4
|
import { buildScopedProperties, buildScopedSecrets, } from './secrets.js';
|
|
5
5
|
import { createReadFile } from './read-file.js';
|
|
6
6
|
import { createWriteFile, unavailableWriteFile } from './write-file.js';
|
|
7
|
-
import { AkaiSpecError } from '../errors.js';
|
|
7
|
+
import { AkaiSecretError, AkaiSpecError } from '../errors.js';
|
|
8
8
|
function resolveTool(cli, toolName) {
|
|
9
9
|
const t = cli.tools[toolName];
|
|
10
10
|
if (!t) {
|
|
@@ -23,6 +23,30 @@ function staticEgress(egress, cliId, toolName) {
|
|
|
23
23
|
const dyn = egress;
|
|
24
24
|
throw new AkaiSpecError(`buildCtx: tool \`${cliId}.${toolName}\` declares dynamic egress (${dyn.from}); SDK-side resolution is not implemented. Resolve at the host runtime and pass a static egress list before constructing ctx.`);
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolve a tool's `network.clientCert` secret-key references to PEM values
|
|
28
|
+
* from the tool-scoped secret record. Fails closed: a tool that declares
|
|
29
|
+
* `clientCert` never runs with one-way TLS — an unset cert or key throws
|
|
30
|
+
* `AkaiSecretError` before the handler is invoked, mirroring how required
|
|
31
|
+
* secrets fail. `defineCLI()` guarantees the keys are in the tool's
|
|
32
|
+
* `secretKeys` (so they exist on the scoped record); this guard also covers
|
|
33
|
+
* hand-built CLIDefs that skipped that validation.
|
|
34
|
+
*/
|
|
35
|
+
function resolveClientCert(tool, secrets, cliId, toolName) {
|
|
36
|
+
const ref = tool.options.network?.clientCert;
|
|
37
|
+
if (ref === undefined)
|
|
38
|
+
return undefined;
|
|
39
|
+
const cert = secrets[ref.certSecretKey];
|
|
40
|
+
const key = secrets[ref.keySecretKey];
|
|
41
|
+
if (!cert || !key) {
|
|
42
|
+
const missing = [
|
|
43
|
+
...(cert ? [] : [ref.certSecretKey]),
|
|
44
|
+
...(key ? [] : [ref.keySecretKey]),
|
|
45
|
+
];
|
|
46
|
+
throw new AkaiSecretError(`buildCtx: tool \`${cliId}.${toolName}\` requires a mutual-TLS client certificate but secret(s) ${missing.join(', ')} are unset — set them on the connection`, { cliId, toolName, missing });
|
|
47
|
+
}
|
|
48
|
+
return { cert, key };
|
|
49
|
+
}
|
|
26
50
|
/**
|
|
27
51
|
* Native tools have no network surface — `ctx.fetch` is wired to a
|
|
28
52
|
* throwing stub so an accidental call surfaces as a clear error rather
|
|
@@ -57,6 +81,7 @@ export function buildCtx(params) {
|
|
|
57
81
|
const tool = resolveTool(params.cli, params.toolName);
|
|
58
82
|
const secrets = buildScopedSecrets(params.cli.secrets, tool.options.secretKeys, params.secretValues, { oauthPresent: typeof params.oauthAccessToken === 'string' && params.oauthAccessToken !== '' });
|
|
59
83
|
const properties = buildScopedProperties(params.cli.properties, tool.options.propertyKeys, params.propertyValues ?? {});
|
|
84
|
+
const clientCert = resolveClientCert(tool, secrets, params.cli.id, params.toolName);
|
|
60
85
|
const fetch = tool.transport === 'native' || tool.options.network === undefined
|
|
61
86
|
? nativeFetch
|
|
62
87
|
: createSafeFetch({
|
|
@@ -65,6 +90,7 @@ export function buildCtx(params) {
|
|
|
65
90
|
toolName: params.toolName,
|
|
66
91
|
sdkVersion: params.sdkVersion,
|
|
67
92
|
...(params.tenantId !== undefined ? { tenantId: params.tenantId } : {}),
|
|
93
|
+
...(clientCert !== undefined ? { clientCert } : {}),
|
|
68
94
|
});
|
|
69
95
|
const safePath = createSafePath([
|
|
70
96
|
params.workdir,
|
package/dist/ctx/safe-fetch.d.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolved mutual-TLS client identity — PEM values, not secret-key
|
|
3
|
+
* references. `buildCtx()` resolves `NetworkOptions.clientCert` key refs
|
|
4
|
+
* against the tool-scoped secrets and passes the values here; handlers
|
|
5
|
+
* never see or supply TLS material through `init`.
|
|
6
|
+
*/
|
|
7
|
+
export interface ResolvedClientCert {
|
|
8
|
+
readonly cert: string;
|
|
9
|
+
readonly key: string;
|
|
10
|
+
}
|
|
1
11
|
export interface SafeFetchBinding {
|
|
2
12
|
readonly egress: readonly string[];
|
|
3
13
|
readonly cliId: string;
|
|
4
14
|
readonly toolName: string;
|
|
5
15
|
readonly sdkVersion: string;
|
|
6
16
|
readonly tenantId?: string;
|
|
17
|
+
readonly clientCert?: ResolvedClientCert;
|
|
7
18
|
}
|
|
8
19
|
export type SafeFetch = (url: string, init?: RequestInit) => Promise<Response>;
|
|
9
20
|
export declare function createSafeFetch(binding: SafeFetchBinding): SafeFetch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-fetch.d.ts","sourceRoot":"","sources":["../../src/ctx/safe-fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safe-fetch.d.ts","sourceRoot":"","sources":["../../src/ctx/safe-fetch.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;CAC1C;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAyG/E,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAkGpE"}
|
package/dist/ctx/safe-fetch.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { promises as dns } from 'node:dns';
|
|
2
|
+
import { request as httpsRequest } from 'node:https';
|
|
2
3
|
import { isIPv4, isIPv6 } from 'node:net';
|
|
3
4
|
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { Readable } from 'node:stream';
|
|
4
6
|
import { AkaiEgressError } from '../errors.js';
|
|
5
7
|
// Collapse expanded / partially compressed / leading-zero IPv6 forms to
|
|
6
8
|
// RFC 5952 via WHATWG URL (Ada in Node 24). `dns.lookup` passes numeric
|
|
@@ -101,7 +103,7 @@ const FORWARDED_INIT_FIELDS = [
|
|
|
101
103
|
'referrerPolicy',
|
|
102
104
|
];
|
|
103
105
|
export function createSafeFetch(binding) {
|
|
104
|
-
const { egress, cliId, toolName, sdkVersion, tenantId } = binding;
|
|
106
|
+
const { egress, cliId, toolName, sdkVersion, tenantId, clientCert } = binding;
|
|
105
107
|
return async function safeFetch(rawUrl, init = {}) {
|
|
106
108
|
// Coerce once. Otherwise `new URL(rawUrl)` (for validation) and
|
|
107
109
|
// `fetch(rawUrl, …)` would invoke `Symbol.toPrimitive`/`toString` twice,
|
|
@@ -178,6 +180,95 @@ export function createSafeFetch(binding) {
|
|
|
178
180
|
const duplex = init.duplex;
|
|
179
181
|
if (duplex !== undefined)
|
|
180
182
|
sanitized.duplex = duplex;
|
|
183
|
+
// Mutual TLS: the client identity comes from the binding (secret values
|
|
184
|
+
// resolved by buildCtx) — never from `init`, which keeps the
|
|
185
|
+
// FORWARDED_INIT_FIELDS allow-list authoritative. Node's global fetch
|
|
186
|
+
// cannot present a client cert (no public dispatcher/Agent surface), so
|
|
187
|
+
// this path rides `node:https` — same TLS stack, zero dependencies —
|
|
188
|
+
// and adapts back to a standard `Response`. Dev-mode `http:` URLs fall
|
|
189
|
+
// through to plain fetch: there is no TLS handshake to present a cert on.
|
|
190
|
+
if (clientCert !== undefined && u.protocol === 'https:') {
|
|
191
|
+
return mtlsFetch(u, sanitized, clientCert);
|
|
192
|
+
}
|
|
181
193
|
return fetch(url, sanitized);
|
|
182
194
|
};
|
|
183
195
|
}
|
|
196
|
+
/** Response statuses that must not carry a body (Response ctor throws otherwise). */
|
|
197
|
+
const NULL_BODY_STATUSES = new Set([204, 205, 304]);
|
|
198
|
+
/**
|
|
199
|
+
* Minimal fetch-over-`node:https` used only for mutual-TLS requests. Parity
|
|
200
|
+
* notes vs global fetch:
|
|
201
|
+
* - `redirect: 'error'` semantics are enforced by rejecting on any 3xx with
|
|
202
|
+
* a Location header (https.request never follows redirects itself).
|
|
203
|
+
* - The request body is serialized by round-tripping through `new Response()`,
|
|
204
|
+
* which applies WHATWG body extraction — FormData multipart boundaries,
|
|
205
|
+
* URLSearchParams/Blob content-types — identically to fetch. Bodies are
|
|
206
|
+
* buffered, not streamed (fine for the ≤tens-of-MB payloads tools move).
|
|
207
|
+
* - No `accept-encoding` is sent, so upstreams respond uncompressed; if one
|
|
208
|
+
* compresses anyway the raw bytes surface with `content-encoding` intact.
|
|
209
|
+
*/
|
|
210
|
+
async function mtlsFetch(url, init, identity) {
|
|
211
|
+
const headers = init.headers;
|
|
212
|
+
const method = (init.method ?? 'GET').toUpperCase();
|
|
213
|
+
let body;
|
|
214
|
+
if (init.body !== undefined && init.body !== null) {
|
|
215
|
+
// `BodyInit` is not a global under @types/node — name it via the ctor.
|
|
216
|
+
const carrier = new Response(init.body);
|
|
217
|
+
const carrierType = carrier.headers.get('content-type');
|
|
218
|
+
if (carrierType !== null && !headers.has('content-type')) {
|
|
219
|
+
headers.set('content-type', carrierType);
|
|
220
|
+
}
|
|
221
|
+
body = Buffer.from(await carrier.arrayBuffer());
|
|
222
|
+
// Pin content-length so the wire never falls back to chunked
|
|
223
|
+
// transfer-encoding, which some enterprise gateways reject.
|
|
224
|
+
headers.set('content-length', String(body.byteLength));
|
|
225
|
+
}
|
|
226
|
+
const headerRecord = {};
|
|
227
|
+
headers.forEach((value, name) => {
|
|
228
|
+
headerRecord[name] = value;
|
|
229
|
+
});
|
|
230
|
+
return new Promise((resolve, reject) => {
|
|
231
|
+
const req = httpsRequest(url, {
|
|
232
|
+
method,
|
|
233
|
+
headers: headerRecord,
|
|
234
|
+
cert: identity.cert,
|
|
235
|
+
key: identity.key,
|
|
236
|
+
...(init.signal ? { signal: init.signal } : {}),
|
|
237
|
+
}, (res) => {
|
|
238
|
+
// Synchronous throws in here (e.g. Response rejecting an interim
|
|
239
|
+
// status) must reject the fetch promise, not escape into http's
|
|
240
|
+
// event handling.
|
|
241
|
+
try {
|
|
242
|
+
const status = res.statusCode ?? 0;
|
|
243
|
+
if (status >= 300 && status < 400 && res.headers.location !== undefined) {
|
|
244
|
+
res.resume();
|
|
245
|
+
reject(new AkaiEgressError(`safe-fetch: refusing redirect (${status}) on mutual-TLS request to ${url.hostname}`, { hostname: url.hostname, status }));
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
// rawHeaders (flat name/value pairs) preserves repeated headers like
|
|
249
|
+
// set-cookie that the object form would join lossily.
|
|
250
|
+
const resHeaders = new Headers();
|
|
251
|
+
for (let i = 0; i + 1 < res.rawHeaders.length; i += 2) {
|
|
252
|
+
resHeaders.append(res.rawHeaders[i], res.rawHeaders[i + 1]);
|
|
253
|
+
}
|
|
254
|
+
const nullBody = NULL_BODY_STATUSES.has(status) || method === 'HEAD';
|
|
255
|
+
if (nullBody)
|
|
256
|
+
res.resume();
|
|
257
|
+
// node:stream/web's ReadableStream and lib.dom's are the same object
|
|
258
|
+
// at runtime but distinct nominal types — bridge via unknown.
|
|
259
|
+
const bodyStream = nullBody ? null : Readable.toWeb(res);
|
|
260
|
+
resolve(new Response(bodyStream, {
|
|
261
|
+
status,
|
|
262
|
+
statusText: res.statusMessage ?? '',
|
|
263
|
+
headers: resHeaders,
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
266
|
+
catch (err) {
|
|
267
|
+
res.resume();
|
|
268
|
+
reject(err);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
req.on('error', reject);
|
|
272
|
+
req.end(body);
|
|
273
|
+
});
|
|
274
|
+
}
|
package/dist/define-cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-cli.d.ts","sourceRoot":"","sources":["../src/define-cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,MAAM,EAAE,OAAO,EAA4B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"define-cli.d.ts","sourceRoot":"","sources":["../src/define-cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,MAAM,EAAE,OAAO,EAA4B,MAAM,YAAY,CAAC;AAmPxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAmD/C"}
|
package/dist/define-cli.js
CHANGED
|
@@ -193,6 +193,32 @@ const CLISpecShape = z
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
+
// Mutual-TLS client identity: both referenced keys must be declared in
|
|
197
|
+
// `secrets[]` AND in the tool's `secretKeys` — buildCtx resolves the PEM
|
|
198
|
+
// values from the tool-scoped secret record, so a key missing from
|
|
199
|
+
// either set could never resolve.
|
|
200
|
+
const clientCert = t.options.network?.clientCert;
|
|
201
|
+
if (clientCert !== undefined) {
|
|
202
|
+
for (const [field, key] of [
|
|
203
|
+
['certSecretKey', clientCert.certSecretKey],
|
|
204
|
+
['keySecretKey', clientCert.keySecretKey],
|
|
205
|
+
]) {
|
|
206
|
+
if (!declaredSecrets.has(key)) {
|
|
207
|
+
ctx.addIssue({
|
|
208
|
+
code: 'custom',
|
|
209
|
+
path: ['tools', name, 'options', 'network', 'clientCert', field],
|
|
210
|
+
message: `tool '${name}' clientCert references secret '${key}' but '${key}' is not declared in defineCLI({ secrets })`,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (!t.options.secretKeys.includes(key)) {
|
|
214
|
+
ctx.addIssue({
|
|
215
|
+
code: 'custom',
|
|
216
|
+
path: ['tools', name, 'options', 'network', 'clientCert', field],
|
|
217
|
+
message: `tool '${name}' clientCert references secret '${key}' but '${key}' is not in the tool's secretKeys`,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
196
222
|
}
|
|
197
223
|
});
|
|
198
224
|
function throwSpecError(error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-connection.d.ts","sourceRoot":"","sources":["../src/define-connection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAEb,cAAc,EAGf,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"define-connection.d.ts","sourceRoot":"","sources":["../src/define-connection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAEb,cAAc,EAGf,MAAM,YAAY,CAAC;AAwPpB,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAE/D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa,CA2EpE"}
|
|
@@ -10,6 +10,7 @@ const SecretDeclShape = z.object({
|
|
|
10
10
|
key: z.string().regex(ADMIN_KEY_RE, { error: 'secrets[i].key must be UPPER_SNAKE (e.g. APP_TOKEN)' }),
|
|
11
11
|
injected: z.boolean().optional(),
|
|
12
12
|
adminManaged: z.boolean().optional(),
|
|
13
|
+
serverOnly: z.boolean().optional(),
|
|
13
14
|
});
|
|
14
15
|
const UrlString = z
|
|
15
16
|
.string({ error: 'must be a string' })
|
|
@@ -30,7 +31,29 @@ const UrlString = z
|
|
|
30
31
|
catch {
|
|
31
32
|
return false;
|
|
32
33
|
}
|
|
33
|
-
},
|
|
34
|
+
},
|
|
35
|
+
// Shared by authorizeUrl/tokenUrl (oauth) and jwtRefresh.envs[i].refreshUrl — the failing
|
|
36
|
+
// field's path is already carried on the issue, so keep this message field-agnostic.
|
|
37
|
+
{ error: 'must be an https URL' });
|
|
38
|
+
const JwtRefreshEnvShape = z.object({
|
|
39
|
+
env: z.string().min(1, { error: 'jwtRefresh.envs[i].env is required' }),
|
|
40
|
+
accessKey: z.string().regex(ADMIN_KEY_RE, { error: 'jwtRefresh.envs[i].accessKey must be UPPER_SNAKE' }),
|
|
41
|
+
refreshKey: z.string().regex(ADMIN_KEY_RE, { error: 'jwtRefresh.envs[i].refreshKey must be UPPER_SNAKE' }),
|
|
42
|
+
refreshUrl: UrlString,
|
|
43
|
+
});
|
|
44
|
+
const JwtRefreshShape = z.object({
|
|
45
|
+
name: z.string().min(1, { error: 'jwtRefresh.name is required' }),
|
|
46
|
+
envs: z
|
|
47
|
+
.array(JwtRefreshEnvShape, { error: 'jwtRefresh.envs must be an array' })
|
|
48
|
+
.min(1, { error: 'jwtRefresh.envs must declare at least one env' }),
|
|
49
|
+
defaultAtTtlMs: z.number().int().positive({ error: 'jwtRefresh.defaultAtTtlMs must be a positive integer' }).optional(),
|
|
50
|
+
revocationBackoffMs: z
|
|
51
|
+
.number()
|
|
52
|
+
.int()
|
|
53
|
+
.positive({ error: 'jwtRefresh.revocationBackoffMs must be a positive integer' })
|
|
54
|
+
.optional(),
|
|
55
|
+
claimTtlSeconds: z.number().int().positive({ error: 'jwtRefresh.claimTtlSeconds must be a positive integer' }).optional(),
|
|
56
|
+
});
|
|
34
57
|
const OAuthAdminFieldShape = z.object({
|
|
35
58
|
key: z
|
|
36
59
|
.string({ error: 'key is required' })
|
|
@@ -119,6 +142,10 @@ const ConnectionSpecShape = z
|
|
|
119
142
|
error: 'authKind must be one of apiKey, oauth2, none',
|
|
120
143
|
}),
|
|
121
144
|
oauth: ConnectionOAuthConfigShape.optional(),
|
|
145
|
+
jwtRefresh: JwtRefreshShape.optional(),
|
|
146
|
+
hidden: z.boolean({ error: 'hidden must be a boolean if provided' }).optional(),
|
|
147
|
+
internal: z.boolean({ error: 'internal must be a boolean if provided' }).optional(),
|
|
148
|
+
nativeBuiltin: z.boolean({ error: 'nativeBuiltin must be a boolean if provided' }).optional(),
|
|
122
149
|
})
|
|
123
150
|
.superRefine((spec, ctx) => {
|
|
124
151
|
if (spec.secrets) {
|
|
@@ -130,6 +157,35 @@ const ConnectionSpecShape = z
|
|
|
130
157
|
seen.add(s.key);
|
|
131
158
|
}
|
|
132
159
|
}
|
|
160
|
+
// jwtRefresh is the non-OAuth refresh mechanism — oauth2 refreshes via `oauth`, so they're
|
|
161
|
+
// mutually exclusive. Also require every referenced token key to be a declared secret, so a
|
|
162
|
+
// typo can't produce a refresher pointed at a credential that will never exist.
|
|
163
|
+
if (spec.jwtRefresh) {
|
|
164
|
+
if (spec.authKind === 'oauth2') {
|
|
165
|
+
ctx.addIssue({ code: 'custom', path: ['jwtRefresh'], message: "jwtRefresh must not be set when authKind is 'oauth2' (use oauth)" });
|
|
166
|
+
}
|
|
167
|
+
const byKey = new Map((spec.secrets ?? []).map((s) => [s.key, s]));
|
|
168
|
+
for (const [i, e] of spec.jwtRefresh.envs.entries()) {
|
|
169
|
+
// Point the issue at the specific field (accessKey/refreshKey), not just the env — only the
|
|
170
|
+
// first Zod issue is surfaced, so a precise path makes the failure directly actionable.
|
|
171
|
+
for (const field of ['accessKey', 'refreshKey']) {
|
|
172
|
+
if (!byKey.has(e[field])) {
|
|
173
|
+
ctx.addIssue({ code: 'custom', path: ['jwtRefresh', 'envs', i, field], message: `references secret '${e[field]}' that is not declared in secrets[]` });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// The refresh token is long-lived and mints access tokens — it MUST be `serverOnly` so the
|
|
177
|
+
// host rotates it and never ships it to the worker as a user credential. A declared-but-not
|
|
178
|
+
// -serverOnly refreshKey would leak the refresh token to the worker, so fail fast here.
|
|
179
|
+
const refreshSecret = byKey.get(e.refreshKey);
|
|
180
|
+
if (refreshSecret && !refreshSecret.serverOnly) {
|
|
181
|
+
ctx.addIssue({
|
|
182
|
+
code: 'custom',
|
|
183
|
+
path: ['jwtRefresh', 'envs', i, 'refreshKey'],
|
|
184
|
+
message: `refreshKey '${e.refreshKey}' must reference a secret declared with serverOnly: true`,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
133
189
|
// apiKeyHeader names the header carrying the apiKey credential — only meaningful for authKind 'apiKey'.
|
|
134
190
|
if (spec.authKind !== 'apiKey' && spec.apiKeyHeader !== undefined) {
|
|
135
191
|
ctx.addIssue({ code: 'custom', path: ['apiKeyHeader'], message: `apiKeyHeader must not be set when authKind is '${spec.authKind}'` });
|
|
@@ -251,6 +307,20 @@ export function defineConnection(spec) {
|
|
|
251
307
|
...(v.hosts !== undefined ? { hosts: Object.freeze({ ...v.hosts }) } : {}),
|
|
252
308
|
authKind: v.authKind,
|
|
253
309
|
...(oauth !== undefined ? { oauth } : {}),
|
|
310
|
+
...(v.jwtRefresh !== undefined
|
|
311
|
+
? {
|
|
312
|
+
jwtRefresh: Object.freeze({
|
|
313
|
+
name: v.jwtRefresh.name,
|
|
314
|
+
envs: Object.freeze(v.jwtRefresh.envs.map((e) => Object.freeze({ ...e }))),
|
|
315
|
+
...(v.jwtRefresh.defaultAtTtlMs !== undefined ? { defaultAtTtlMs: v.jwtRefresh.defaultAtTtlMs } : {}),
|
|
316
|
+
...(v.jwtRefresh.revocationBackoffMs !== undefined ? { revocationBackoffMs: v.jwtRefresh.revocationBackoffMs } : {}),
|
|
317
|
+
...(v.jwtRefresh.claimTtlSeconds !== undefined ? { claimTtlSeconds: v.jwtRefresh.claimTtlSeconds } : {}),
|
|
318
|
+
}),
|
|
319
|
+
}
|
|
320
|
+
: {}),
|
|
321
|
+
...(v.hidden !== undefined ? { hidden: v.hidden } : {}),
|
|
322
|
+
...(v.internal !== undefined ? { internal: v.internal } : {}),
|
|
323
|
+
...(v.nativeBuiltin !== undefined ? { nativeBuiltin: v.nativeBuiltin } : {}),
|
|
254
324
|
};
|
|
255
325
|
Object.freeze(def);
|
|
256
326
|
CONNECTION_REGISTRY.add(def);
|
package/dist/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ export { buildScopedSecrets, buildScopedProperties } from './ctx/secrets.js';
|
|
|
6
6
|
export type { SecretValues, PropertyValues } from './ctx/secrets.js';
|
|
7
7
|
export { buildCtx } from './ctx/build-ctx.js';
|
|
8
8
|
export type { BuildCtxParams } from './ctx/build-ctx.js';
|
|
9
|
-
export type { AnyToolDef, CLIDef, CLISpec, ConnectionAuthKind, ConnectionDef, ConnectionOAuthConfig, ConnectionSpec, DynamicEgress, InputOf, NetworkOptions, OAuthAdminField, OutputOf, PropertiesOf, PropertyDecl, RefreshStrategy, SecretDecl, SecretsOf, TokenEndpointAuthMethod, ToolCtx, ToolDef, ToolLogger, ToolOptions, ToolSpec, } from './types.js';
|
|
9
|
+
export type { AnyToolDef, CLIDef, CLISpec, ClientCertOptions, ConnectionAuthKind, ConnectionDef, ConnectionOAuthConfig, ConnectionSpec, DynamicEgress, InputOf, NetworkOptions, OAuthAdminField, OutputOf, PropertiesOf, PropertyDecl, RefreshStrategy, SecretDecl, SecretsOf, TokenEndpointAuthMethod, ToolCtx, ToolDef, ToolLogger, ToolOptions, ToolSpec, } from './types.js';
|
|
10
10
|
export { createSafePath } from './ctx/safe-path.js';
|
|
11
11
|
export type { SafePath } from './ctx/safe-path.js';
|
|
12
12
|
export { AkaiConnectionError, AkaiEgressError, AkaiError, AkaiInputError, AkaiPathError, AkaiPropertyError, AkaiSecretError, AkaiSpecError, AkaiToolError, describeError, } from './errors.js';
|
|
13
13
|
export type { ToolErrorKind } from './errors.js';
|
|
14
14
|
export { ConnectionManifestSchema, ManifestJSONSchema, SCHEMA_VERSION, toSchema, validateManifest, } from './manifest/index.js';
|
|
15
|
-
export type { ConnectionManifest, DynamicEgressManifest, HttpToolManifest, ManifestProperty, ManifestSecret, NativeToolManifest, SchemaVersion, ToolManifest, } from './manifest/index.js';
|
|
15
|
+
export type { ClientCertManifest, ConnectionManifest, DynamicEgressManifest, HttpToolManifest, ManifestProperty, ManifestSecret, NativeToolManifest, SchemaVersion, ToolManifest, } from './manifest/index.js';
|
|
16
16
|
//# 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":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACjH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EA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,GACjB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
package/dist/manifest/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export { toSchema } from './to-schema.js';
|
|
|
2
2
|
export { ConnectionManifestSchema, ManifestJSONSchema, validateManifest, } from './json-schema.js';
|
|
3
3
|
export { SCHEMA_VERSION } from './constants.js';
|
|
4
4
|
export type { SchemaVersion } from './constants.js';
|
|
5
|
-
export type { ConnectionManifest, DynamicEgressManifest, HttpToolManifest, ManifestProperty, ManifestSecret, NativeToolManifest, ToolManifest, } from './types.js';
|
|
5
|
+
export type { ClientCertManifest, ConnectionManifest, DynamicEgressManifest, HttpToolManifest, ManifestProperty, ManifestSecret, NativeToolManifest, ToolManifest, } from './types.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,YAAY,CAAC"}
|
|
@@ -41,6 +41,10 @@ export declare const ConnectionManifestSchema: z.ZodObject<{
|
|
|
41
41
|
egress: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodObject<{
|
|
42
42
|
from: z.ZodString;
|
|
43
43
|
}, z.core.$strip>]>;
|
|
44
|
+
clientCert: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
certSecretKey: z.ZodString;
|
|
46
|
+
keySecretKey: z.ZodString;
|
|
47
|
+
}, z.core.$strip>>;
|
|
44
48
|
id: z.ZodString;
|
|
45
49
|
name: z.ZodNullable<z.ZodString>;
|
|
46
50
|
description: z.ZodNullable<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../src/manifest/json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../src/manifest/json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAwHrD;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoEnC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAsD,CAAC;AAExF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAE/D"}
|
|
@@ -60,10 +60,21 @@ const DynamicEgressSchema = z.object({
|
|
|
60
60
|
error: 'egress.from must match "property:<KEY>" or "secret:<KEY>" with KEY in upper-snake-case',
|
|
61
61
|
}),
|
|
62
62
|
});
|
|
63
|
+
// Mutual-TLS client identity by secret-key reference. Same shape the SDK
|
|
64
|
+
// accepts at spec time; keys are upper-snake-case secret keys.
|
|
65
|
+
const ClientCertManifestSchema = z.object({
|
|
66
|
+
certSecretKey: z.string().regex(/^[A-Z][A-Z0-9_]*$/, {
|
|
67
|
+
error: 'clientCert.certSecretKey must be an upper-snake-case secret key',
|
|
68
|
+
}),
|
|
69
|
+
keySecretKey: z.string().regex(/^[A-Z][A-Z0-9_]*$/, {
|
|
70
|
+
error: 'clientCert.keySecretKey must be an upper-snake-case secret key',
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
63
73
|
const HttpToolManifestSchema = z.object({
|
|
64
74
|
...ToolManifestBaseShape,
|
|
65
75
|
transport: z.literal('http'),
|
|
66
76
|
egress: z.union([z.array(z.string()).min(1), DynamicEgressSchema]),
|
|
77
|
+
clientCert: ClientCertManifestSchema.optional(),
|
|
67
78
|
});
|
|
68
79
|
const NativeToolManifestSchema = z.object({
|
|
69
80
|
...ToolManifestBaseShape,
|
|
@@ -152,6 +163,32 @@ export const ConnectionManifestSchema = ConnectionManifestBaseSchema.superRefine
|
|
|
152
163
|
}
|
|
153
164
|
}
|
|
154
165
|
}
|
|
166
|
+
// clientCert cross-check — mirrors defineCLI(): both referenced keys must
|
|
167
|
+
// be declared in manifest.secrets[] and in the tool's secretKeys.
|
|
168
|
+
for (let i = 0; i < m.tools.length; i++) {
|
|
169
|
+
const t = m.tools[i];
|
|
170
|
+
if (t.transport !== 'http' || t.clientCert === undefined)
|
|
171
|
+
continue;
|
|
172
|
+
for (const [field, key] of [
|
|
173
|
+
['certSecretKey', t.clientCert.certSecretKey],
|
|
174
|
+
['keySecretKey', t.clientCert.keySecretKey],
|
|
175
|
+
]) {
|
|
176
|
+
if (!declaredSecrets.has(key)) {
|
|
177
|
+
ctx.addIssue({
|
|
178
|
+
code: 'custom',
|
|
179
|
+
path: ['tools', i, 'clientCert', field],
|
|
180
|
+
message: `clientCert references secret '${key}' but '${key}' is not declared in manifest.secrets[]`,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
if (!t.secretKeys.includes(key)) {
|
|
184
|
+
ctx.addIssue({
|
|
185
|
+
code: 'custom',
|
|
186
|
+
path: ['tools', i, 'clientCert', field],
|
|
187
|
+
message: `clientCert references secret '${key}' but '${key}' is not in tools[${i}].secretKeys`,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
155
192
|
});
|
|
156
193
|
/**
|
|
157
194
|
* Published JSON Schema (Draft 2020-12) for the Connections manifest.
|
|
@@ -70,7 +70,8 @@ function toToolManifest(id, t) {
|
|
|
70
70
|
return native;
|
|
71
71
|
}
|
|
72
72
|
// http path. Validator guarantees options.network is defined when transport='http'.
|
|
73
|
-
const
|
|
73
|
+
const network = t.options.network;
|
|
74
|
+
const egress = network.egress;
|
|
74
75
|
// Property check (not `Array.isArray`) — `Array.isArray` returns
|
|
75
76
|
// `is unknown[]` which doesn't reliably narrow `readonly string[]` in
|
|
76
77
|
// strict mode. The discriminator on `DynamicEgress` is `from`.
|
|
@@ -79,6 +80,14 @@ function toToolManifest(id, t) {
|
|
|
79
80
|
...base,
|
|
80
81
|
transport: 'http',
|
|
81
82
|
egress: egressOut,
|
|
83
|
+
...(network.clientCert !== undefined
|
|
84
|
+
? {
|
|
85
|
+
clientCert: {
|
|
86
|
+
certSecretKey: network.clientCert.certSecretKey,
|
|
87
|
+
keySecretKey: network.clientCert.keySecretKey,
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
: {}),
|
|
82
91
|
};
|
|
83
92
|
return http;
|
|
84
93
|
}
|
package/dist/manifest/types.d.ts
CHANGED
|
@@ -73,6 +73,16 @@ interface BaseToolManifest {
|
|
|
73
73
|
export interface DynamicEgressManifest {
|
|
74
74
|
readonly from: `property:${string}` | `secret:${string}`;
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Mutual-TLS client identity by secret-key reference (mirrors
|
|
78
|
+
* {@link ClientCertOptions} from the SDK types). The host runtime resolves
|
|
79
|
+
* both keys from the connection's secrets at invocation time and presents
|
|
80
|
+
* them during the TLS handshake for every request the tool makes.
|
|
81
|
+
*/
|
|
82
|
+
export interface ClientCertManifest {
|
|
83
|
+
readonly certSecretKey: string;
|
|
84
|
+
readonly keySecretKey: string;
|
|
85
|
+
}
|
|
76
86
|
/**
|
|
77
87
|
* HTTP-transport tool. The only variant `cli.toSchema()` emits today —
|
|
78
88
|
* `'native'` is forward-compat for AKAI-1108.
|
|
@@ -90,6 +100,11 @@ export interface HttpToolManifest extends BaseToolManifest {
|
|
|
90
100
|
* a tenant property (for multi-tenant connectors).
|
|
91
101
|
*/
|
|
92
102
|
readonly egress: readonly string[] | DynamicEgressManifest;
|
|
103
|
+
/**
|
|
104
|
+
* Present when the upstream requires mutual TLS. Optional on the wire —
|
|
105
|
+
* manifests emitted before this field omit it; absent means one-way TLS.
|
|
106
|
+
*/
|
|
107
|
+
readonly clientCert?: ClientCertManifest;
|
|
93
108
|
}
|
|
94
109
|
/** Native-transport tool (AKAI-1108). No network egress; handler runs in-process. */
|
|
95
110
|
export interface NativeToolManifest extends BaseToolManifest {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/manifest/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB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AAM,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CA6D3E"}
|
package/dist/tool.js
CHANGED
|
@@ -57,7 +57,24 @@ const Egress = z.union([
|
|
|
57
57
|
], { error: 'must be a hostname, array of hostnames, or { from: "property:<KEY>" } / { from: "secret:<KEY>" }' });
|
|
58
58
|
const SecretKey = z.string({ error: 'invalid secret key' }).min(1, { error: 'invalid secret key' });
|
|
59
59
|
const PropertyKey = z.string({ error: 'invalid property key' }).min(1, { error: 'invalid property key' });
|
|
60
|
-
|
|
60
|
+
// Mutual-TLS client identity by secret-key reference. Keys are upper-snake-case
|
|
61
|
+
// like every other secret key; cross-checks against the CLI's declarations and
|
|
62
|
+
// the tool's own `secretKeys` happen in `defineCLI()`.
|
|
63
|
+
const SECRET_KEY_REF_RE = /^[A-Z][A-Z0-9_]*$/;
|
|
64
|
+
const ClientCertSecretKey = z
|
|
65
|
+
.string({ error: 'clientCert secret key must be a string like "MTAX_WS_CERT"' })
|
|
66
|
+
.regex(SECRET_KEY_REF_RE, {
|
|
67
|
+
error: (issue) => `invalid clientCert secret key ${JSON.stringify(issue.input)}: expected upper-snake-case`,
|
|
68
|
+
});
|
|
69
|
+
const ClientCertShape = z
|
|
70
|
+
.object({
|
|
71
|
+
certSecretKey: ClientCertSecretKey,
|
|
72
|
+
keySecretKey: ClientCertSecretKey,
|
|
73
|
+
}, { error: 'must be { certSecretKey: "<KEY>", keySecretKey: "<KEY>" }' })
|
|
74
|
+
.refine((c) => c.certSecretKey !== c.keySecretKey, {
|
|
75
|
+
error: 'certSecretKey and keySecretKey must reference different secrets',
|
|
76
|
+
});
|
|
77
|
+
const NetworkOptionsShape = z.object({ egress: Egress, clientCert: ClientCertShape.optional() });
|
|
61
78
|
const ToolOptionsShape = z.object({
|
|
62
79
|
// Optional at the schema level — cross-checked against `transport` in the
|
|
63
80
|
// outer `superRefine` so http tools still require network.
|
|
@@ -201,6 +218,14 @@ export function tool(spec) {
|
|
|
201
218
|
// validated by `EGRESS_REF_RE` so the runtime value matches
|
|
202
219
|
// the `property:${string} | secret:${string}` template-literal contract.
|
|
203
220
|
network.egress),
|
|
221
|
+
...(network.clientCert !== undefined
|
|
222
|
+
? {
|
|
223
|
+
clientCert: {
|
|
224
|
+
certSecretKey: network.clientCert.certSecretKey,
|
|
225
|
+
keySecretKey: network.clientCert.keySecretKey,
|
|
226
|
+
},
|
|
227
|
+
}
|
|
228
|
+
: {}),
|
|
204
229
|
},
|
|
205
230
|
}
|
|
206
231
|
: {}),
|
|
@@ -213,6 +238,9 @@ export function tool(spec) {
|
|
|
213
238
|
};
|
|
214
239
|
if (def.options.network !== undefined) {
|
|
215
240
|
Object.freeze(def.options.network.egress);
|
|
241
|
+
if (def.options.network.clientCert !== undefined) {
|
|
242
|
+
Object.freeze(def.options.network.clientCert);
|
|
243
|
+
}
|
|
216
244
|
Object.freeze(def.options.network);
|
|
217
245
|
}
|
|
218
246
|
Object.freeze(def.options.secretKeys);
|
package/dist/types.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface SecretDecl {
|
|
|
8
8
|
readonly key: string;
|
|
9
9
|
readonly injected?: boolean;
|
|
10
10
|
readonly adminManaged?: boolean;
|
|
11
|
+
readonly serverOnly?: boolean;
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* A non-sensitive tenant property declared at the CLI level. Use this for
|
|
@@ -43,6 +44,25 @@ export interface PropertyDecl {
|
|
|
43
44
|
export interface DynamicEgress {
|
|
44
45
|
readonly from: `property:${string}` | `secret:${string}`;
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Mutual-TLS client identity for a tool, by reference to CLI-declared
|
|
49
|
+
* secrets. The SDK — never the handler — resolves the referenced secret
|
|
50
|
+
* values (PEM strings) at `buildCtx()` time and presents them during the
|
|
51
|
+
* TLS handshake for every `ctx.fetch` call, so upstreams that require a
|
|
52
|
+
* client certificate (e.g. ADP web services) work without opening the
|
|
53
|
+
* `dispatcher` hole in the safe-fetch init allow-list.
|
|
54
|
+
*
|
|
55
|
+
* `defineCLI()` cross-checks both keys are declared in `secrets[]` and
|
|
56
|
+
* listed in the tool's `options.secretKeys`. `buildCtx()` fails closed
|
|
57
|
+
* (`AkaiSecretError`) when either value is unset — a tool that declares
|
|
58
|
+
* `clientCert` never silently falls back to one-way TLS.
|
|
59
|
+
*/
|
|
60
|
+
export interface ClientCertOptions {
|
|
61
|
+
/** Secret key holding the PEM-encoded client certificate (chain). */
|
|
62
|
+
readonly certSecretKey: string;
|
|
63
|
+
/** Secret key holding the PEM-encoded private key (unencrypted). */
|
|
64
|
+
readonly keySecretKey: string;
|
|
65
|
+
}
|
|
46
66
|
/**
|
|
47
67
|
* Network-egress allowlist for a tool. Either a static list of hostnames
|
|
48
68
|
* (matched exact-or-suffix-with-dot at runtime) or a {@link DynamicEgress}
|
|
@@ -50,6 +70,8 @@ export interface DynamicEgress {
|
|
|
50
70
|
*/
|
|
51
71
|
export interface NetworkOptions {
|
|
52
72
|
readonly egress: readonly string[] | DynamicEgress;
|
|
73
|
+
/** Present when the upstream requires mutual TLS. See {@link ClientCertOptions}. */
|
|
74
|
+
readonly clientCert?: ClientCertOptions;
|
|
53
75
|
}
|
|
54
76
|
/**
|
|
55
77
|
* How a tool executes. `'http'` (default) opens the network surface via
|
|
@@ -214,6 +236,9 @@ export interface CLIDef {
|
|
|
214
236
|
* `{ from: 'secret:KEY' }`) for tenant-URL connectors. Dynamic egress
|
|
215
237
|
* requires the referenced key be declared in the CLI's `properties[]` /
|
|
216
238
|
* `secrets[]` AND included in this tool's `propertyKeys` / `secretKeys`.
|
|
239
|
+
* - `network.clientCert` declares a mutual-TLS client identity by secret
|
|
240
|
+
* key reference ({@link ClientCertOptions}); both keys must be declared
|
|
241
|
+
* in the CLI's `secrets[]` AND included in this tool's `secretKeys`.
|
|
217
242
|
* - `transport` defaults to `'http'`. Set to `'native'` for in-process
|
|
218
243
|
* handlers (no network); then `options.network` becomes optional and
|
|
219
244
|
* `ctx.fetch` throws if called.
|
|
@@ -230,6 +255,7 @@ export interface ToolSpec<I extends ZodType, J extends ZodType | undefined = und
|
|
|
230
255
|
options: {
|
|
231
256
|
network?: {
|
|
232
257
|
egress: string | readonly string[] | DynamicEgress;
|
|
258
|
+
clientCert?: ClientCertOptions;
|
|
233
259
|
};
|
|
234
260
|
secretKeys?: readonly S[];
|
|
235
261
|
propertyKeys?: readonly P[];
|
|
@@ -385,6 +411,35 @@ export interface ConnectionOAuthConfig {
|
|
|
385
411
|
* surfaces on the Connections page and the auth kind — never the OAuth glue or
|
|
386
412
|
* UI cosmetics, which stay in akai-app keyed by slug.
|
|
387
413
|
*/
|
|
414
|
+
/** One environment's paired secret keys + refresh endpoint for a `jwtRefresh` connection. */
|
|
415
|
+
export interface JwtRefreshEnvSpec {
|
|
416
|
+
/** Human label for logs (e.g. 'production'). */
|
|
417
|
+
readonly env: string;
|
|
418
|
+
/** Secret key of the access-token row this env mints (declare it in `secrets` too). */
|
|
419
|
+
readonly accessKey: string;
|
|
420
|
+
/** Secret key of the refresh-token row this env rotates (declare it in `secrets` as `serverOnly`). */
|
|
421
|
+
readonly refreshKey: string;
|
|
422
|
+
/** HTTPS endpoint that exchanges the refresh token for a fresh access token. */
|
|
423
|
+
readonly refreshUrl: string;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Declarative background-refresh config for a non-OAuth connection whose access tokens are
|
|
427
|
+
* short-lived JWTs minted from a stored refresh token. SHAPE only — the provider-specific HTTP
|
|
428
|
+
* exchange stays host-side (akai-app), keyed by connection slug; this declares the token rows,
|
|
429
|
+
* endpoints, and timing the host's generic refresher drives. Not for `oauth2` (that uses `oauth`).
|
|
430
|
+
*/
|
|
431
|
+
export interface JwtRefreshSpec {
|
|
432
|
+
/** Unique refresher name — the host uses it as a claim key / log tag. */
|
|
433
|
+
readonly name: string;
|
|
434
|
+
/** Per-environment token rows + refresh endpoints (at least one). */
|
|
435
|
+
readonly envs: readonly JwtRefreshEnvSpec[];
|
|
436
|
+
/** Fallback access-token lifetime (ms) when neither the JWT `exp` nor `expires_in` is present. */
|
|
437
|
+
readonly defaultAtTtlMs?: number;
|
|
438
|
+
/** Backoff (ms) after a revocation-class failure. */
|
|
439
|
+
readonly revocationBackoffMs?: number;
|
|
440
|
+
/** Per-row refresh claim TTL (seconds). */
|
|
441
|
+
readonly claimTtlSeconds?: number;
|
|
442
|
+
}
|
|
388
443
|
export interface ConnectionSpec {
|
|
389
444
|
/**
|
|
390
445
|
* Stable connection id. Groups every CLI that declares
|
|
@@ -419,6 +474,17 @@ export interface ConnectionSpec {
|
|
|
419
474
|
* Declares the shape only — secret VALUES live in akai-app.
|
|
420
475
|
*/
|
|
421
476
|
oauth?: ConnectionOAuthConfig;
|
|
477
|
+
/**
|
|
478
|
+
* Background JWT-refresh config for a non-OAuth connection. SHAPE only — the HTTP exchange stays
|
|
479
|
+
* host-side, keyed by slug. Must not be set when `authKind` is `oauth2` (that uses `oauth`).
|
|
480
|
+
*/
|
|
481
|
+
jwtRefresh?: JwtRefreshSpec;
|
|
482
|
+
/** Governance: hide from the connections UI (a reserved/system connection). */
|
|
483
|
+
hidden?: boolean;
|
|
484
|
+
/** Governance: Deel-internal — the host omits it on external tenants. */
|
|
485
|
+
internal?: boolean;
|
|
486
|
+
/** Governance: auto-resolves without a user credential (no secrets + native transport). */
|
|
487
|
+
nativeBuiltin?: boolean;
|
|
422
488
|
}
|
|
423
489
|
/** A built connection. Opaque to consumers, introspectable by the SDK. Mirrors `CLIDef`. */
|
|
424
490
|
export interface ConnectionDef {
|
|
@@ -434,5 +500,9 @@ export interface ConnectionDef {
|
|
|
434
500
|
readonly hosts?: Readonly<Partial<Record<'production' | 'demo' | 'dev', string>>>;
|
|
435
501
|
readonly authKind: ConnectionAuthKind;
|
|
436
502
|
readonly oauth?: ConnectionOAuthConfig;
|
|
503
|
+
readonly jwtRefresh?: JwtRefreshSpec;
|
|
504
|
+
readonly hidden?: boolean;
|
|
505
|
+
readonly internal?: boolean;
|
|
506
|
+
readonly nativeBuiltin?: boolean;
|
|
437
507
|
}
|
|
438
508
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAG5B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAG5B,QAAQ,CAAC,Y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