@noodleseed/one 0.189.0 → 0.190.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/node_modules/@noodle-borg/assistant-gateway/package.json +1 -1
- package/node_modules/@noodle-borg/transport-http/dist/handler.js +3 -0
- package/node_modules/@noodle-borg/transport-http/dist/routing.d.ts +2 -0
- package/node_modules/@noodle-borg/transport-http/dist/routing.js +2 -0
- package/node_modules/@noodle-borg/transport-http/dist/serve-request.js +3 -1
- package/node_modules/@noodleseed/assistant/package.json +1 -1
- package/package.json +1 -1
|
@@ -124,6 +124,9 @@ export function createMcpRouter(lookup, options = {}) {
|
|
|
124
124
|
...(route?.kind === 'tenant' && route.publicResourceUrl !== undefined
|
|
125
125
|
? { publicResourceUrl: route.publicResourceUrl }
|
|
126
126
|
: {}),
|
|
127
|
+
...(route?.kind === 'tenant' && route.clientAddress !== undefined
|
|
128
|
+
? { clientAddress: route.clientAddress }
|
|
129
|
+
: {}),
|
|
127
130
|
}, routeId, maxBody, options.allowedOrigins, tenant);
|
|
128
131
|
})()).then(() => logRequest(logger, logId, req, res, start));
|
|
129
132
|
};
|
|
@@ -10,6 +10,8 @@ type ParsedRoute = {
|
|
|
10
10
|
readonly ref: TenantRouteRef;
|
|
11
11
|
readonly logId: string;
|
|
12
12
|
readonly publicResourceUrl?: string;
|
|
13
|
+
/** The caller address the edge Worker observed; present only on edge-authenticated routes. */
|
|
14
|
+
readonly clientAddress?: string;
|
|
13
15
|
} | {
|
|
14
16
|
readonly kind: 'deployment';
|
|
15
17
|
readonly deploymentId: string;
|
|
@@ -15,6 +15,7 @@ export async function resolveRoute(req, pathname, publicTenantRouting) {
|
|
|
15
15
|
const ref = await publicTenantRouting.resolveTenant(publicRef);
|
|
16
16
|
if (ref === undefined)
|
|
17
17
|
return { ok: true, route: null };
|
|
18
|
+
const clientAddress = header(req, 'x-noodle-client-address');
|
|
18
19
|
return {
|
|
19
20
|
ok: true,
|
|
20
21
|
route: {
|
|
@@ -22,6 +23,7 @@ export async function resolveRoute(req, pathname, publicTenantRouting) {
|
|
|
22
23
|
ref,
|
|
23
24
|
logId: tenantLogId(ref),
|
|
24
25
|
publicResourceUrl: canonicalPublicResourceUrl(forwardedHost),
|
|
26
|
+
...(clientAddress !== undefined ? { clientAddress } : {}),
|
|
25
27
|
},
|
|
26
28
|
};
|
|
27
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { trustedPublicAdmission } from '@noodle-borg/admission-limits/portable';
|
|
2
|
+
import { clientAddressBucket, trustedPublicAdmission, } from '@noodle-borg/admission-limits/portable';
|
|
3
3
|
import { createDualEraMcpHandler, handleStatelessHttp, JSON_RPC, } from '@noodle-borg/protocol';
|
|
4
4
|
import { admissionContexts, requestsInvocationContext } from './admission-context.js';
|
|
5
5
|
import { authorizeIdentityMode, authorizeMixedMode, authorizePublicServiceMode, canonicalResourceUrl, isIdentityMode, } from './identity-authorization.js';
|
|
@@ -134,6 +134,7 @@ export async function serveRequest(req, res, target, auth, routeId, maxBody, all
|
|
|
134
134
|
...(auth.accessMode !== undefined ? { accessMode: auth.accessMode } : {}),
|
|
135
135
|
...(req.socket.remoteAddress !== undefined ? { remoteAddress: req.socket.remoteAddress } : {}),
|
|
136
136
|
});
|
|
137
|
+
const callerNetwork = clientAddressBucket(auth.clientAddress);
|
|
137
138
|
for (const context of contexts) {
|
|
138
139
|
const decision = auth.admissionGate
|
|
139
140
|
? await auth.admissionGate(context)
|
|
@@ -148,6 +149,7 @@ export async function serveRequest(req, res, target, auth, routeId, maxBody, all
|
|
|
148
149
|
...(context.env !== undefined ? { env: context.env } : {}),
|
|
149
150
|
...(context.serverVersion !== undefined ? { serverVersion: context.serverVersion } : {}),
|
|
150
151
|
...(context.accessMode !== undefined ? { accessMode: context.accessMode } : {}),
|
|
152
|
+
...(callerNetwork !== undefined ? { callerNetwork } : {}),
|
|
151
153
|
decision: decision.allow ? 'allow' : 'deny',
|
|
152
154
|
...(decision.reason !== undefined ? { reason: decision.reason } : {}),
|
|
153
155
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/assistant",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.0",
|
|
4
4
|
"description": "Embed the Noodle Seed customer-branded assistant in your web app with managed or framework-owned UI, a framework-neutral MCP App host, a DOM-free client, and a backend session helper. Authoring and deploying the server is @noodleseed/one.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noodleseed/one",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.190.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Noodle CLI by Noodle Seed — author, run, and deploy declarative MCP servers. Embedding the assistant in your own web app is @noodleseed/assistant.",
|
|
6
6
|
"license": "Apache-2.0",
|