import type { ConnectParams } from "../../protocol/index.js"; import type { GatewayRole } from "../../role-policy.js"; import { roleCanSkipDeviceIdentity } from "../../role-policy.js";
export function shouldSkipControlUiPairing(
policy: ControlUiAuthPolicy,
role: GatewayRole,
trustedProxyAuthOk = false,
authMode?: string,
): boolean { if (trustedProxyAuthOk) { returntrue;
} // When auth is completely disabled (mode=none), there is no shared secret // or token to gate pairing. Requiring pairing in this configuration adds // friction without security value since any client can already connect // without credentials. Guard with policy.isControlUi because this function // is called for ALL clients (not just Control UI) at the call site. // Scope to operator role so node-role sessions still need device identity // (#43478 was reverted for skipping ALL clients). if (policy.isControlUi && role === "operator" && authMode === "none") { returntrue;
} // dangerouslyDisableDeviceAuth is the break-glass path for Control UI // operators. Keep pairing aligned with the missing-device bypass, including // open-auth deployments where there is no shared token/password to prove. return role === "operator" && policy.allowBypass;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.