@opengeni/api-router 2.12.4-canary.3 → 2.13.0-canary.1
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/app.js +1 -1
- package/dist/{chunk-VQCBJV4P.js → chunk-V4IDX7VJ.js} +106 -49
- package/dist/{chunk-VQCBJV4P.js.map → chunk-V4IDX7VJ.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/github-lens-connect.d.ts +1 -1
- package/dist/integrations/marketplace-plugin.d.ts +26 -26
- package/dist/mcp/scheduled-task-view.d.ts +3 -3
- package/dist/workspace-tool-gateway.d.ts +2 -1
- package/package.json +19 -19
- package/src/codemode.ts +4 -8
- package/src/mcp/server.ts +64 -20
- package/src/routes/sessions.ts +24 -0
- package/src/workspace-tool-gateway.ts +11 -10
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
requireWorkspace,
|
|
49
49
|
withCodexAppsRequestAuthorization,
|
|
50
50
|
consumeToolGatewayApproval,
|
|
51
|
-
|
|
51
|
+
getWorkspaceArtifactContentRef,
|
|
52
52
|
issueToolGatewayApproval,
|
|
53
53
|
ToolGatewayApprovalOperationStartedError,
|
|
54
54
|
ToolGatewayApprovalRateLimitError,
|
|
@@ -719,24 +719,25 @@ function throwWorkspaceToolGatewayHttpError(error: unknown): never {
|
|
|
719
719
|
throw error;
|
|
720
720
|
}
|
|
721
721
|
|
|
722
|
-
async function requireWorkspaceSiteToolAuthorization(
|
|
722
|
+
export async function requireWorkspaceSiteToolAuthorization(
|
|
723
723
|
db: ApiRouteDeps["db"],
|
|
724
724
|
grant: AccessGrant,
|
|
725
725
|
context: WorkspaceSiteToolContext,
|
|
726
|
+
resolveVersion = getWorkspaceArtifactContentRef,
|
|
726
727
|
): Promise<void> {
|
|
727
728
|
try {
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
|
|
729
|
+
const { status, version } = await resolveVersion(
|
|
730
|
+
db,
|
|
731
|
+
grant.workspaceId,
|
|
732
|
+
context.siteArtifactId,
|
|
733
|
+
context.siteVersionId,
|
|
734
|
+
);
|
|
735
|
+
const requested = version.requestedTools.some(
|
|
731
736
|
(identity) =>
|
|
732
737
|
identity.serverId === context.identity.serverId &&
|
|
733
738
|
identity.toolName === context.identity.toolName,
|
|
734
739
|
);
|
|
735
|
-
if (
|
|
736
|
-
detail.artifact.status !== "active" ||
|
|
737
|
-
currentVersion?.id !== context.siteVersionId ||
|
|
738
|
-
!requested
|
|
739
|
-
) {
|
|
740
|
+
if (status !== "active" || version.id !== context.siteVersionId || !requested) {
|
|
740
741
|
throw new HTTPException(403, { message: "site_tool_not_authorized" });
|
|
741
742
|
}
|
|
742
743
|
} catch (error) {
|