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