Skip to content

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

fix lint issues

Matheus Nogueirad5a4968840bb
diff --git a/backend/src/ee/services/secret-replication/secret-replication-service.ts b/backend/src/ee/services/secret-replication/secret-replication-service.ts
index e843787002..74b1ae453d 100644
--- a/backend/src/ee/services/secret-replication/secret-replication-service.ts
+++ b/backend/src/ee/services/secret-replication/secret-replication-service.ts
@@ -1,5 +1,4 @@
import { SecretType, TSecrets, TSecretsV2 } from "@app/db/schemas";
-import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { getCommitterIds, shouldApplyPolicy } from "@app/ee/services/secret-approval-policy/secret-approval-policy-fns";
import { TSecretApprovalPolicyServiceFactory } from "@app/ee/services/secret-approval-policy/secret-approval-policy-service";
import { TSecretApprovalRequestDALFactory } from "@app/ee/services/secret-approval-request/secret-approval-request-dal";
@@ -95,7 +94,6 @@ type TSecretReplicationServiceFactoryDep = {
folderCommitService: Pick<TFolderCommitServiceFactory, "createCommit">;
projectFolderGrantDAL: Pick<TProjectFolderGrantDALFactory, "find">;
orgDAL: Pick<TOrgDALFactory, "findOrgById">;
- licenseService: Pick<TLicenseServiceFactory, "getPlan">;
};
export type TSecretReplicationServiceFactory = ReturnType<typeof secretReplicationServiceFactory>;
@@ -145,7 +143,6 @@ export const secretReplicationServiceFactory = ({
folderCommitService,
projectFolderGrantDAL,
orgDAL,
- licenseService,
resourceMetadataDAL
}: TSecretReplicationServiceFactoryDep) => {
const $getReplicatedSecrets = (
diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.ts
index e230d1efb5..bfda86d372 100644
--- a/backend/src/server/routes/index.ts
+++ b/backend/src/server/routes/index.ts
@@ -2315,8 +2315,7 @@ export const registerRoutes = async (
keyStore,
secretValidationRuleService,
projectFolderGrantDAL,
- orgDAL,
- licenseService
+ orgDAL
});
const secretApprovalRequestService = secretApprovalRequestServiceFactory({
@@ -2478,8 +2477,7 @@ export const registerRoutes = async (
resourceMetadataDAL,
folderCommitService,
projectFolderGrantDAL,
- orgDAL,
- licenseService
+ orgDAL
});
const integrationService = integrationServiceFactory({
@@ -2495,8 +2493,7 @@ export const registerRoutes = async (
secretDAL,
kmsService,
projectFolderGrantDAL,
- orgDAL,
- licenseService
+ orgDAL
});
const accessTokenQueue = accessTokenQueueServiceFactory({
diff --git a/backend/src/services/integration-auth/integration-delete-secret.ts b/backend/src/services/integration-auth/integration-delete-secret.ts
index 2d3b7a2e3b..e1c9c0329c 100644
--- a/backend/src/services/integration-auth/integration-delete-secret.ts
+++ b/backend/src/services/integration-auth/integration-delete-secret.ts
@@ -4,7 +4,6 @@ import { retry } from "@octokit/plugin-retry";
import { Octokit } from "@octokit/rest";
import { TIntegrationAuths, TIntegrations } from "@app/db/schemas";
-import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { getConfig } from "@app/lib/config/env";
import { crypto, SymmetricKeySize } from "@app/lib/crypto/cryptography";
import { BadRequestError, NotFoundError } from "@app/lib/errors";
@@ -46,8 +45,7 @@ const getIntegrationSecretsV2 = async (
secretImportDAL: Pick<TSecretImportDALFactory, "find" | "findByFolderIds" | "findByIds">,
kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">,
projectFolderGrantDAL: Pick<TProjectFolderGrantDALFactory, "find">,
- orgDAL: Pick<TOrgDALFactory, "findOrgById">,
- licenseService: Pick<TLicenseServiceFactory, "getPlan">
+ orgDAL: Pick<TOrgDALFactory, "findOrgById">
) => {
const content: Record<string, boolean> = {};
if (dto.depth > MAX_SYNC_SECRET_DEPTH) {
@@ -300,7 +298,6 @@ export const deleteIntegrationSecrets = async ({
kmsService,
projectFolderGrantDAL,
orgDAL,
- licenseService,
actorOrgId
}: {
integration: Omit<TIntegrations, "envId"> & {
@@ -322,7 +319,6 @@ export const deleteIntegrationSecrets = async ({
kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;
projectFolderGrantDAL: Pick<TProjectFolderGrantDALFactory, "find">;
orgDAL: Pick<TOrgDALFactory, "findOrgById">;
- licenseService: Pick<TLicenseServiceFactory, "getPlan">;
actorOrgId: string;
}) => {
const { shouldUseSecretV2Bridge, botKey } = await projectBotService.getBotKey(integration.projectId);
@@ -365,8 +361,7 @@ export const deleteIntegrationSecrets = async ({
secretImportDAL,
kmsService,
projectFolderGrantDAL,
- orgDAL,
- licenseService
+ orgDAL
)
: await getIntegrationSecretsV1(
{
diff --git a/backend/src/services/integration/integration-service.ts b/backend/src/services/integration/integration-service.ts
index 4bbda69cfa..8eaeac96d5 100644
--- a/backend/src/services/integration/integration-service.ts
+++ b/backend/src/services/integration/integration-service.ts
@@ -1,7 +1,6 @@
import { ForbiddenError } from "@casl/ability";
import { ActionProjectType } from "@app/db/schemas";
-import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { throwIfMissingSecretReadValueOrDescribePermission } from "@app/ee/services/permission/permission-fns";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
import {
@@ -47,7 +46,6 @@ type TIntegrationServiceFactoryDep = {
secretDAL: Pick<TSecretDALFactory, "findByFolderId">;
projectFolderGrantDAL: Pick<TProjectFolderGrantDALFactory, "find">;
orgDAL: Pick<TOrgDALFactory, "findOrgById">;
- licenseService: Pick<TLicenseServiceFactory, "getPlan">;
};
export type TIntegrationServiceFactory = ReturnType<typeof integrationServiceFactory>;
@@ -65,8 +63,7 @@ export const integrationServiceFactory = ({
kmsService,
secretDAL,
projectFolderGrantDAL,
- orgDAL,
- licenseService
+ orgDAL
}: TIntegrationServiceFactoryDep) => {
const updateIntegration = async ({
actorId,
@@ -248,7 +245,6 @@ export const integrationServiceFactory = ({
kmsService,
projectFolderGrantDAL,
orgDAL,
- licenseService,
actorOrgId
});
}
diff --git a/backend/src/services/secret-v2-bridge/secret-reference-fns.ts b/backend/src/services/secret-v2-bridge/secret-reference-fns.ts
index e2a45dc0d3..7674c66c50 100644
--- a/backend/src/services/secret-v2-bridge/secret-reference-fns.ts
+++ b/backend/src/services/secret-v2-bridge/secret-reference-fns.ts
@@ -127,9 +127,7 @@ export const expandSecretReferencesFactory = ({
}: TInterpolateSecretArg) => {
const secretCache: Record<string, Record<string, { value: string; tags: string[]; exists: boolean }>> = {};
let crossProjectAllowedCache: boolean | undefined;
- const hasCrossProjectConfig = Boolean(
- actorOrgId && orgDAL && projectFolderGrantDAL && projectDAL && kmsService
- );
+ const hasCrossProjectConfig = Boolean(actorOrgId && orgDAL && projectFolderGrantDAL && projectDAL && kmsService);
const checkCrossProjectAllowed = async () => {
if (!hasCrossProjectConfig || !actorOrgId || !orgDAL) return false;
if (crossProjectAllowedCache !== undefined) return crossProjectAllowedCache;
diff --git a/backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts b/backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts
index 3c4c34eb48..178099cadd 100644
--- a/backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts
+++ b/backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts
@@ -10,7 +10,6 @@ import {
TableName,
TSecretsV2
} from "@app/db/schemas";
-import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import {
hasSecretReadValueOrDescribePermission,
throwIfMissingSecretReadValueOrDescribePermission
@@ -181,7 +180,6 @@ type TSecretV2BridgeServiceFactoryDep = {
secretValidationRuleService: Pick<TSecretValidationRuleServiceFactory, "validateSecrets">;
projectFolderGrantDAL: Pick<TProjectFolderGrantDALFactory, "find">;
orgDAL: Pick<TOrgDALFactory, "findOrgById">;
- licenseService: Pick<TLicenseServiceFactory, "getPlan">;
};
export type TSecretV2BridgeServiceFactory = ReturnType<typeof secretV2BridgeServiceFactory>;
@@ -211,8 +209,7 @@ export const secretV2BridgeServiceFactory = ({
reminderDAL,
secretValidationRuleService,
projectFolderGrantDAL,
- orgDAL,
- licenseService
+ orgDAL
}: TSecretV2BridgeServiceFactoryDep) => {
const $validateSecretReferences = async (
projectId: string,
diff --git a/frontend/src/components/v3/platform/SecretInput/InfisicalSecretInput.tsx b/frontend/src/components/v3/platform/SecretInput/InfisicalSecretInput.tsx
index 0a9df25889..2544c807ed 100644
--- a/frontend/src/components/v3/platform/SecretInput/InfisicalSecretInput.tsx
+++ b/frontend/src/components/v3/platform/SecretInput/InfisicalSecretInput.tsx
@@ -89,7 +89,7 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
const isPopupOpen = openRefLeft !== -1 && isFocused && !isCrossProjectRefWithoutAccess;
- const handleWizardSelect = (referenceContent: string) => {
+ const handleWizardSelect = (selectedReference: string) => {
const left = openRefLeft + 1; // position right after ${
const rightBracketIndex = getIndexOfUnclosedRefToTheRight(value, left);
const isEnclosed = rightBracketIndex !== -1;
@@ -99,13 +99,13 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
rightBracketIndex !== -1 ? rightBracketIndex + 1 : currentCursorPosition
);
- const newValue = `${lhsValue}${referenceContent}${isEnclosed ? "" : "}"}${rhsValue}`;
+ const newValue = `${lhsValue}${selectedReference}${isEnclosed ? "" : "}"}${rhsValue}`;
onChange?.(newValue);
const delay = setTimeout(() => {
clearTimeout(delay);
if (inputRef.current) {
- const cursorPos = lhsValue.length + referenceContent.length + 1; // +1 for }
+ const cursorPos = lhsValue.length + selectedReference.length + 1; // +1 for }
inputRef.current.selectionStart = cursorPos;
inputRef.current.selectionEnd = cursorPos;
}
diff --git a/frontend/src/pages/project/SettingsPage/components/CrossProjectSharingSection/CrossProjectSharingSection.tsx b/frontend/src/pages/project/SettingsPage/components/CrossProjectSharingSection/CrossProjectSharingSection.tsx
index 8961d32c1b..e22141e05f 100644
--- a/frontend/src/pages/project/SettingsPage/components/CrossProjectSharingSection/CrossProjectSharingSection.tsx
+++ b/frontend/src/pages/project/SettingsPage/components/CrossProjectSharingSection/CrossProjectSharingSection.tsx
@@ -60,12 +60,12 @@ import {
useProjectPermission,
useSubscription
} from "@app/context";
-import { usePopUp } from "@app/hooks/usePopUp";
import {
TProjectFolderGrant,
useListProjectFolderGrants
} from "@app/hooks/api/projectFolderGrants";
import { projectFolderGrantKeys } from "@app/hooks/api/projectFolderGrants/queries";
+import { usePopUp } from "@app/hooks/usePopUp";
import { ShareSecretsEditData, ShareSecretsSheet } from "./ShareSecretsSheet";