mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 09:26:47 +00:00
small typo fixes for error messages
This commit is contained in:
@@ -112,7 +112,7 @@ export const dynamicSecretServiceFactory = ({
|
|||||||
|
|
||||||
const existingDynamicSecret = await dynamicSecretDAL.findOne({ name, folderId: folder.id });
|
const existingDynamicSecret = await dynamicSecretDAL.findOne({ name, folderId: folder.id });
|
||||||
if (existingDynamicSecret)
|
if (existingDynamicSecret)
|
||||||
throw new BadRequestError({ message: "Provided dynamic secret already exist under the folder" });
|
throw new BadRequestError({ message: "Provided dynamic secret already exists under the folder" });
|
||||||
|
|
||||||
const selectedProvider = dynamicSecretProviders[provider.type];
|
const selectedProvider = dynamicSecretProviders[provider.type];
|
||||||
const inputs = await selectedProvider.validateProviderInputs(provider.inputs, { projectId });
|
const inputs = await selectedProvider.validateProviderInputs(provider.inputs, { projectId });
|
||||||
@@ -265,7 +265,7 @@ export const dynamicSecretServiceFactory = ({
|
|||||||
if (newName) {
|
if (newName) {
|
||||||
const existingDynamicSecret = await dynamicSecretDAL.findOne({ name: newName, folderId: folder.id });
|
const existingDynamicSecret = await dynamicSecretDAL.findOne({ name: newName, folderId: folder.id });
|
||||||
if (existingDynamicSecret)
|
if (existingDynamicSecret)
|
||||||
throw new BadRequestError({ message: "Provided dynamic secret already exist under the folder" });
|
throw new BadRequestError({ message: "Provided dynamic secret already exists under the folder" });
|
||||||
}
|
}
|
||||||
const { encryptor: secretManagerEncryptor, decryptor: secretManagerDecryptor } =
|
const { encryptor: secretManagerEncryptor, decryptor: secretManagerDecryptor } =
|
||||||
await kmsService.createCipherPairWithDataKey({
|
await kmsService.createCipherPairWithDataKey({
|
||||||
|
|||||||
@@ -1517,7 +1517,7 @@ export const secretApprovalRequestServiceFactory = ({
|
|||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
if (secrets.length)
|
if (secrets.length)
|
||||||
throw new BadRequestError({ message: `Secret already exist: ${secrets.map((el) => el.key).join(",")}` });
|
throw new BadRequestError({ message: `Secret already exists: ${secrets.map((el) => el.key).join(",")}` });
|
||||||
|
|
||||||
commits.push(
|
commits.push(
|
||||||
...createdSecrets.map((createdSecret) => ({
|
...createdSecrets.map((createdSecret) => ({
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export const importDataIntoInfisicalFn = async ({
|
|||||||
|
|
||||||
if (existingEnv) {
|
if (existingEnv) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: `Environment with slug '${slug}' already exist`,
|
message: `Environment with slug '${slug}' already exists`,
|
||||||
name: "CreateEnvironment"
|
name: "CreateEnvironment"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -312,7 +312,7 @@ export const importDataIntoInfisicalFn = async ({
|
|||||||
);
|
);
|
||||||
if (secretsByKeys.length) {
|
if (secretsByKeys.length) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: `Secret already exist: ${secretsByKeys.map((el) => el.key).join(",")}`
|
message: `Secret already exists: ${secretsByKeys.map((el) => el.key).join(",")}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
await fnSecretBulkInsert({
|
await fnSecretBulkInsert({
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ export const orgServiceFactory = ({
|
|||||||
if (slug) {
|
if (slug) {
|
||||||
const existingOrg = await orgDAL.findOne({ slug, rootOrgId: null });
|
const existingOrg = await orgDAL.findOne({ slug, rootOrgId: null });
|
||||||
if (existingOrg && existingOrg?.id !== orgId)
|
if (existingOrg && existingOrg?.id !== orgId)
|
||||||
throw new BadRequestError({ message: `Organization with slug ${slug} already exist` });
|
throw new BadRequestError({ message: `Organization with slug ${slug} already exists` });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (googleSsoAuthEnforced) {
|
if (googleSsoAuthEnforced) {
|
||||||
@@ -1149,7 +1149,7 @@ export const orgServiceFactory = ({
|
|||||||
const doesIncidentContactExist = await incidentContactDAL.findOne(orgId, { email });
|
const doesIncidentContactExist = await incidentContactDAL.findOne(orgId, { email });
|
||||||
if (doesIncidentContactExist) {
|
if (doesIncidentContactExist) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "Incident contact already exist",
|
message: "Incident contact already exists",
|
||||||
name: "Incident contact exist"
|
name: "Incident contact exist"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export const projectEnvServiceFactory = ({
|
|||||||
const existingEnv = envs.find(({ slug: envSlug }) => envSlug === slug);
|
const existingEnv = envs.find(({ slug: envSlug }) => envSlug === slug);
|
||||||
if (existingEnv)
|
if (existingEnv)
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "Environment with slug already exist",
|
message: "Environment with slug already exists",
|
||||||
name: "CreateEnvironment"
|
name: "CreateEnvironment"
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ export const projectEnvServiceFactory = ({
|
|||||||
const existingEnv = await projectEnvDAL.findOne({ slug, projectId });
|
const existingEnv = await projectEnvDAL.findOne({ slug, projectId });
|
||||||
if (existingEnv && existingEnv.id !== id) {
|
if (existingEnv && existingEnv.id !== id) {
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: "Environment with slug already exist",
|
message: "Environment with slug already exists",
|
||||||
name: "UpdateEnvironment"
|
name: "UpdateEnvironment"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const secretTagServiceFactory = ({ secretTagDAL, permissionService }: TSe
|
|||||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.Tags);
|
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.Tags);
|
||||||
|
|
||||||
const existingTag = await secretTagDAL.findOne({ slug, projectId });
|
const existingTag = await secretTagDAL.findOne({ slug, projectId });
|
||||||
if (existingTag) throw new BadRequestError({ message: "Tag already exist" });
|
if (existingTag) throw new BadRequestError({ message: "Tag already exists" });
|
||||||
|
|
||||||
const newTag = await secretTagDAL.create({
|
const newTag = await secretTagDAL.create({
|
||||||
projectId,
|
projectId,
|
||||||
@@ -53,7 +53,7 @@ export const secretTagServiceFactory = ({ secretTagDAL, permissionService }: TSe
|
|||||||
|
|
||||||
if (slug) {
|
if (slug) {
|
||||||
const existingTag = await secretTagDAL.findOne({ slug, projectId: tag.projectId });
|
const existingTag = await secretTagDAL.findOne({ slug, projectId: tag.projectId });
|
||||||
if (existingTag && existingTag.id !== tag.id) throw new BadRequestError({ message: "Tag already exist" });
|
if (existingTag && existingTag.id !== tag.id) throw new BadRequestError({ message: "Tag already exists" });
|
||||||
}
|
}
|
||||||
|
|
||||||
const { permission } = await permissionService.getProjectPermission({
|
const { permission } = await permissionService.getProjectPermission({
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ export const secretV2BridgeServiceFactory = ({
|
|||||||
folderId
|
folderId
|
||||||
});
|
});
|
||||||
if (inputSecret.type === SecretType.Shared && doesSecretExist)
|
if (inputSecret.type === SecretType.Shared && doesSecretExist)
|
||||||
throw new BadRequestError({ message: "Secret already exist" });
|
throw new BadRequestError({ message: "Secret already exists" });
|
||||||
|
|
||||||
// if user creating personal check its shared also exist
|
// if user creating personal check its shared also exist
|
||||||
if (inputSecret.type === SecretType.Personal && !doesSecretExist) {
|
if (inputSecret.type === SecretType.Personal && !doesSecretExist) {
|
||||||
@@ -527,7 +527,7 @@ export const secretV2BridgeServiceFactory = ({
|
|||||||
type: SecretType.Shared,
|
type: SecretType.Shared,
|
||||||
folderId
|
folderId
|
||||||
});
|
});
|
||||||
if (doesNewNameSecretExist) throw new BadRequestError({ message: "Secret with the new name already exist" });
|
if (doesNewNameSecretExist) throw new BadRequestError({ message: "Secret with the new name already exists" });
|
||||||
ForbiddenError.from(permission).throwUnlessCan(
|
ForbiddenError.from(permission).throwUnlessCan(
|
||||||
ProjectPermissionSecretActions.Edit,
|
ProjectPermissionSecretActions.Edit,
|
||||||
subject(ProjectPermissionSub.Secrets, {
|
subject(ProjectPermissionSub.Secrets, {
|
||||||
@@ -1674,7 +1674,7 @@ export const secretV2BridgeServiceFactory = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (secrets.length)
|
if (secrets.length)
|
||||||
throw new BadRequestError({ message: `Secret already exist: ${secrets.map((el) => el.key).join(",")}` });
|
throw new BadRequestError({ message: `Secret already exists: ${secrets.map((el) => el.key).join(",")}` });
|
||||||
|
|
||||||
const project = await projectDAL.findById(projectId);
|
const project = await projectDAL.findById(projectId);
|
||||||
await scanSecretPolicyViolations(projectId, secretPath, inputSecrets, project.secretDetectionIgnoreValues || []);
|
await scanSecretPolicyViolations(projectId, secretPath, inputSecrets, project.secretDetectionIgnoreValues || []);
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ export const fnSecretBlindIndexCheck = async ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
if (secrets.length) throw new BadRequestError({ message: "Secret already exist" });
|
if (secrets.length) throw new BadRequestError({ message: "Secret already exists" });
|
||||||
} else {
|
} else {
|
||||||
const secretKeysInDB = unique(secrets, (el) => el.secretBlindIndex as string).map(
|
const secretKeysInDB = unique(secrets, (el) => el.secretBlindIndex as string).map(
|
||||||
(el) => blindIndex2KeyName[el.secretBlindIndex as string]
|
(el) => blindIndex2KeyName[el.secretBlindIndex as string]
|
||||||
@@ -819,7 +819,7 @@ export const createManySecretsRawFnFactory = ({
|
|||||||
);
|
);
|
||||||
if (secretsStoredInDB.length)
|
if (secretsStoredInDB.length)
|
||||||
throw new BadRequestError({
|
throw new BadRequestError({
|
||||||
message: `Secret already exist: ${secretsStoredInDB.map((el) => el.key).join(",")}`
|
message: `Secret already exists: ${secretsStoredInDB.map((el) => el.key).join(",")}`
|
||||||
});
|
});
|
||||||
|
|
||||||
const inputSecrets = secrets.map((secret) => {
|
const inputSecrets = secrets.map((secret) => {
|
||||||
|
|||||||
@@ -2751,7 +2751,7 @@ export const secretServiceFactory = ({
|
|||||||
const existingSecretTags = await secretDAL.getSecretTags(secret.id);
|
const existingSecretTags = await secretDAL.getSecretTags(secret.id);
|
||||||
|
|
||||||
if (existingSecretTags.some((tag) => tagSlugs.includes(tag.slug))) {
|
if (existingSecretTags.some((tag) => tagSlugs.includes(tag.slug))) {
|
||||||
throw new BadRequestError({ message: "One or more tags already exist on the secret" });
|
throw new BadRequestError({ message: "One or more tags already exists on the secret" });
|
||||||
}
|
}
|
||||||
|
|
||||||
const combinedTags = new Set([...existingSecretTags.map((tag) => tag.id), ...tags.map((el) => el.id)]);
|
const combinedTags = new Set([...existingSecretTags.map((tag) => tag.id), ...tags.map((el) => el.id)]);
|
||||||
|
|||||||
Reference in New Issue
Block a user