fix(gateway): harden plugin HTTP route auth

This commit is contained in:
Peter Steinberger
2026-03-07 19:54:53 +00:00
parent cf290e31bd
commit ac86deccee
11 changed files with 270 additions and 7 deletions

View File

@@ -298,6 +298,7 @@ function buildPluginRequestStages(params: {
if (!params.handlePluginRequest) {
return [];
}
let pluginGatewayAuthSatisfied = false;
return [
{
name: "plugin-auth",
@@ -325,6 +326,7 @@ function buildPluginRequestStages(params: {
if (!pluginAuthOk) {
return true;
}
pluginGatewayAuthSatisfied = true;
return false;
},
},
@@ -333,7 +335,11 @@ function buildPluginRequestStages(params: {
run: () => {
const pathContext =
params.pluginPathContext ?? resolvePluginRoutePathContext(params.requestPath);
return params.handlePluginRequest?.(params.req, params.res, pathContext) ?? false;
return (
params.handlePluginRequest?.(params.req, params.res, pathContext, {
gatewayAuthSatisfied: pluginGatewayAuthSatisfied,
}) ?? false
);
},
},
];