mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
fix(mcp/ui): clear value for user-scope env vars before submit
A stale admin secret left in form state after switching an env var's scope from instance to per-user was forwarded to the backend as the user-scope value, which is returned unredacted to authorized non-admin users. Per-user entries carry no admin value, so drop it on submit.
This commit is contained in:
parent
e9eeca1bb7
commit
0dcf316f59
2 changed files with 2 additions and 2 deletions
|
|
@ -65,7 +65,7 @@ const normalizeEnvVars = (list: unknown): EnvVarEntry[] => {
|
|||
const scope = (entry as Record<string, unknown>).scope === "user" ? "user" : "global";
|
||||
out.push({
|
||||
name,
|
||||
value: String((entry as Record<string, unknown>).value ?? ""),
|
||||
value: scope === "user" ? "" : String((entry as Record<string, unknown>).value ?? ""),
|
||||
scope,
|
||||
description: ((entry as Record<string, unknown>).description as string | undefined) || undefined,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ const MCPServerEdit: React.FC<MCPServerEditProps> = ({
|
|||
const scope = entry?.scope === "user" ? "user" : "global";
|
||||
acc.push({
|
||||
name,
|
||||
value: String(entry?.value ?? ""),
|
||||
value: scope === "user" ? "" : String(entry?.value ?? ""),
|
||||
scope,
|
||||
description: (entry?.description as string | undefined) || undefined,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue