import { describe, expect, it } from "vitest"; import type { OpenClawConfig } from "../config/config.js"; import {
assertExplicitGatewayAuthModeWhenBothConfigured,
EXPLICIT_GATEWAY_AUTH_MODE_REQUIRED_ERROR,
hasAmbiguousGatewayAuthModeConfig,
} from "./auth-mode-policy.js";
it("does not flag config when only one auth credential is configured", () => { const cfg: OpenClawConfig = {
gateway: {
auth: {
token: "token-value",
},
},
};
expect(hasAmbiguousGatewayAuthModeConfig(cfg)).toBe(false);
});
it("flags config when both token and password are configured and mode is unset", () => { const cfg: OpenClawConfig = {
gateway: {
auth: {
token: "token-value",
password: "password-value", // pragma: allowlist secret
},
},
};
expect(hasAmbiguousGatewayAuthModeConfig(cfg)).toBe(true);
});
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.