fix(web): enforce secure provider field defaults
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
5134929999
commit
c90070acc9
2 files changed
+14
-1
No files matched your search
@@ -77,6 +77,19 @@ describe("provider environment helpers", () => {
|
||||
).toEqual([{ name: "CURSOR_API_KEY", value: "new-key", sensitive: true }]);
|
||||
});
|
||||
|
||||
it("applies the secure field default when replacing an existing non-sensitive value", () => {
|
||||
expect(
|
||||
nextProviderEnvironmentWithFieldValue(
|
||||
[{ name: "OPENAI_API_KEY", value: "old-key", sensitive: false }],
|
||||
{
|
||||
name: "OPENAI_API_KEY",
|
||||
label: "OpenAI API key",
|
||||
},
|
||||
"new-key",
|
||||
),
|
||||
).toEqual([{ name: "OPENAI_API_KEY", value: "new-key", sensitive: true }]);
|
||||
});
|
||||
|
||||
it("separates dedicated provider secrets from the generic environment table", () => {
|
||||
const environment = [
|
||||
{ name: "CURSOR_API_KEY", value: "cursor-key", sensitive: true },
|
||||
|
||||
@@ -142,7 +142,7 @@ export function nextProviderEnvironmentWithFieldValue(
|
||||
next.push({
|
||||
name: variable.name,
|
||||
value: trimmed,
|
||||
sensitive: field.sensitive ?? variable.sensitive,
|
||||
sensitive: field.sensitive ?? true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user