Fix: Renamed deep parameter to recursive

This commit is contained in:
Daniel Hougaard
2024-04-01 10:10:49 -07:00
parent 42fb732955
commit 36bf1b2abc
4 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -215,7 +215,7 @@ export const SECRETS = {
export const RAW_SECRETS = { export const RAW_SECRETS = {
LIST: { LIST: {
deep: "Whether or not to fetch all secrets from the specified base path, and all of its subdirectories.", recursive: "Whether or not to fetch all secrets from the specified base path, and all of its subdirectories.",
workspaceId: "The ID of the project to list secrets from.", workspaceId: "The ID of the project to list secrets from.",
workspaceSlug: "The slug of the project to list secrets from. This parameter is only usable by machine identities.", workspaceSlug: "The slug of the project to list secrets from. This parameter is only usable by machine identities.",
environment: "The slug of the environment to list secrets from.", environment: "The slug of the environment to list secrets from.",
@@ -157,11 +157,11 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
workspaceSlug: z.string().trim().optional().describe(RAW_SECRETS.LIST.workspaceSlug), workspaceSlug: z.string().trim().optional().describe(RAW_SECRETS.LIST.workspaceSlug),
environment: z.string().trim().optional().describe(RAW_SECRETS.LIST.environment), environment: z.string().trim().optional().describe(RAW_SECRETS.LIST.environment),
secretPath: z.string().trim().default("/").transform(removeTrailingSlash).describe(RAW_SECRETS.LIST.secretPath), secretPath: z.string().trim().default("/").transform(removeTrailingSlash).describe(RAW_SECRETS.LIST.secretPath),
deep: z recursive: z
.enum(["true", "false"]) .enum(["true", "false"])
.default("false") .default("false")
.transform((value) => value === "true") .transform((value) => value === "true")
.describe(RAW_SECRETS.LIST.deep), .describe(RAW_SECRETS.LIST.recursive),
include_imports: z include_imports: z
.enum(["true", "false"]) .enum(["true", "false"])
.default("false") .default("false")
@@ -228,7 +228,7 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
projectId: workspaceId, projectId: workspaceId,
path: secretPath, path: secretPath,
includeImports: req.query.include_imports, includeImports: req.query.include_imports,
deep: req.query.deep recursive: req.query.recursive
}); });
await server.services.auditLog.createAuditLog({ await server.services.auditLog.createAuditLog({
@@ -606,7 +606,7 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
workspaceId: z.string().trim(), workspaceId: z.string().trim(),
environment: z.string().trim(), environment: z.string().trim(),
secretPath: z.string().trim().default("/").transform(removeTrailingSlash), secretPath: z.string().trim().default("/").transform(removeTrailingSlash),
deep: z recursive: z
.enum(["true", "false"]) .enum(["true", "false"])
.default("false") .default("false")
.transform((value) => value === "true"), .transform((value) => value === "true"),
@@ -662,7 +662,7 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
projectId: req.query.workspaceId, projectId: req.query.workspaceId,
path: req.query.secretPath, path: req.query.secretPath,
includeImports: req.query.include_imports, includeImports: req.query.include_imports,
deep: req.query.deep recursive: req.query.recursive
}); });
await server.services.auditLog.createAuditLog({ await server.services.auditLog.createAuditLog({
@@ -440,7 +440,7 @@ export const secretServiceFactory = ({
actorOrgId, actorOrgId,
actorAuthMethod, actorAuthMethod,
includeImports, includeImports,
deep recursive
}: TGetSecretsDTO) => { }: TGetSecretsDTO) => {
const { permission } = await permissionService.getProjectPermission( const { permission } = await permissionService.getProjectPermission(
actor, actor,
@@ -452,7 +452,7 @@ export const secretServiceFactory = ({
let paths: { folderId: string; path: string }[] = []; let paths: { folderId: string; path: string }[] = [];
if (deep) { if (recursive) {
const getPaths = recursivelyGetSecretPaths({ const getPaths = recursivelyGetSecretPaths({
permissionService, permissionService,
folderDAL, folderDAL,
@@ -852,7 +852,7 @@ export const secretServiceFactory = ({
actorAuthMethod, actorAuthMethod,
environment, environment,
includeImports, includeImports,
deep recursive
}: TGetSecretsRawDTO) => { }: TGetSecretsRawDTO) => {
const botKey = await projectBotService.getBotKey(projectId); const botKey = await projectBotService.getBotKey(projectId);
if (!botKey) throw new BadRequestError({ message: "Project bot not found", name: "bot_not_found_error" }); if (!botKey) throw new BadRequestError({ message: "Project bot not found", name: "bot_not_found_error" });
@@ -866,7 +866,7 @@ export const secretServiceFactory = ({
actorAuthMethod, actorAuthMethod,
path, path,
includeImports, includeImports,
deep recursive
}); });
return { return {
+2 -2
View File
@@ -74,7 +74,7 @@ export type TGetSecretsDTO = {
path: string; path: string;
environment: string; environment: string;
includeImports?: boolean; includeImports?: boolean;
deep?: boolean; recursive?: boolean;
} & TProjectPermission; } & TProjectPermission;
export type TGetASecretDTO = { export type TGetASecretDTO = {
@@ -141,7 +141,7 @@ export type TGetSecretsRawDTO = {
path: string; path: string;
environment: string; environment: string;
includeImports?: boolean; includeImports?: boolean;
deep?: boolean; recursive?: boolean;
} & TProjectPermission; } & TProjectPermission;
export type TGetASecretRawDTO = { export type TGetASecretRawDTO = {