strip encrypted ssh key from org response

This commit is contained in:
miloschwartz
2026-08-26 09:38:50 -04:00
parent 72d2c79793
commit 9a5824900d
+5 -3
View File
@@ -16,13 +16,12 @@ const getOrgSchema = z.strictObject({
}); });
export type GetOrgResponse = { export type GetOrgResponse = {
org: Org; org: Omit<Org, "sshCaPrivateKey">;
}; };
const GetOrgResponseDataSchema = z.object({ const GetOrgResponseDataSchema = z.object({
org: z.object({}).passthrough() org: z.object({}).passthrough()
}); });
registry.registerPath({ registry.registerPath({
method: "get", method: "get",
path: "/org/{orgId}", path: "/org/{orgId}",
@@ -76,9 +75,12 @@ export async function getOrg(
); );
} }
// sshCaPrivateKey is encrypted anyway but just to be safe
const { sshCaPrivateKey: _, ...orgWithoutPrivateKey } = org;
return response<GetOrgResponse>(res, { return response<GetOrgResponse>(res, {
data: { data: {
org org: orgWithoutPrivateKey
}, },
success: true, success: true,
error: false, error: false,