openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
17 lines (16 loc) • 627 B
JavaScript
import { t as dispatchNativeHookRelayHttpCallback } from "./native-hook-relay-P9pIuF1y.mjs";
//#region src/gateway/native-hook-relay-http.ts
/** Independent capability auth: forwarded operator identity is never accepted. */
async function handleNativeHookRelayHttpRequest(e) {
const { req: t, res: n, clientIp: r, rateLimiter: i } = e;
const a = "native-hook-callback";
if (i && !i.check(r, a).allowed) {
n.writeHead(429).end();
return true;
}
await dispatchNativeHookRelayHttpCallback(t, n);
if (n.statusCode === 403) i?.recordFailure(r, a);
return true;
}
//#endregion
export { handleNativeHookRelayHttpRequest };