strip password

This commit is contained in:
Alex Holliday committed 2026-08-20 13:52:14 -07:00
1 parent 1b2d2887af
commit 4443a53a23
6 files changed
+64 -35

No files matched your search

+4 -3
View File
@@ -14,7 +14,10 @@ export const createProxyBodyValidation = z.object({
password: z.string().optional(),
});
export const editProxyBodyValidation = createProxyBodyValidation;
// Empty/absent password keeps doesn't delete, only clearPassword: true does.
export const editProxyBodyValidation = createProxyBodyValidation.extend({
clearPassword: z.boolean().optional(),
});
export const getProxyByIdParamValidation = z.object({
id: z.string().min(1, "Proxy ID is required"),
@@ -26,8 +29,6 @@ export const deleteProxyParamValidation = z.object({
id: z.string().min(1, "Proxy ID is required"),
});
// Canonical proxy shape returned by /proxies endpoints. Keep aligned with what
// the controllers actually serialize (password is intentionally omitted; hasPassword tells the client one is stored).
export const proxyResponseSchema = z
.object({
id: z.string(),