mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-13 16:00:02 +02:00
support bypass auth rules on gateway
This commit is contained in:
@@ -259,28 +259,20 @@ export async function verifyResourceSession(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (action == "ACCEPT") {
|
if (action == "ACCEPT") {
|
||||||
// Public inference still requires a virtual API key; do not
|
logger.debug("Resource allowed by rule");
|
||||||
// bypass that with an allow rule.
|
|
||||||
if (mode === "inference") {
|
|
||||||
logger.debug(
|
|
||||||
"Rule ACCEPT ignored for inference; continuing to virtual API key check"
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
logger.debug("Resource allowed by rule");
|
|
||||||
|
|
||||||
logRequestAudit(
|
logRequestAudit(
|
||||||
{
|
{
|
||||||
action: true,
|
action: true,
|
||||||
reason: 100, // allowed by rule
|
reason: 100, // allowed by rule
|
||||||
resourceId: resource.resourceId,
|
resourceId: resource.resourceId,
|
||||||
orgId: resource.orgId,
|
orgId: resource.orgId,
|
||||||
location: ipCC
|
location: ipCC
|
||||||
},
|
},
|
||||||
parsedBody.data
|
parsedBody.data
|
||||||
);
|
);
|
||||||
|
|
||||||
return allowed(res, undefined, dontStripSession);
|
return allowed(res, undefined, dontStripSession);
|
||||||
}
|
|
||||||
} else if (action == "DROP") {
|
} else if (action == "DROP") {
|
||||||
logger.debug("Resource denied by rule");
|
logger.debug("Resource denied by rule");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user