@stigmer/outbound 0.4.1 → 0.4.2
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 +2 -2
- package/egress/index.d.ts +4 -2
- package/egress/index.d.ts.map +1 -1
- package/egress/index.js +4 -2
- package/egress/index.js.map +1 -1
- package/egress/trust.d.ts +25 -0
- package/egress/trust.d.ts.map +1 -0
- package/egress/trust.js +29 -0
- package/egress/trust.js.map +1 -0
- package/package.json +2 -2
- package/src/egress/index.ts +4 -2
- package/src/egress/trust.ts +31 -0
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @stigmer/outbound
|
|
2
2
|
|
|
3
|
-
The rules a Stigmer process follows when it dials a URL a user supplied, shared by the control plane (`@stigmer/server`), the runner (`@stigmer/runner`) and the catalogue audit (`plugins/scripts/audit`).
|
|
3
|
+
The rules a Stigmer process follows when it dials a URL a user supplied, and the variables a sandbox's processes trust its egress gateway by, shared by the control plane (`@stigmer/server`), the runner (`@stigmer/runner`) and the catalogue audit (`plugins/scripts/audit`).
|
|
4
4
|
|
|
5
5
|
Three entry points:
|
|
6
6
|
|
|
7
|
-
- `@stigmer/outbound/egress`: which addresses a process refuses to dial (`blockedReason`, two postures, `strict` for managed cloud processes and `relaxed` for a machine that belongs to the user), the check that applies a policy to a URL after resolving every address it has (`checkEgress`), and the fetch that applies it to every redirect hop and bounds every response body (`guardedFetch`). A process composes one guarded fetch at its root and hands it to every module that dials; the modules hold no `fetch` of their own.
|
|
7
|
+
- `@stigmer/outbound/egress`: which addresses a process refuses to dial (`blockedReason`, two postures, `strict` for managed cloud processes and `relaxed` for a machine that belongs to the user), the check that applies a policy to a URL after resolving every address it has (`checkEgress`), and the fetch that applies it to every redirect hop and bounds every response body (`guardedFetch`). A process composes one guarded fetch at its root and hands it to every module that dials; the modules hold no `fetch` of their own. And the names a sandbox's tools read their CA file from (`GATEWAY_TRUST_VARIABLES`): the control plane's sandbox template points each at the egress gateway's CA, and the runner passes each to the agent's host, the Environment install and every local MCP server, from this one list (stigmer#3392).
|
|
8
8
|
- `@stigmer/outbound/dial`: the pinned dialer (`pinnedFetch`), whose every socket opens to an address the policy judged at connect time, and `nodeGuardedFetch`, the guarded fetch over it that a server composes at its root. The check alone would leave a window: a name can resolve to a public address for the check and a private one for the socket. This entry stands apart because importing it loads undici, which registers itself as the process's dispatcher; a server already carries undici, while a process that does not would change every `fetch` it makes by importing the egress rules. undici is an optional peer of this library: a process that imports `/dial` installs `undici` beside it, at the version this package's `peerDependencies` names, and runs on Node 22.19 or newer on 22.x, or 23.8 or newer (the entry refuses an older Node at load, with one sentence naming the version). The other entries need only the family floor in `package.json` (Node 22.13, or 23.4), so a process that never imports `/dial` (the runner) installs no undici and meets no undici floor.
|
|
9
9
|
- `@stigmer/outbound/mcp-oauth`: how an MCP endpoint's authentication is read without a credential (`isOAuthChallenge`, the complete `initializeRequest`, `probeEndpointAuth`) and how its login server is found (`resolveAuthorizationServers` over RFC 9728, `readAuthorizationServerMetadata` over RFC 8414 with the issuer's path and OpenID's document).
|
|
10
10
|
|
package/egress/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@stigmer/outbound/egress`: the address policy a Stigmer process dials
|
|
3
|
-
* user-supplied URLs under, the check that applies it to a URL,
|
|
4
|
-
*
|
|
3
|
+
* user-supplied URLs under, the check that applies it to a URL, the fetch
|
|
4
|
+
* that applies it to every hop, and the variables a sandbox's processes
|
|
5
|
+
* trust its egress gateway by. See each module's header.
|
|
5
6
|
*/
|
|
6
7
|
export { blockedReason, egressPolicyForPosture, type EgressPolicy, type EgressPosture } from "./address.js";
|
|
7
8
|
export { checkEgress, describeRefusal, EgressError, refusalWithholdsResolution, refusedAddress, type EgressCheck, type EgressCheckOptions, type EgressRefusal, type LookupFn, type RefusedAddress, } from "./check.js";
|
|
8
9
|
export { asFetch, DEFAULT_MAX_REDIRECTS, DEFAULT_MAX_RESPONSE_BYTES, guardedFetch, type GuardedFetchOptions, type OutboundFetch } from "./fetch.js";
|
|
9
10
|
export { nodeLookup } from "./node-lookup.js";
|
|
11
|
+
export { GATEWAY_TRUST_VARIABLES, type GatewayTrustVariable } from "./trust.js";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/egress/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/egress/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/egress/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5G,OAAO,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,0BAA0B,EAC1B,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AACpJ,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
package/egress/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@stigmer/outbound/egress`: the address policy a Stigmer process dials
|
|
3
|
-
* user-supplied URLs under, the check that applies it to a URL,
|
|
4
|
-
*
|
|
3
|
+
* user-supplied URLs under, the check that applies it to a URL, the fetch
|
|
4
|
+
* that applies it to every hop, and the variables a sandbox's processes
|
|
5
|
+
* trust its egress gateway by. See each module's header.
|
|
5
6
|
*/
|
|
6
7
|
export { blockedReason, egressPolicyForPosture } from "./address.js";
|
|
7
8
|
export { checkEgress, describeRefusal, EgressError, refusalWithholdsResolution, refusedAddress, } from "./check.js";
|
|
8
9
|
export { asFetch, DEFAULT_MAX_REDIRECTS, DEFAULT_MAX_RESPONSE_BYTES, guardedFetch } from "./fetch.js";
|
|
9
10
|
export { nodeLookup } from "./node-lookup.js";
|
|
11
|
+
export { GATEWAY_TRUST_VARIABLES } from "./trust.js";
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
package/egress/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/egress/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/egress/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAyC,MAAM,cAAc,CAAC;AAC5G,OAAO,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,0BAA0B,EAC1B,cAAc,GAMf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,YAAY,EAAgD,MAAM,YAAY,CAAC;AACpJ,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAA6B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The variables a sandbox's processes trust its egress gateway by.
|
|
3
|
+
*
|
|
4
|
+
* A sandbox with HTTPS egress reaches the internet through a gateway that
|
|
5
|
+
* re-signs every connection with its own CA, so every tool the agent starts
|
|
6
|
+
* must trust that CA, and each common tool reads its CA file from a
|
|
7
|
+
* different variable: Node (`NODE_EXTRA_CA_CERTS`), OpenSSL-based tools and
|
|
8
|
+
* Go (`SSL_CERT_FILE`), git (`GIT_SSL_CAINFO`), curl (`CURL_CA_BUNDLE`), and
|
|
9
|
+
* Python's requests, under pip among others (`REQUESTS_CA_BUNDLE`). Measured
|
|
10
|
+
* on Debian bookworm, the sandbox image's base: pip 23.0 (the system's and a
|
|
11
|
+
* venv's) and git, whose HTTPS is on GnuTLS, ignore `SSL_CERT_FILE` and
|
|
12
|
+
* trust the gateway only through their own variable; curl, on OpenSSL there,
|
|
13
|
+
* reads either. wget, also on GnuTLS, reads none of them (stigmer#3509).
|
|
14
|
+
*
|
|
15
|
+
* One list, because three copies drifted (stigmer#3392): the control
|
|
16
|
+
* plane's sandbox template sets every name to the gateway's CA; the runner
|
|
17
|
+
* lets every name into a separating agent host's allow-list, hands them to
|
|
18
|
+
* the Environment install's root commands, and gives them to each local
|
|
19
|
+
* (stdio) MCP server (stigmer#3506). Each value is a path to a public CA
|
|
20
|
+
* bundle, never a secret, which is why every one of those may carry them.
|
|
21
|
+
*/
|
|
22
|
+
export declare const GATEWAY_TRUST_VARIABLES: readonly ["NODE_EXTRA_CA_CERTS", "SSL_CERT_FILE", "GIT_SSL_CAINFO", "CURL_CA_BUNDLE", "REQUESTS_CA_BUNDLE"];
|
|
23
|
+
/** One of {@link GATEWAY_TRUST_VARIABLES}. */
|
|
24
|
+
export type GatewayTrustVariable = (typeof GATEWAY_TRUST_VARIABLES)[number];
|
|
25
|
+
//# sourceMappingURL=trust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../src/egress/trust.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,uBAAuB,6GAM1B,CAAC;AAEX,8CAA8C;AAC9C,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/egress/trust.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The variables a sandbox's processes trust its egress gateway by.
|
|
3
|
+
*
|
|
4
|
+
* A sandbox with HTTPS egress reaches the internet through a gateway that
|
|
5
|
+
* re-signs every connection with its own CA, so every tool the agent starts
|
|
6
|
+
* must trust that CA, and each common tool reads its CA file from a
|
|
7
|
+
* different variable: Node (`NODE_EXTRA_CA_CERTS`), OpenSSL-based tools and
|
|
8
|
+
* Go (`SSL_CERT_FILE`), git (`GIT_SSL_CAINFO`), curl (`CURL_CA_BUNDLE`), and
|
|
9
|
+
* Python's requests, under pip among others (`REQUESTS_CA_BUNDLE`). Measured
|
|
10
|
+
* on Debian bookworm, the sandbox image's base: pip 23.0 (the system's and a
|
|
11
|
+
* venv's) and git, whose HTTPS is on GnuTLS, ignore `SSL_CERT_FILE` and
|
|
12
|
+
* trust the gateway only through their own variable; curl, on OpenSSL there,
|
|
13
|
+
* reads either. wget, also on GnuTLS, reads none of them (stigmer#3509).
|
|
14
|
+
*
|
|
15
|
+
* One list, because three copies drifted (stigmer#3392): the control
|
|
16
|
+
* plane's sandbox template sets every name to the gateway's CA; the runner
|
|
17
|
+
* lets every name into a separating agent host's allow-list, hands them to
|
|
18
|
+
* the Environment install's root commands, and gives them to each local
|
|
19
|
+
* (stdio) MCP server (stigmer#3506). Each value is a path to a public CA
|
|
20
|
+
* bundle, never a secret, which is why every one of those may carry them.
|
|
21
|
+
*/
|
|
22
|
+
export const GATEWAY_TRUST_VARIABLES = [
|
|
23
|
+
"NODE_EXTRA_CA_CERTS",
|
|
24
|
+
"SSL_CERT_FILE",
|
|
25
|
+
"GIT_SSL_CAINFO",
|
|
26
|
+
"CURL_CA_BUNDLE",
|
|
27
|
+
"REQUESTS_CA_BUNDLE",
|
|
28
|
+
];
|
|
29
|
+
//# sourceMappingURL=trust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust.js","sourceRoot":"","sources":["../src/egress/trust.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,qBAAqB;IACrB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;CACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/outbound",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "The rules Stigmer's TypeScript processes dial a user-supplied endpoint by, shared by the control plane, the runner and the catalogue audit: the egress address policy, its guarded fetch and the pinned dialer under it, and the way an MCP endpoint's authentication is read (the OAuth-challenge rule, the complete initialize handshake, the RFC 9728 / RFC 8414 / OpenID resolution of its login server)",
|
|
3
|
+
"version": "0.4.2",
|
|
4
|
+
"description": "The rules Stigmer's TypeScript processes dial a user-supplied endpoint by, shared by the control plane, the runner and the catalogue audit: the egress address policy, its guarded fetch and the pinned dialer under it, the variables a sandbox's processes trust its egress gateway by, and the way an MCP endpoint's authentication is read (the OAuth-challenge rule, the complete initialize handshake, the RFC 9728 / RFC 8414 / OpenID resolution of its login server)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
package/src/egress/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@stigmer/outbound/egress`: the address policy a Stigmer process dials
|
|
3
|
-
* user-supplied URLs under, the check that applies it to a URL,
|
|
4
|
-
*
|
|
3
|
+
* user-supplied URLs under, the check that applies it to a URL, the fetch
|
|
4
|
+
* that applies it to every hop, and the variables a sandbox's processes
|
|
5
|
+
* trust its egress gateway by. See each module's header.
|
|
5
6
|
*/
|
|
6
7
|
export { blockedReason, egressPolicyForPosture, type EgressPolicy, type EgressPosture } from "./address.js";
|
|
7
8
|
export {
|
|
@@ -18,3 +19,4 @@ export {
|
|
|
18
19
|
} from "./check.js";
|
|
19
20
|
export { asFetch, DEFAULT_MAX_REDIRECTS, DEFAULT_MAX_RESPONSE_BYTES, guardedFetch, type GuardedFetchOptions, type OutboundFetch } from "./fetch.js";
|
|
20
21
|
export { nodeLookup } from "./node-lookup.js";
|
|
22
|
+
export { GATEWAY_TRUST_VARIABLES, type GatewayTrustVariable } from "./trust.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The variables a sandbox's processes trust its egress gateway by.
|
|
3
|
+
*
|
|
4
|
+
* A sandbox with HTTPS egress reaches the internet through a gateway that
|
|
5
|
+
* re-signs every connection with its own CA, so every tool the agent starts
|
|
6
|
+
* must trust that CA, and each common tool reads its CA file from a
|
|
7
|
+
* different variable: Node (`NODE_EXTRA_CA_CERTS`), OpenSSL-based tools and
|
|
8
|
+
* Go (`SSL_CERT_FILE`), git (`GIT_SSL_CAINFO`), curl (`CURL_CA_BUNDLE`), and
|
|
9
|
+
* Python's requests, under pip among others (`REQUESTS_CA_BUNDLE`). Measured
|
|
10
|
+
* on Debian bookworm, the sandbox image's base: pip 23.0 (the system's and a
|
|
11
|
+
* venv's) and git, whose HTTPS is on GnuTLS, ignore `SSL_CERT_FILE` and
|
|
12
|
+
* trust the gateway only through their own variable; curl, on OpenSSL there,
|
|
13
|
+
* reads either. wget, also on GnuTLS, reads none of them (stigmer#3509).
|
|
14
|
+
*
|
|
15
|
+
* One list, because three copies drifted (stigmer#3392): the control
|
|
16
|
+
* plane's sandbox template sets every name to the gateway's CA; the runner
|
|
17
|
+
* lets every name into a separating agent host's allow-list, hands them to
|
|
18
|
+
* the Environment install's root commands, and gives them to each local
|
|
19
|
+
* (stdio) MCP server (stigmer#3506). Each value is a path to a public CA
|
|
20
|
+
* bundle, never a secret, which is why every one of those may carry them.
|
|
21
|
+
*/
|
|
22
|
+
export const GATEWAY_TRUST_VARIABLES = [
|
|
23
|
+
"NODE_EXTRA_CA_CERTS",
|
|
24
|
+
"SSL_CERT_FILE",
|
|
25
|
+
"GIT_SSL_CAINFO",
|
|
26
|
+
"CURL_CA_BUNDLE",
|
|
27
|
+
"REQUESTS_CA_BUNDLE",
|
|
28
|
+
] as const;
|
|
29
|
+
|
|
30
|
+
/** One of {@link GATEWAY_TRUST_VARIABLES}. */
|
|
31
|
+
export type GatewayTrustVariable = (typeof GATEWAY_TRUST_VARIABLES)[number];
|