requested changes

This commit is contained in:
Daniel Hougaard
2025-02-07 07:49:42 +04:00
parent 8d7b5968d3
commit 70c9761abe
2 changed files with 6 additions and 5 deletions

View File

@@ -689,8 +689,8 @@ export const RAW_SECRETS = {
secretPath: "The secret path to list secrets from.", secretPath: "The secret path to list secrets from.",
includeImports: "Weather to include imported secrets or not.", includeImports: "Weather to include imported secrets or not.",
tagSlugs: "The comma separated tag slugs to filter secrets.", tagSlugs: "The comma separated tag slugs to filter secrets.",
secretMetadata: metadataFilter:
"The secret metadata key-value pairs to filter secrets by. When querying for multiple metadata pairs, the query is treated as an AND operation. Secret metadata format is key1:value1,key2:value2." "The secret metadata key-value pairs to filter secrets by. When querying for multiple metadata pairs, the query is treated as an AND operation. Secret metadata format is key=value1,value=value2|key=value3,value=value4."
}, },
CREATE: { CREATE: {
secretName: "The name of the secret to create.", secretName: "The name of the secret to create.",

View File

@@ -216,7 +216,8 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
if (metadata && !Array.isArray(metadata)) { if (metadata && !Array.isArray(metadata)) {
ctx.addIssue({ ctx.addIssue({
code: z.ZodIssueCode.custom, code: z.ZodIssueCode.custom,
message: "Invalid secretMetadata format. Correct format is key1:value1,key2:value2" message:
"Invalid secretMetadata format. Correct format is key=value1,value=value2|key=value3,value=value4."
}); });
} }
@@ -233,13 +234,13 @@ export const registerSecretRouter = async (server: FastifyZodProvider) => {
ctx.addIssue({ ctx.addIssue({
code: z.ZodIssueCode.custom, code: z.ZodIssueCode.custom,
message: message:
"Invalid secretMetadata format, key or value must be provided. Correct format is key1:value1,key2:value2" "Invalid secretMetadata format, key or value must be provided. Correct format is key=value1,value=value2|key=value3,value=value4."
}); });
} }
} }
} }
}) })
.describe(RAW_SECRETS.LIST.secretMetadata), .describe(RAW_SECRETS.LIST.metadataFilter),
workspaceId: z.string().trim().optional().describe(RAW_SECRETS.LIST.workspaceId), workspaceId: z.string().trim().optional().describe(RAW_SECRETS.LIST.workspaceId),
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),