@axiom-lattice/gateway 10.2.2 → 10.2.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/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -15222,6 +15222,10 @@ function isStaleConsoleSessionCredential(authHeader) {
|
|
|
15222
15222
|
return false;
|
|
15223
15223
|
}
|
|
15224
15224
|
}
|
|
15225
|
+
function isConsoleAuthPublicRoute(request) {
|
|
15226
|
+
const routeOptions = request.routeOptions;
|
|
15227
|
+
return routeOptions?.config?.consoleAuth === "public";
|
|
15228
|
+
}
|
|
15225
15229
|
function bypassesConsoleAuth(request) {
|
|
15226
15230
|
const path5 = request.url.split("?")[0];
|
|
15227
15231
|
const method = request.method;
|
|
@@ -15239,7 +15243,7 @@ function registerConsoleAuthHook(app2, options) {
|
|
|
15239
15243
|
const user = { id: session.id, tenantId: session.tenantId, tokenExpiresAt: session.expiresAt };
|
|
15240
15244
|
request.user = user;
|
|
15241
15245
|
}
|
|
15242
|
-
if (bypassesConsoleAuth(request)) return;
|
|
15246
|
+
if (isConsoleAuthPublicRoute(request) || bypassesConsoleAuth(request)) return;
|
|
15243
15247
|
if (session) return;
|
|
15244
15248
|
if (!options.authRequired || request.method === "OPTIONS") {
|
|
15245
15249
|
if (!isPublicRoute(request) && !request.url.startsWith("/s/") && isStaleConsoleSessionCredential(request.headers.authorization)) {
|
|
@@ -26287,6 +26291,11 @@ function registerAgentWebAppRuntimeRoutes(app2, deps) {
|
|
|
26287
26291
|
const identities = deps.identityResolver ?? createWebAppIdentityResolver({ getIdentityConfig: (webAppId) => deps.service.getIdentityConfig(webAppId) });
|
|
26288
26292
|
const runLifecycle = deps.runLifecycle ?? createRunLifecycleHandlers({ threadOwnedBy: async () => true });
|
|
26289
26293
|
app2.register(async (routes) => {
|
|
26294
|
+
routes.addHook("onRoute", (routeOptions) => {
|
|
26295
|
+
if (/^\/api\/web-apps\/[^/]+\/runtime(?:\/|$)/.test(routeOptions.url)) {
|
|
26296
|
+
routeOptions.config = { ...routeOptions.config, consoleAuth: "public" };
|
|
26297
|
+
}
|
|
26298
|
+
});
|
|
26290
26299
|
routes.setErrorHandler((error, _request, reply) => normalizeError2(reply, error));
|
|
26291
26300
|
routes.get("/api/web-apps/:webAppId/runtime/bootstrap", async (request, reply) => handle2(reply, async () => {
|
|
26292
26301
|
const { webAppId } = paramsSchema.parse(request.params);
|