Skip to content

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

Merge remote-tracking branch 'origin/main' into feat/gateway-v2

Sheen Capadngane30cb9d76730
diff --cc backend/src/keystore/keystore.ts
index d7b097cbc3,777e73fe2b..d7a28da965
--- a/backend/src/keystore/keystore.ts
+++ b/backend/src/keystore/keystore.ts
@@@ -14,9 -14,7 +14,10 @@@ export const PgSqlLock =
CreateProject: (orgId: string) => pgAdvisoryLockHashText(`create-project:${orgId}`),
CreateFolder: (envId: string, projectId: string) => pgAdvisoryLockHashText(`create-folder:${envId}-${projectId}`),
SshInit: (projectId: string) => pgAdvisoryLockHashText(`ssh-bootstrap:${projectId}`),
+ InstanceProxyConfigInit: () => pgAdvisoryLockHashText("instance-proxy-config-init"),
+ OrgGatewayV2Init: (orgId: string) => pgAdvisoryLockHashText(`org-gateway-v2-init:${orgId}`),
- OrgProxyConfigInit: (orgId: string) => pgAdvisoryLockHashText(`org-proxy-config-init:${orgId}`)
++ OrgProxyConfigInit: (orgId: string) => pgAdvisoryLockHashText(`org-proxy-config-init:${orgId}`),
+ IdentityLogin: (identityId: string, nonce: string) => pgAdvisoryLockHashText(`identity-login:${identityId}:${nonce}`)
} as const;
// all the key prefixes used must be set here to avoid conflict
diff --cc backend/src/services/app-connection/github/github-connection-fns.ts
index ef7a9cfd68,05e6fdda34..e59367ed31
--- a/backend/src/services/app-connection/github/github-connection-fns.ts
+++ b/backend/src/services/app-connection/github/github-connection-fns.ts
@@@ -6,12 -4,11 +4,13 @@@ import RE2 from "re2"
import { verifyHostInputValidity } from "@app/ee/services/dynamic-secret/dynamic-secret-fns";
import { TGatewayServiceFactory } from "@app/ee/services/gateway/gateway-service";
+import { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";
import { getConfig } from "@app/lib/config/env";
import { request as httpRequest } from "@app/lib/config/request";
+ import { crypto } from "@app/lib/crypto";
import { BadRequestError, ForbiddenRequestError, InternalServerError } from "@app/lib/errors";
import { GatewayProxyProtocol, withGatewayProxy } from "@app/lib/gateway";
+import { withGatewayV2Proxy } from "@app/lib/gateway-v2/gateway-v2";
import { logger } from "@app/lib/logger";
import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";
import { getAppConnectionMethodName } from "@app/services/app-connection/app-connection-fns";
diff --cc backend/src/services/secret-sync/github/github-sync-fns.ts
index e417634749,2cae048aa4..9138813817
--- a/backend/src/services/secret-sync/github/github-sync-fns.ts
+++ b/backend/src/services/secret-sync/github/github-sync-fns.ts
@@@ -214,10 -207,10 +214,10 @@@ export const GithubSyncFns =
const token =
connection.method === GitHubConnectionMethod.OAuth
? connection.credentials.accessToken
- : await getGitHubAppAuthToken(connection);
+ : await getGitHubAppAuthToken(connection, gatewayService);
- const encryptedSecrets = await getEncryptedSecrets(secretSync, gatewayService);
- const publicKey = await getPublicKey(secretSync, gatewayService, token);
+ const encryptedSecrets = await getEncryptedSecrets(secretSync, gatewayService, gatewayV2Service);
+ const publicKey = await getPublicKey(secretSync, gatewayService, gatewayV2Service, token);
await sodium.ready;
for await (const key of Object.keys(secretMap)) {
@@@ -272,9 -264,9 +272,9 @@@
const token =
connection.method === GitHubConnectionMethod.OAuth
? connection.credentials.accessToken
- : await getGitHubAppAuthToken(connection);
+ : await getGitHubAppAuthToken(connection, gatewayService);
- const encryptedSecrets = await getEncryptedSecrets(secretSync, gatewayService);
+ const encryptedSecrets = await getEncryptedSecrets(secretSync, gatewayService, gatewayV2Service);
for await (const encryptedSecret of encryptedSecrets) {
if (encryptedSecret.name in secretMap) {