mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-26 22:15:01 +02:00
strip encrypted ssh key from org response
This commit is contained in:
@@ -16,13 +16,12 @@ const getOrgSchema = z.strictObject({
|
||||
});
|
||||
|
||||
export type GetOrgResponse = {
|
||||
org: Org;
|
||||
org: Omit<Org, "sshCaPrivateKey">;
|
||||
};
|
||||
const GetOrgResponseDataSchema = z.object({
|
||||
org: z.object({}).passthrough()
|
||||
});
|
||||
|
||||
|
||||
registry.registerPath({
|
||||
method: "get",
|
||||
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, {
|
||||
data: {
|
||||
org
|
||||
org: orgWithoutPrivateKey
|
||||
},
|
||||
success: true,
|
||||
error: false,
|
||||
|
||||
Reference in New Issue
Block a user