mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Patch broken integratins due to permission update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { Request, Response } from "express";
|
import { Request, Response } from "express";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { IWorkspace, Integration, Folder, IntegrationAuth } from "../../models";
|
import { Folder, IWorkspace, Integration, IntegrationAuth } from "../../models";
|
||||||
import { EventService } from "../../services";
|
import { EventService } from "../../services";
|
||||||
import { eventStartIntegration } from "../../events";
|
import { eventStartIntegration } from "../../events";
|
||||||
import { getFolderByPath } from "../../services/FolderService";
|
import { getFolderByPath } from "../../services/FolderService";
|
||||||
@@ -38,7 +38,8 @@ export const createIntegration = async (req: Request, res: Response) => {
|
|||||||
targetServiceId,
|
targetServiceId,
|
||||||
integrationAuthId,
|
integrationAuthId,
|
||||||
targetEnvironment,
|
targetEnvironment,
|
||||||
targetEnvironmentId
|
targetEnvironmentId,
|
||||||
|
metadata
|
||||||
}
|
}
|
||||||
} = await validateRequest(reqValidator.CreateIntegrationV1, req);
|
} = await validateRequest(reqValidator.CreateIntegrationV1, req);
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ export const createIntegration = async (req: Request, res: Response) => {
|
|||||||
|
|
||||||
const { permission } = await getUserProjectPermissions(
|
const { permission } = await getUserProjectPermissions(
|
||||||
req.user._id,
|
req.user._id,
|
||||||
integrationAuth.workspace.toString()
|
integrationAuth.workspace._id.toString()
|
||||||
);
|
);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(
|
ForbiddenError.from(permission).throwUnlessCan(
|
||||||
ProjectPermissionActions.Create,
|
ProjectPermissionActions.Create,
|
||||||
@@ -91,7 +92,8 @@ export const createIntegration = async (req: Request, res: Response) => {
|
|||||||
region,
|
region,
|
||||||
secretPath,
|
secretPath,
|
||||||
integration: integrationAuth.integration,
|
integration: integrationAuth.integration,
|
||||||
integrationAuth: new Types.ObjectId(integrationAuthId)
|
integrationAuth: new Types.ObjectId(integrationAuthId),
|
||||||
|
metadata
|
||||||
}).save();
|
}).save();
|
||||||
|
|
||||||
if (integration) {
|
if (integration) {
|
||||||
|
|||||||
@@ -2012,7 +2012,6 @@ const syncSecretsCheckly = async ({
|
|||||||
secrets: Record<string, { value: string; comment?: string }>;
|
secrets: Record<string, { value: string; comment?: string }>;
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const getSecretsRes = (
|
const getSecretsRes = (
|
||||||
await standardRequest.get(`${INTEGRATION_CHECKLY_API_URL}/v1/variables`, {
|
await standardRequest.get(`${INTEGRATION_CHECKLY_API_URL}/v1/variables`, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -2890,4 +2889,4 @@ const syncSecretsNorthflank = async ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { syncSecrets };
|
export { syncSecrets };
|
||||||
@@ -64,18 +64,21 @@ export const validateClientForIntegration = async ({
|
|||||||
export const CreateIntegrationV1 = z.object({
|
export const CreateIntegrationV1 = z.object({
|
||||||
body: z.object({
|
body: z.object({
|
||||||
integrationAuthId: z.string().trim(),
|
integrationAuthId: z.string().trim(),
|
||||||
app: z.string().trim(),
|
app: z.string().trim().optional(),
|
||||||
isActive: z.boolean(),
|
isActive: z.boolean(),
|
||||||
appId: z.string().trim(),
|
appId: z.string().trim().optional(),
|
||||||
secretPath: z.string().trim().default("/"),
|
secretPath: z.string().trim().default("/"),
|
||||||
sourceEnvironment: z.string().trim(),
|
sourceEnvironment: z.string().trim(),
|
||||||
targetEnvironment: z.string().trim(),
|
targetEnvironment: z.string().trim().optional(),
|
||||||
targetEnvironmentId: z.string().trim(),
|
targetEnvironmentId: z.string().trim().optional(),
|
||||||
targetService: z.string().trim(),
|
targetService: z.string().trim().optional(),
|
||||||
targetServiceId: z.string().trim(),
|
targetServiceId: z.string().trim().optional(),
|
||||||
owner: z.string().trim(),
|
owner: z.string().trim().optional(),
|
||||||
path: z.string().trim(),
|
path: z.string().trim().optional(),
|
||||||
region: z.string().trim()
|
region: z.string().trim().optional(),
|
||||||
|
metadata: z.object({
|
||||||
|
secretSuffix: z.string().optional()
|
||||||
|
}).optional()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ export const OauthExchangeV1 = z.object({
|
|||||||
export const SaveIntegrationAccessTokenV1 = z.object({
|
export const SaveIntegrationAccessTokenV1 = z.object({
|
||||||
body: z.object({
|
body: z.object({
|
||||||
workspaceId: z.string().trim(),
|
workspaceId: z.string().trim(),
|
||||||
|
integration: z.string().trim(),
|
||||||
accessId: z.string().trim().optional(),
|
accessId: z.string().trim().optional(),
|
||||||
accessToken: z.string().trim().optional(),
|
accessToken: z.string().trim().optional(),
|
||||||
url: z.string().url().trim(),
|
url: z.string().url().trim().optional(),
|
||||||
namespace: z.string().trim(),
|
namespace: z.string().trim().optional(),
|
||||||
integration: z.string().trim(),
|
|
||||||
refreshToken:z.string().trim().optional()
|
refreshToken:z.string().trim().optional()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -93,8 +93,8 @@ export const GetIntegrationAuthAppsV1 = z.object({
|
|||||||
integrationAuthId: z.string().trim()
|
integrationAuthId: z.string().trim()
|
||||||
}),
|
}),
|
||||||
query: z.object({
|
query: z.object({
|
||||||
teamId: z.string().trim(),
|
teamId: z.string().trim().optional(),
|
||||||
workspaceSlug: z.string().trim()
|
workspaceSlug: z.string().trim().optional()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -408,8 +408,8 @@ export const useSaveIntegrationAccessToken = () => {
|
|||||||
refreshToken?: string;
|
refreshToken?: string;
|
||||||
accessId?: string;
|
accessId?: string;
|
||||||
accessToken?: string;
|
accessToken?: string;
|
||||||
url: string | null;
|
url?: string;
|
||||||
namespace: string | null;
|
namespace?: string;
|
||||||
}) => {
|
}) => {
|
||||||
const { data: { integrationAuth } } = await apiRequest.post("/api/v1/integration-auth/access-token", {
|
const { data: { integrationAuth } } = await apiRequest.post("/api/v1/integration-auth/access-token", {
|
||||||
workspaceId,
|
workspaceId,
|
||||||
|
|||||||
@@ -49,13 +49,13 @@ export const useCreateIntegration = () => {
|
|||||||
app?: string;
|
app?: string;
|
||||||
appId?: string;
|
appId?: string;
|
||||||
sourceEnvironment: string;
|
sourceEnvironment: string;
|
||||||
targetEnvironment: string | null;
|
targetEnvironment?: string;
|
||||||
targetEnvironmentId: string | null;
|
targetEnvironmentId?: string;
|
||||||
targetService: string | null;
|
targetService?: string;
|
||||||
targetServiceId: string | null;
|
targetServiceId?: string;
|
||||||
owner: string | null;
|
owner?: string;
|
||||||
path: string | null;
|
path?: string;
|
||||||
region: string | null;
|
region?: string;
|
||||||
metadata?: {
|
metadata?: {
|
||||||
secretSuffix?: string;
|
secretSuffix?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ export default function AWSParameterStoreAuthorizeIntegrationPage() {
|
|||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "aws-parameter-store",
|
integration: "aws-parameter-store",
|
||||||
accessId: accessKey,
|
accessId: accessKey,
|
||||||
accessToken: accessSecretKey,
|
accessToken: accessSecretKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setAccessKey("");
|
setAccessKey("");
|
||||||
|
|||||||
@@ -98,11 +98,6 @@ export default function AWSParameterStoreCreateIntegrationPage() {
|
|||||||
integrationAuthId: integrationAuth?._id,
|
integrationAuthId: integrationAuth?._id,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path,
|
path,
|
||||||
region: selectedAWSRegion,
|
region: selectedAWSRegion,
|
||||||
secretPath
|
secretPath
|
||||||
|
|||||||
@@ -37,9 +37,7 @@ export default function AWSSecretManagerCreateIntegrationPage() {
|
|||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "aws-secret-manager",
|
integration: "aws-secret-manager",
|
||||||
accessId: accessKey,
|
accessId: accessKey,
|
||||||
accessToken: accessSecretKey,
|
accessToken: accessSecretKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setAccessKey("");
|
setAccessKey("");
|
||||||
|
|||||||
@@ -98,12 +98,6 @@ export default function AWSSecretManagerCreateIntegrationPage() {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
app: targetSecretName.trim(),
|
app: targetSecretName.trim(),
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: selectedAWSRegion,
|
region: selectedAWSRegion,
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -61,13 +61,6 @@ export default function AzureKeyVaultCreateIntegrationPage() {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
app: vaultBaseUrl,
|
app: vaultBaseUrl,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -91,11 +91,6 @@ export default function BitBucketCreateIntegrationPage() {
|
|||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: targetEnvironment.name,
|
targetEnvironment: targetEnvironment.name,
|
||||||
targetEnvironmentId: targetEnvironment.slug,
|
targetEnvironmentId: targetEnvironment.slug,
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function ChecklyCreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "checkly",
|
integration: "checkly",
|
||||||
accessToken,
|
accessToken
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -72,13 +72,6 @@ export default function ChecklyCreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: targetAppId,
|
appId: targetAppId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath,
|
secretPath,
|
||||||
metadata: {
|
metadata: {
|
||||||
secretSuffix
|
secretSuffix
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function CircleCICreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "circleci",
|
integration: "circleci",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace:null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -68,13 +68,6 @@ export default function CircleCICreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function Cloud66CreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "cloud-66",
|
integration: "cloud-66",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -66,13 +66,6 @@ export default function Cloud66CreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ export default function CloudflarePagesIntegrationPage() {
|
|||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "cloudflare-pages",
|
integration: "cloudflare-pages",
|
||||||
accessId: accountId,
|
accessId: accountId,
|
||||||
accessToken: accessKey,
|
accessToken: accessKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setAccessKey("");
|
setAccessKey("");
|
||||||
|
|||||||
@@ -64,12 +64,6 @@ export default function CloudflarePagesIntegrationPage() {
|
|||||||
appId: targetAppId,
|
appId: targetAppId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment,
|
targetEnvironment,
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath: "/",
|
secretPath: "/",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function CodefreshCreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "codefresh",
|
integration: "codefresh",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -66,13 +66,6 @@ export default function CodefreshCreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function DigitalOceanAppPlatformCreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "digital-ocean-app-platform",
|
integration: "digital-ocean-app-platform",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -66,13 +66,6 @@ export default function DigitalOceanAppPlatformCreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function FlyioCreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "flyio",
|
integration: "flyio",
|
||||||
accessToken,
|
accessToken
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -68,13 +68,6 @@ export default function FlyioCreateIntegrationPage() {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
app: targetApp,
|
app: targetApp,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ export default function GCPSecretManagerAuthorizeIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "gcp-secret-manager",
|
integration: "gcp-secret-manager",
|
||||||
refreshToken: accessToken,
|
refreshToken: accessToken
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -67,13 +67,6 @@ export default function GCPSecretManagerCreateIntegrationPage() {
|
|||||||
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
||||||
appId: targetAppId,
|
appId: targetAppId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -83,7 +76,7 @@ export default function GCPSecretManagerCreateIntegrationPage() {
|
|||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return integrationAuth &&
|
return integrationAuth &&
|
||||||
workspace &&
|
workspace &&
|
||||||
selectedSourceEnvironment &&
|
selectedSourceEnvironment &&
|
||||||
|
|||||||
@@ -63,13 +63,6 @@ export default function GCPSecretManagerCreateIntegrationPage() {
|
|||||||
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
||||||
appId: targetAppId,
|
appId: targetAppId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -72,13 +72,7 @@ export default function GitHubCreateIntegrationPage() {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
app: targetApp.name,
|
app: targetApp.name,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: targetApp.owner,
|
owner: targetApp.owner,
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -98,12 +98,6 @@ export default function GitLabCreateIntegrationPage() {
|
|||||||
appId: String(targetAppId),
|
appId: String(targetAppId),
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: targetEnvironment === "" ? "*" : targetEnvironment,
|
targetEnvironment: targetEnvironment === "" ? "*" : targetEnvironment,
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -66,13 +66,7 @@ export default function HashiCorpVaultCreateIntegrationPage() {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
app: vaultEnginePath,
|
app: vaultEnginePath,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: vaultSecretPath,
|
path: vaultSecretPath,
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -66,13 +66,6 @@ export default function HerokuCreateIntegrationPage() {
|
|||||||
isActive: true,
|
isActive: true,
|
||||||
app: targetApp,
|
app: targetApp,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ export default function LaravelForgeCreateIntegrationPage() {
|
|||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "laravel-forge",
|
integration: "laravel-forge",
|
||||||
accessId: serverId,
|
accessId: serverId,
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -64,15 +64,8 @@ export default function LaravelForgeCreateIntegrationPage() {
|
|||||||
integrationAuthId: integrationAuth?._id,
|
integrationAuthId: integrationAuth?._id,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: String(integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId),
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -76,12 +76,6 @@ export default function NetlifyCreateIntegrationPage() {
|
|||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment,
|
targetEnvironment,
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function NorthflankCreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "northflank",
|
integration: "northflank",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default function NorthflankCreateIntegrationPage() {
|
|||||||
const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState("");
|
const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState("");
|
||||||
const [secretPath, setSecretPath] = useState("/");
|
const [secretPath, setSecretPath] = useState("/");
|
||||||
const [targetAppId, setTargetAppId] = useState("");
|
const [targetAppId, setTargetAppId] = useState("");
|
||||||
const [targetSecretGroupId, setTargetSecretGroupId] = useState<string | null>(null);
|
const [targetSecretGroupId, setTargetSecretGroupId] = useState<string>("");
|
||||||
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
@@ -88,13 +88,7 @@ export default function NorthflankCreateIntegrationPage() {
|
|||||||
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
||||||
appId: targetAppId,
|
appId: targetAppId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: targetSecretGroupId,
|
targetServiceId: targetSecretGroupId,
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -160,7 +154,7 @@ export default function NorthflankCreateIntegrationPage() {
|
|||||||
)}
|
)}
|
||||||
</Select>
|
</Select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
{targetSecretGroupId && integrationAuthSecretGroups && (
|
{targetSecretGroupId !== "" && integrationAuthSecretGroups && (
|
||||||
<FormControl label="Secret Group" className="mt-4">
|
<FormControl label="Secret Group" className="mt-4">
|
||||||
<Select
|
<Select
|
||||||
value={targetSecretGroupId}
|
value={targetSecretGroupId}
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function RailwayAuthorizeIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "railway",
|
integration: "railway",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -108,11 +108,8 @@ export default function RailwayCreateIntegrationPage() {
|
|||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: targetEnvironment.name,
|
targetEnvironment: targetEnvironment.name,
|
||||||
targetEnvironmentId: targetEnvironment.environmentId,
|
targetEnvironmentId: targetEnvironment.environmentId,
|
||||||
targetService: targetService ? targetService.name : null,
|
targetService: targetService?.name,
|
||||||
targetServiceId: targetService ? targetService.serviceId : null,
|
targetServiceId: targetService?.serviceId,
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ export default function RenderCreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "render",
|
integration: "render",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -66,13 +66,6 @@ export default function RenderCreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function SupabaseCreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "supabase",
|
integration: "supabase",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -67,13 +67,6 @@ export default function SupabaseCreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ export default function TeamCityCreateIntegrationPage() {
|
|||||||
integration: "teamcity",
|
integration: "teamcity",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey,
|
||||||
url: serverUrl,
|
url: serverUrl,
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -77,13 +77,8 @@ export default function TeamCityCreateIntegrationPage() {
|
|||||||
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
||||||
appId: targetAppId,
|
appId: targetAppId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: targetEnvironment ? targetEnvironment.name : null,
|
targetEnvironment: targetEnvironment?.name,
|
||||||
targetEnvironmentId: targetEnvironment ? targetEnvironment.buildConfigId : null,
|
targetEnvironmentId: targetEnvironment?.buildConfigId,
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ export default function TerraformCloudCreateIntegrationPage() {
|
|||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "terraform-cloud",
|
integration: "terraform-cloud",
|
||||||
accessId: workspacesId,
|
accessId: workspacesId,
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -78,13 +78,7 @@ export default function TerraformCloudCreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: variableType,
|
targetService: variableType,
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export default function TravisCICreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "travisci",
|
integration: "travisci",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -66,13 +66,6 @@ export default function TravisCICreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export default function VercelCreateIntegrationPage() {
|
|||||||
|
|
||||||
if (!targetApp || !targetApp.appId) return;
|
if (!targetApp || !targetApp.appId) return;
|
||||||
|
|
||||||
const path = targetEnvironment === "preview" && targetBranch !== "" ? targetBranch : null;
|
const path = targetEnvironment === "preview" && targetBranch !== "" ? targetBranch : undefined;
|
||||||
|
|
||||||
await mutateAsync({
|
await mutateAsync({
|
||||||
integrationAuthId: integrationAuth?._id,
|
integrationAuthId: integrationAuth?._id,
|
||||||
@@ -92,12 +92,7 @@ export default function VercelCreateIntegrationPage() {
|
|||||||
appId: targetApp.appId,
|
appId: targetApp.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment,
|
targetEnvironment,
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path,
|
path,
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ export default function WindmillCreateIntegrationPage() {
|
|||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
workspaceId: localStorage.getItem("projectData.id"),
|
workspaceId: localStorage.getItem("projectData.id"),
|
||||||
integration: "windmill",
|
integration: "windmill",
|
||||||
accessToken: apiKey,
|
accessToken: apiKey
|
||||||
url: null,
|
|
||||||
namespace: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -67,13 +67,6 @@ export default function WindmillCreateIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment: null,
|
|
||||||
targetEnvironmentId: null,
|
|
||||||
targetService: null,
|
|
||||||
targetServiceId: null,
|
|
||||||
owner: null,
|
|
||||||
path: null,
|
|
||||||
region: null,
|
|
||||||
secretPath
|
secretPath
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user