mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 08:22:47 +00:00
feat(secrets): finalize external secrets runtime and migration hardening
This commit is contained in:
committed by
Peter Steinberger
parent
c5b89fbaea
commit
0e69660c41
@@ -47,4 +47,30 @@ describe("resolveModelAuthLabel", () => {
|
||||
|
||||
expect(label).toContain("token ref(env:GITHUB_TOKEN)");
|
||||
});
|
||||
|
||||
it("masks short api-key profile values", () => {
|
||||
const shortSecret = "abc123";
|
||||
ensureAuthProfileStoreMock.mockReturnValue({
|
||||
version: 1,
|
||||
profiles: {
|
||||
"openai:default": {
|
||||
type: "api_key",
|
||||
provider: "openai",
|
||||
key: shortSecret,
|
||||
},
|
||||
},
|
||||
} as never);
|
||||
resolveAuthProfileOrderMock.mockReturnValue(["openai:default"]);
|
||||
resolveAuthProfileDisplayLabelMock.mockReturnValue("openai:default");
|
||||
|
||||
const label = resolveModelAuthLabel({
|
||||
provider: "openai",
|
||||
cfg: {},
|
||||
sessionEntry: { authProfileOverride: "openai:default" } as never,
|
||||
});
|
||||
|
||||
expect(label).toContain("api-key");
|
||||
expect(label).toContain("...");
|
||||
expect(label).not.toContain(shortSecret);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user