feat: added secret expand option in secrets get API

This commit is contained in:
Sheen Capadngan
2024-05-04 14:42:22 +08:00
parent 87b571d6ff
commit 61ae0e2fc7
4 changed files with 69 additions and 10 deletions
@@ -166,6 +166,11 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
workspaceSlug: z.string().trim().optional().describe(RAW_SECRETS.LIST.workspaceSlug),
environment: z.string().trim().optional().describe(RAW_SECRETS.LIST.environment),
secretPath: z.string().trim().default("/").transform(removeTrailingSlash).describe(RAW_SECRETS.LIST.secretPath),
expand: z
.enum(["true", "false"])
.default("false")
.transform((value) => value === "true")
.describe(RAW_SECRETS.LIST.expand),
recursive: z
.enum(["true", "false"])
.default("false")
@@ -233,6 +238,7 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
actor: req.permission.type,
actorOrgId: req.permission.orgId,
environment,
expand: req.query.expand,
actorAuthMethod: req.permission.authMethod,
projectId: workspaceId,
path: secretPath,