Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvements: address feedback

Scott Wilsond8ee05bfba49
diff --git a/backend/src/ee/services/secret-scanning-v2/github/github-secret-scanning-factory.ts b/backend/src/ee/services/secret-scanning-v2/github/github-secret-scanning-factory.ts
index fc104e7811..2dde97d7c0 100644
--- a/backend/src/ee/services/secret-scanning-v2/github/github-secret-scanning-factory.ts
+++ b/backend/src/ee/services/secret-scanning-v2/github/github-secret-scanning-factory.ts
@@ -42,7 +42,9 @@ export const GitHubSecretScanningFactory = () => {
});
if (existingDataSource)
- throw new BadRequestError({ message: "A Data Source already exists for this GitHub Radar Connection" });
+ throw new BadRequestError({
+ message: `A Data Source already exists for this GitHub Radar Connection in the Project with ID "${existingDataSource.projectId}"`
+ });
return callback({
externalId
diff --git a/backend/src/ee/services/secret-scanning-v2/github/github-secret-scanning-schemas.ts b/backend/src/ee/services/secret-scanning-v2/github/github-secret-scanning-schemas.ts
index e36248bfba..f1eec125c5 100644
--- a/backend/src/ee/services/secret-scanning-v2/github/github-secret-scanning-schemas.ts
+++ b/backend/src/ee/services/secret-scanning-v2/github/github-secret-scanning-schemas.ts
@@ -17,9 +17,15 @@ import { AppConnection } from "@app/services/app-connection/app-connection-enums
export const GitHubDataSourceConfigSchema = z.object({
includeRepos: z
- .array(z.string().regex(GitHubRepositoryRegex, "Invalid repository name format").min(1).max(256))
+ .array(
+ z
+ .string()
+ .min(1)
+ .max(256)
+ .refine((value) => value === "*" || GitHubRepositoryRegex.test(value), "Invalid repository name format")
+ )
.nonempty("One or more repositories required")
- .max(25)
+ .max(100, "Cannot configure more than 100 repositories")
.default(["*"])
.describe(SecretScanningDataSources.CONFIG.GITHUB.includeRepos)
});
diff --git a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-fns.ts b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-fns.ts
index 031d15bb7c..64a0ba4ed1 100644
--- a/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-fns.ts
+++ b/backend/src/ee/services/secret-scanning-v2/secret-scanning-v2-fns.ts
@@ -95,7 +95,7 @@ export const convertPatchLineToFileLineNumber = (patch: string, patchLineNumber:
currentPatchLine += 1;
// Hunk header: @@ -a,b +c,d @@
- const hunkHeaderMatch = line.match(HunkHeaderRegex);
+ const hunkHeaderMatch = HunkHeaderRegex.match(line);
if (hunkHeaderMatch) {
const startLine = parseInt(hunkHeaderMatch[1], 10);
currentNewLine = startLine;
diff --git a/backend/src/services/app-connection/ldap/ldap-connection-schemas.ts b/backend/src/services/app-connection/ldap/ldap-connection-schemas.ts
index c4c94b4fcb..134b9667bd 100644
--- a/backend/src/services/app-connection/ldap/ldap-connection-schemas.ts
+++ b/backend/src/services/app-connection/ldap/ldap-connection-schemas.ts
@@ -13,7 +13,12 @@ import { LdapConnectionMethod, LdapProvider } from "./ldap-connection-enums";
export const LdapConnectionSimpleBindCredentialsSchema = z.object({
provider: z.nativeEnum(LdapProvider).describe(AppConnections.CREDENTIALS.LDAP.provider),
- url: z.string().trim().min(1, "URL required").regex(LdapUrlRegex).describe(AppConnections.CREDENTIALS.LDAP.url),
+ url: z
+ .string()
+ .trim()
+ .min(1, "URL required")
+ .refine((value) => LdapUrlRegex.test(value), "Invalid LDAP URL")
+ .describe(AppConnections.CREDENTIALS.LDAP.url),
dn: z
.string()
.trim()
diff --git a/frontend/src/components/secret-scanning/forms/schemas/github-data-source-schema.ts b/frontend/src/components/secret-scanning/forms/schemas/github-data-source-schema.ts
index 86f22b2b44..2b5f87f826 100644
--- a/frontend/src/components/secret-scanning/forms/schemas/github-data-source-schema.ts
+++ b/frontend/src/components/secret-scanning/forms/schemas/github-data-source-schema.ts
@@ -12,7 +12,7 @@ export const GitHubDataSourceSchema = z
.string()
.array()
.min(1, "One or more repositories required")
- .max(25, "Cannot configure more than 25 repositories")
+ .max(100, "Cannot configure more than 100 repositories")
})
})
.merge(BaseSecretScanningDataSourceSchema({ isConnectionRequired: true }));