@opengeni/api-router 0.5.6 → 0.7.3
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.d.ts +21 -3
- package/dist/app.js +3 -1
- package/dist/{chunk-HBEJMWD3.js → chunk-EYYTFA7N.js} +2396 -676
- package/dist/chunk-EYYTFA7N.js.map +1 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/app.ts +47 -4
- package/src/github-access.ts +46 -0
- package/src/github-browser-flow.ts +83 -0
- package/src/http/auth.ts +12 -4
- package/src/http/sse.ts +526 -92
- package/src/index.ts +2 -1
- package/src/mcp/server.ts +774 -146
- package/src/mcp/session-view.ts +622 -203
- package/src/mcp/toolspace.ts +110 -25
- package/src/routes/codex.ts +17 -14
- package/src/routes/enrollments.ts +2 -2
- package/src/routes/github.ts +63 -202
- package/src/routes/install.ts +1 -1
- package/src/routes/machines.ts +2 -2
- package/src/routes/sessions.ts +639 -76
- package/src/routes/workspace-capture.ts +56 -38
- package/src/routes/workspaces.ts +30 -11
- package/src/sandbox/access.ts +1 -1
- package/src/sandbox/auth-callout.ts +1 -1
- package/src/sandbox/channel-a.ts +14 -1
- package/src/sandbox/enrollment.ts +4 -4
- package/src/sandbox/machines.ts +1 -1
- package/src/sandbox/metrics-ingestion.ts +1 -1
- package/src/sandbox/viewer.ts +1 -1
- package/dist/chunk-HBEJMWD3.js.map +0 -1
package/src/http/auth.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Context, MiddlewareHandler } from "hono";
|
|
|
3
3
|
import { installExactPaths, isInstallRedirectPath } from "../routes/install";
|
|
4
4
|
|
|
5
5
|
const githubConnectPathPattern = /^\/v1\/workspaces\/[^/]+\/github\/connect$/;
|
|
6
|
+
const githubInstallationLinkPathPattern = /^\/v1\/workspaces\/[^/]+\/github\/installations$/;
|
|
6
7
|
|
|
7
8
|
export function requireAccessKey(settings: Settings): MiddlewareHandler {
|
|
8
9
|
return async (c, next) => {
|
|
@@ -58,15 +59,22 @@ function isAuthExempt(c: Context, settings: Settings): boolean {
|
|
|
58
59
|
if (path.startsWith("/v1/catalog-assets/")) {
|
|
59
60
|
return true;
|
|
60
61
|
}
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
62
|
+
// Compatibility entry for already-issued GitHub install/link URLs. It stays
|
|
63
|
+
// public like the callbacks above, verifies signed workspace-bound state,
|
|
64
|
+
// and then terminates with 410 while new installation binding is disabled.
|
|
64
65
|
if (githubConnectPathPattern.test(path)) {
|
|
65
66
|
return true;
|
|
66
67
|
}
|
|
68
|
+
// Compatibility endpoint for stale chooser submissions. It remains public
|
|
69
|
+
// only so already-rendered forms can authenticate their signed account and
|
|
70
|
+
// workspace state locally before terminating with 410; it does not parse a
|
|
71
|
+
// ticket, resolve browser authority, or write an installation binding.
|
|
72
|
+
if (c.req.method === "POST" && githubInstallationLinkPathPattern.test(path)) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
67
75
|
// The get.<domain> install-serving routes (install.sh/.ps1/uninstall.sh/
|
|
68
76
|
// minisign pub + the release-binary redirects). Reached by a fresh machine
|
|
69
|
-
// with no credentials; the bodies carry no secrets
|
|
77
|
+
// with no credentials; the bodies carry no secrets.
|
|
70
78
|
if (installExactPaths.has(path) || isInstallRedirectPath(path)) {
|
|
71
79
|
return true;
|
|
72
80
|
}
|