improve site regenerate cred ui

This commit is contained in:
miloschwartz
2025-12-06 11:40:11 -05:00
parent 5e52c48e77
commit 646497cda0
7 changed files with 363 additions and 194 deletions

View File

@@ -36,24 +36,6 @@ const reGenerateSecretBodySchema = z.strictObject({
export type ReGenerateSecretBody = z.infer<typeof reGenerateSecretBodySchema>;
registry.registerPath({
method: "post",
path: "/re-key/{clientId}/regenerate-client-secret",
description: "Regenerate a client's OLM credentials by its client ID.",
tags: [OpenAPITags.Client],
request: {
params: reGenerateSecretParamsSchema,
body: {
content: {
"application/json": {
schema: reGenerateSecretBodySchema
}
}
}
},
responses: {}
});
export async function reGenerateClientSecret(
req: Request,
res: Response,

View File

@@ -34,24 +34,6 @@ const bodySchema = z.strictObject({
secret: z.string().length(48)
});
registry.registerPath({
method: "post",
path: "/re-key/{orgId}/regenerate-secret",
description: "Regenerate a exit node credentials by its org ID.",
tags: [OpenAPITags.Org],
request: {
params: paramsSchema,
body: {
content: {
"application/json": {
schema: bodySchema
}
}
}
},
responses: {}
});
export async function reGenerateExitNodeSecret(
req: Request,
res: Response,
@@ -108,7 +90,7 @@ export async function reGenerateExitNodeSecret(
);
return response(res, {
data: null,
data: null,
success: true,
error: false,
message: "Remote Exit Node secret updated successfully",

View File

@@ -36,25 +36,6 @@ const updateSiteBodySchema = z.strictObject({
pubKey: z.string().optional()
});
registry.registerPath({
method: "post",
path: "/re-key/{siteId}/regenerate-site-secret",
description:
"Regenerate a site's Newt or WireGuard credentials by its site ID.",
tags: [OpenAPITags.Site],
request: {
params: updateSiteParamsSchema,
body: {
content: {
"application/json": {
schema: updateSiteBodySchema
}
}
}
},
responses: {}
});
export async function reGenerateSiteSecret(
req: Request,
res: Response,