mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 17:48:26 +00:00
feat(gateway): add trusted-proxy auth mode (#15940)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 279d4b304f
Co-authored-by: nickytonline <833231+nickytonline@users.noreply.github.com>
Co-authored-by: steipete <58493+steipete@users.noreply.github.com>
Reviewed-by: @steipete
This commit is contained in:
@@ -5,6 +5,7 @@ import { CONFIG_PATH, STATE_DIR, loadConfig } from "../../config/config.js";
|
||||
import { resolveMainSessionKey } from "../../config/sessions.js";
|
||||
import { listSystemPresence } from "../../infra/system-presence.js";
|
||||
import { normalizeMainKey } from "../../routing/session-key.js";
|
||||
import { resolveGatewayAuth } from "../auth.js";
|
||||
|
||||
let presenceVersion = 1;
|
||||
let healthVersion = 1;
|
||||
@@ -20,6 +21,7 @@ export function buildGatewaySnapshot(): Snapshot {
|
||||
const scope = cfg.session?.scope ?? "per-sender";
|
||||
const presence = listSystemPresence();
|
||||
const uptimeMs = Math.round(process.uptime() * 1000);
|
||||
const auth = resolveGatewayAuth({ authConfig: cfg.gateway?.auth, env: process.env });
|
||||
// Health is async; caller should await getHealthSnapshot and replace later if needed.
|
||||
const emptyHealth: unknown = {};
|
||||
return {
|
||||
@@ -36,6 +38,7 @@ export function buildGatewaySnapshot(): Snapshot {
|
||||
mainSessionKey,
|
||||
scope,
|
||||
},
|
||||
authMode: auth.mode,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user