Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Update Railway integration get services query, make services optional
Tuan Dangca59488b6283
diff --git a/backend/src/services/integration-auth/integration-auth-service.ts b/backend/src/services/integration-auth/integration-auth-service.tsindex 0b3f9b4c3f..ee4528dce3 100644--- a/backend/src/services/integration-auth/integration-auth-service.ts+++ b/backend/src/services/integration-auth/integration-auth-service.ts@@ -649,33 +649,21 @@ export const integrationAuthServiceFactory = ({ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Integrations);const botKey = await projectBotService.getBotKey(integrationAuth.projectId);const { accessToken } = await getIntegrationAccessToken(integrationAuth, botKey);- if (appId) {++ if (appId && appId !== "") {const query = `- query project($id: String!) {- project(id: $id) {- createdAt- deletedAt- id- description- expiredAt- isPublic- isTempProject- isUpdatable- name- prDeploys- teamId- updatedAt- upstreamUrl- services {- edges {- node {- id- name- }- }- }+ query project($id: String!) {+ project(id: $id) {+ services {+ edges {+ node {+ id+ name+ }+ }+ }+ }}- }`;const variables = {@@ -711,6 +699,7 @@ export const integrationAuthServiceFactory = ({);return edges.map(({ node: { name, id: serviceId } }) => ({ name, serviceId }));}+return [];};diff --git a/backend/src/services/integration-auth/integration-sync-secret.ts b/backend/src/services/integration-auth/integration-sync-secret.tsindex 62a4dcfa71..71c7ce6868 100644--- a/backend/src/services/integration-auth/integration-sync-secret.ts+++ b/backend/src/services/integration-auth/integration-sync-secret.ts@@ -1204,21 +1204,21 @@ const syncSecretsRailway = async ({}`;- const input = {- projectId: integration.appId,- environmentId: integration.targetEnvironmentId,- ...(integration.targetServiceId ? { serviceId: integration.targetServiceId } : {}),- replace: true,- variables: getSecretKeyValuePair(secrets)+ const variables = {+ input: {+ projectId: integration.appId,+ environmentId: integration.targetEnvironmentId,+ ...(integration.targetServiceId ? { serviceId: integration.targetServiceId } : {}),+ replace: true,+ variables: getSecretKeyValuePair(secrets)+ }};await request.post(IntegrationUrls.RAILWAY_API_URL,{query,- variables: {- input- }+ variables},{headers: {diff --git a/frontend/src/pages/integrations/railway/create.tsx b/frontend/src/pages/integrations/railway/create.tsxindex 2f715be4b6..26845cb72d 100644--- a/frontend/src/pages/integrations/railway/create.tsx+++ b/frontend/src/pages/integrations/railway/create.tsx@@ -74,16 +74,6 @@ export default function RailwayCreateIntegrationPage() {}}, [targetEnvironments]);- useEffect(() => {- if (targetServices) {- if (targetServices.length > 0) {- setTargetServiceId(targetServices[0].serviceId);- } else {- setTargetServiceId("none");- }- }- }, [targetServices]);-const handleButtonClick = async () => {try {setIsLoading(true);@@ -124,11 +114,14 @@ export default function RailwayCreateIntegrationPage() {}};+ const filteredTargetServices = targetServices ? [ { name: "", serviceId: "none" }, ...targetServices ] : [ { name: "", serviceId: "none" } ];+return workspace &&selectedSourceEnvironment &&integrationAuthApps &&targetEnvironments &&- targetServices ? (+ targetServices &&+ filteredTargetServices ? (<div className="flex h-full w-full items-center justify-center"><Card className="max-w-md rounded-md p-8"><CardTitle className="text-center">Railway Integration</CardTitle>@@ -208,20 +201,14 @@ export default function RailwayCreateIntegrationPage() {className="w-full border border-mineshaft-500"isDisabled={targetServices.length === 0}>- {targetServices.length > 0 ? (- targetServices.map((targetService) => (+ {filteredTargetServices.map((targetService) => (<SelectItemvalue={targetService.serviceId as string}key={`target-service-${targetService.serviceId as string}`}>{targetService.name}</SelectItem>- ))- ) : (- <SelectItem value="none" key="target-service-none">- No services found- </SelectItem>- )}+ ))}</Select></FormControl><Button