mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-27 14:35:06 +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 = {
|
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user