@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.js
CHANGED
|
@@ -25899,6 +25899,10 @@ function isStaleConsoleSessionCredential(authHeader) {
|
|
|
25899
25899
|
return false;
|
|
25900
25900
|
}
|
|
25901
25901
|
}
|
|
25902
|
+
function isConsoleAuthPublicRoute(request) {
|
|
25903
|
+
const routeOptions = request.routeOptions;
|
|
25904
|
+
return routeOptions?.config?.consoleAuth === "public";
|
|
25905
|
+
}
|
|
25902
25906
|
function bypassesConsoleAuth(request) {
|
|
25903
25907
|
const path7 = request.url.split("?")[0];
|
|
25904
25908
|
const method = request.method;
|
|
@@ -25916,7 +25920,7 @@ function registerConsoleAuthHook(app2, options) {
|
|
|
25916
25920
|
const user = { id: session.id, tenantId: session.tenantId, tokenExpiresAt: session.expiresAt };
|
|
25917
25921
|
request.user = user;
|
|
25918
25922
|
}
|
|
25919
|
-
if (bypassesConsoleAuth(request)) return;
|
|
25923
|
+
if (isConsoleAuthPublicRoute(request) || bypassesConsoleAuth(request)) return;
|
|
25920
25924
|
if (session) return;
|
|
25921
25925
|
if (!options.authRequired || request.method === "OPTIONS") {
|
|
25922
25926
|
if (!isPublicRoute(request) && !request.url.startsWith("/s/") && isStaleConsoleSessionCredential(request.headers.authorization)) {
|
|
@@ -36901,6 +36905,11 @@ function registerAgentWebAppRuntimeRoutes(app2, deps) {
|
|
|
36901
36905
|
const identities = deps.identityResolver ?? createWebAppIdentityResolver({ getIdentityConfig: (webAppId) => deps.service.getIdentityConfig(webAppId) });
|
|
36902
36906
|
const runLifecycle = deps.runLifecycle ?? createRunLifecycleHandlers({ threadOwnedBy: async () => true });
|
|
36903
36907
|
app2.register(async (routes) => {
|
|
36908
|
+
routes.addHook("onRoute", (routeOptions) => {
|
|
36909
|
+
if (/^\/api\/web-apps\/[^/]+\/runtime(?:\/|$)/.test(routeOptions.url)) {
|
|
36910
|
+
routeOptions.config = { ...routeOptions.config, consoleAuth: "public" };
|
|
36911
|
+
}
|
|
36912
|
+
});
|
|
36904
36913
|
routes.setErrorHandler((error, _request, reply) => normalizeError2(reply, error));
|
|
36905
36914
|
routes.get("/api/web-apps/:webAppId/runtime/bootstrap", async (request, reply) => handle2(reply, async () => {
|
|
36906
36915
|
const { webAppId } = paramsSchema.parse(request.params);
|