@memoraone/mcp 0.1.56 → 0.1.57
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/cli.cjs +1 -1
- package/dist/gateway.cjs +7 -6
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
package/dist/gateway.cjs
CHANGED
|
@@ -11218,8 +11218,9 @@ function delay(ms) {
|
|
|
11218
11218
|
return new Promise((resolve47) => setTimeout(resolve47, ms));
|
|
11219
11219
|
}
|
|
11220
11220
|
function buildProtectedResourceMetadata(env2 = process.env, workspaceRoot) {
|
|
11221
|
+
const externalIssuer = Boolean(env2.MEMORAONE_OAUTH_ISSUER_URL?.trim());
|
|
11221
11222
|
return {
|
|
11222
|
-
resource: workspaceRoot === void 0 ? getGatewayResourceBaseUrl(env2) : buildGatewayMcpUrl(workspaceRoot, env2),
|
|
11223
|
+
resource: workspaceRoot === void 0 || externalIssuer ? getGatewayResourceBaseUrl(env2) : buildGatewayMcpUrl(workspaceRoot, env2),
|
|
11223
11224
|
authorization_servers: [getGatewayAuthorizationServerIssuerUrl(env2)]
|
|
11224
11225
|
};
|
|
11225
11226
|
}
|
|
@@ -11350,17 +11351,17 @@ var GatewayOAuthSurface = class {
|
|
|
11350
11351
|
*/
|
|
11351
11352
|
async handleProtectedResourceMetadata(res, url) {
|
|
11352
11353
|
const wsOrError = getGatewayWsQueryParam(url);
|
|
11353
|
-
if (wsOrError
|
|
11354
|
+
if (wsOrError === null) {
|
|
11355
|
+
json(res, 200, buildProtectedResourceMetadata(this.env));
|
|
11356
|
+
return;
|
|
11357
|
+
}
|
|
11358
|
+
if (typeof wsOrError !== "string") {
|
|
11354
11359
|
json(res, 404, {
|
|
11355
11360
|
error: "invalid_request",
|
|
11356
11361
|
error_description: "resource workspace is invalid"
|
|
11357
11362
|
});
|
|
11358
11363
|
return;
|
|
11359
11364
|
}
|
|
11360
|
-
if (wsOrError === null) {
|
|
11361
|
-
json(res, 200, buildProtectedResourceMetadata(this.env));
|
|
11362
|
-
return;
|
|
11363
|
-
}
|
|
11364
11365
|
const parsed2 = await parseGatewayWorkspaceRoot(wsOrError);
|
|
11365
11366
|
if (!parsed2.ok) {
|
|
11366
11367
|
json(res, 404, {
|