Add pass rule

This commit is contained in:
Owen
2025-08-24 22:20:09 -07:00
parent 72f19274cd
commit 78d3861382
7 changed files with 19 additions and 9 deletions

View File

@@ -178,6 +178,9 @@ export async function verifyResourceSession(
} else if (action == "DROP") {
logger.debug("Resource denied by rule");
return notAllowed(res);
} else if (action == "PASS") {
logger.debug("Resource passed by rule, continuing to auth checks");
// Continue to authentication checks below
}
// otherwise its undefined and we pass
@@ -581,7 +584,7 @@ async function checkRules(
resourceId: number,
clientIp: string | undefined,
path: string | undefined
): Promise<"ACCEPT" | "DROP" | undefined> {
): Promise<"ACCEPT" | "DROP" | "PASS" | undefined> {
const ruleCacheKey = `rules:${resourceId}`;
let rules: ResourceRule[] | undefined = cache.get(ruleCacheKey);