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
misc: addressed comments
Sheen Capadngand23a7e41f3d4
diff --git a/.env.example b/.env.exampleindex e8f85c0803..6489a1cc2a 100644--- a/.env.example+++ b/.env.example@@ -73,5 +73,5 @@ PLAIN_WISH_LABEL_IDS=SSL_CLIENT_CERTIFICATE_HEADER_KEY=-SLACK_CLIENT_ID=-SLACK_CLIENT_SECRET=+WORKFLOW_SLACK_CLIENT_ID=+WORKFLOW_SLACK_CLIENT_SECRET=diff --git a/backend/src/lib/config/env.ts b/backend/src/lib/config/env.tsindex 3edfb10f18..73a2464334 100644--- a/backend/src/lib/config/env.ts+++ b/backend/src/lib/config/env.ts@@ -147,8 +147,8 @@ const envSchema = zPLAIN_WISH_LABEL_IDS: zpStr(z.string().optional()),DISABLE_AUDIT_LOG_GENERATION: zodStrBool.default("false"),SSL_CLIENT_CERTIFICATE_HEADER_KEY: zpStr(z.string().optional()).default("x-ssl-client-cert"),- SLACK_CLIENT_ID: zpStr(z.string()).optional(),- SLACK_CLIENT_SECRET: zpStr(z.string()).optional()+ WORKFLOW_SLACK_CLIENT_ID: zpStr(z.string()).optional(),+ WORKFLOW_SLACK_CLIENT_SECRET: zpStr(z.string()).optional()}).transform((data) => ({...data,diff --git a/backend/src/server/routes/v1/slack-router.ts b/backend/src/server/routes/v1/slack-router.tsindex 99e878bf8c..0601e2d1f1 100644--- a/backend/src/server/routes/v1/slack-router.ts+++ b/backend/src/server/routes/v1/slack-router.ts@@ -1,3 +1,4 @@+import slugify from "@sindresorhus/slugify";import { z } from "zod";import { SlackIntegrationsSchema, WorkflowIntegrationsSchema } from "@app/db/schemas";@@ -34,7 +35,12 @@ export const registerSlackRouter = async (server: FastifyZodProvider) => {}],querystring: z.object({- slug: z.string(),+ slug: z+ .string()+ .trim()+ .refine((v) => slugify(v) === v, {+ message: "Slug must be a valid slug"+ }),description: z.string().optional()}),response: {@@ -282,7 +288,13 @@ export const registerSlackRouter = async (server: FastifyZodProvider) => {id: z.string()}),body: z.object({- slug: z.string().optional(),+ slug: z+ .string()+ .trim()+ .refine((v) => slugify(v) === v, {+ message: "Slug must be a valid slug"+ })+ .optional(),description: z.string().optional()}),response: {diff --git a/backend/src/services/slack/slack-service.ts b/backend/src/services/slack/slack-service.tsindex 8a0a1a7d3a..d4a3ebe4d5 100644--- a/backend/src/services/slack/slack-service.ts+++ b/backend/src/services/slack/slack-service.ts@@ -138,8 +138,8 @@ export const slackServiceFactory = ({const appCfg = getConfig();const serverCfg = await getServerCfg();- let slackClientId = appCfg.SLACK_CLIENT_ID as string;- let slackClientSecret = appCfg.SLACK_CLIENT_SECRET as string;+ let slackClientId = appCfg.WORKFLOW_SLACK_CLIENT_ID as string;+ let slackClientSecret = appCfg.WORKFLOW_SLACK_CLIENT_SECRET as string;const decrypt = await kmsService.decryptWithRootKey();@@ -244,7 +244,7 @@ export const slackServiceFactory = ({const installer = await getSlackInstaller();const url = await installer.generateInstallUrl({- scopes: ["chat:write.public", "chat:write", "channels:read", "groups:read", "im:read", "mpim:read"],+ scopes: ["chat:write.public", "chat:write", "channels:read", "groups:read"],metadata: JSON.stringify({slug,description,@@ -278,7 +278,7 @@ export const slackServiceFactory = ({const installer = await getSlackInstaller();const url = await installer.generateInstallUrl({- scopes: ["chat:write.public", "chat:write", "channels:read", "groups:read", "im:read", "mpim:read"],+ scopes: ["chat:write.public", "chat:write", "channels:read", "groups:read"],metadata: JSON.stringify({id,orgId: slackIntegration.orgIddiff --git a/docs/documentation/platform/workflow-integrations/slack-integration.mdx b/docs/documentation/platform/workflow-integrations/slack-integration.mdxnew file mode 100644index 0000000000..2941cb2ada--- /dev/null+++ b/docs/documentation/platform/workflow-integrations/slack-integration.mdx@@ -0,0 +1,88 @@+---+title: "Slack integration"+description: "Learn how to setup Slack integration"+---++This guide will provide step by step instructions on how to configure Slack integration for your Infisical projects.++<Tabs>+ <Tab title="Self-hosted setup">+ ## Configure admin settings+ Note that this step only has to be done once for the entire instance.++ <Steps>+ <Step title="Navigate to the Integrations tab in the Admin settings">+ Before anything else, you need to setup the Slack app to be used by+ your Infisical instance. Because you're self-hosting, you will need to+ create this Slack application as demonstrated in the preceding step.+ + </Step>+ <Step title="Create Slack app">+ Click the "Create Slack app" button. This will open up a new window with the+ custom app creation flow on Slack.+ ++ Select the Slack workspace you want to integrate with Infisical.++ ++ The configuration values of your custom Slack app will be pre-filled for you. You can view or edit the app manifest by clicking **Edit Configurations**.+ ++ Once everything's confirmed, press Create.++ </Step>+ <Step title="Input app credentials from Slack">+ Copy the Client ID and Client Secret values from your newly created custom Slack app and add them to Infisical.+ + + Complete the admin setup by pressing Save.+ </Step>++ </Steps>++## Create Slack workflow integration++ <Steps>+ <Step title="Navigate to the Workflow Integrations tab in your organization settings">+ In order to use Slack integration in your projects, you will first have to+ configure a Slack workflow integration in your organization.+ + </Step>+ <Step title="Install Slack app to workspace">+ Press "Add" and select "Slack" as the platform.+ ++ Give your Slack integration a descriptive alias. You will use this to select the Slack integration for your project.+ ++ Press **Connect Slack**. This opens up the Slack app installation flow. Select the Slack workspace you want to install the custom Slack app to and press **Allow**.+ ++ Your Slack bot will then be added to your selected Slack workspace. This completes the workflow integration creation flow. Your projects in the organization can now use this Slack integration to send real-time updates to your Slack workspace.+ + ++ </Step>++ </Steps>++## Configure project to use Slack workflow integration++<Steps>+ <Step title="Navigate to the Workflow Integrations tab in the project settings">+ + </Step>+ <Step title="Select the Slack integration to use for the project">+ Your project will send notifications to the connected Slack workspace of the+ selected Slack integration when the configured events are triggered.+ + </Step>+ <Step title="Configure the Slack notification settings for the project and click Save.">+ + You now have a working native integration with Slack!+ </Step>+</Steps>++ </Tab>+</Tabs>diff --git a/docs/images/self-hosting/guides/slack-integration/admin-slack-integration-app-credential-form.png b/docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-app-credential-form.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/admin-slack-integration-app-credential-form.pngrename to docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-app-credential-form.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/admin-slack-integration-app-credentials.png b/docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-app-credentials.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/admin-slack-integration-app-credentials.pngrename to docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-app-credentials.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/admin-slack-integration-app-summary.png b/docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-app-summary.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/admin-slack-integration-app-summary.pngrename to docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-app-summary.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/admin-slack-integration-app-workspace-select.png b/docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-app-workspace-select.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/admin-slack-integration-app-workspace-select.pngrename to docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-app-workspace-select.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/admin-slack-integration-create-app.png b/docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-create-app.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/admin-slack-integration-create-app.pngrename to docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-create-app.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/admin-slack-integration-overview.png b/docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-overview.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/admin-slack-integration-overview.pngrename to docs/images/platform/workflow-integrations/slack-integration/admin-slack-integration-overview.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/org-slack-integration-add-form.png b/docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-add-form.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/org-slack-integration-add-form.pngrename to docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-add-form.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/org-slack-integration-authenticate.png b/docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-authenticate.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/org-slack-integration-authenticate.pngrename to docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-authenticate.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/org-slack-integration-created.png b/docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-created.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/org-slack-integration-created.pngrename to docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-created.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/org-slack-integration-initial-add.png b/docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-initial-add.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/org-slack-integration-initial-add.pngrename to docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-initial-add.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/org-slack-integration-overview.png b/docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-overview.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/org-slack-integration-overview.pngrename to docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-overview.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/org-slack-integration-workspace.png b/docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-workspace.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/org-slack-integration-workspace.pngrename to docs/images/platform/workflow-integrations/slack-integration/org-slack-integration-workspace.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/project-slack-integration-config.png b/docs/images/platform/workflow-integrations/slack-integration/project-slack-integration-config.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/project-slack-integration-config.pngrename to docs/images/platform/workflow-integrations/slack-integration/project-slack-integration-config.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/project-slack-integration-overview.png b/docs/images/platform/workflow-integrations/slack-integration/project-slack-integration-overview.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/project-slack-integration-overview.pngrename to docs/images/platform/workflow-integrations/slack-integration/project-slack-integration-overview.pngdiff --git a/docs/images/self-hosting/guides/slack-integration/project-slack-integration-select.png b/docs/images/platform/workflow-integrations/slack-integration/project-slack-integration-select.pngsimilarity index 100%rename from docs/images/self-hosting/guides/slack-integration/project-slack-integration-select.pngrename to docs/images/platform/workflow-integrations/slack-integration/project-slack-integration-select.pngdiff --git a/docs/mint.json b/docs/mint.jsonindex e391a58d15..ad299adb6b 100644--- a/docs/mint.json+++ b/docs/mint.json@@ -169,6 +169,12 @@"documentation/platform/kms/aws-hsm"]},+ {+ "group": "Workflow Integrations",+ "pages": [+ "documentation/platform/workflow-integrations/slack-integration"+ ]+ },"documentation/platform/secret-sharing"]},@@ -250,10 +256,6 @@"self-hosting/guides/custom-certificates"]},- {- "group": "Workflow Integrations",- "pages": ["self-hosting/guides/slack-integration"]- },{"group": "Reference architectures","pages": ["self-hosting/reference-architectures/aws-ecs"]diff --git a/docs/self-hosting/guides/slack-integration.mdx b/docs/self-hosting/guides/slack-integration.mdxdeleted file mode 100644index 791a591ada..0000000000--- a/docs/self-hosting/guides/slack-integration.mdx+++ /dev/null@@ -1,82 +0,0 @@-----title: "Slack integration"-description: "Learn how to setup Slack integration in your self-hosted instance."------This guide will provide step by step instructions on how to configure Slack integration for your Infisical projects.--## Configure admin settings--Note that this step only has to be done once for the entire instance.--<Steps>- <Step title="Navigate to the Integrations tab in the Admin settings">- Before anything else, you need to setup the Slack app to be used by- your Infisical instance. Because you're self-hosting, you will need to- create this Slack application as demonstrated in the preceding step.- - </Step>- <Step title="Create Slack app">- Click the "Create Slack app" button. This will open up a new window with the- custom app creation flow on Slack.- -- Select the Slack workspace you want to integrate with Infisical.-- -- The configuration values of your custom Slack app will be pre-filled for you. You can view or edit the app manifest by clicking **Edit Configurations**.- -- Once everything's confirmed, press Create.-- </Step>- <Step title="Input app credentials from Slack">- Copy the Client ID and Client Secret values from your newly created custom Slack app and add them to Infisical.- - - Complete the admin setup by pressing Save.- </Step>-</Steps>--## Create Slack workflow integration--<Steps>- <Step title="Navigate to the Workflow Integrations tab in your organization settings">- In order to use Slack integration in your projects, you will first have to- configure a Slack workflow integration in your organization.- - </Step>- <Step title="Install Slack app to workspace">- Press "Add" and select "Slack" as the platform.- -- Give your Slack integration a descriptive alias. You will use this to select the Slack integration for your project.- -- Press **Connect Slack**. This opens up the Slack app installation flow. Select the Slack workspace you want to install the custom Slack app to and press **Allow**.- -- Your Slack bot will then be added to your selected Slack workspace. This completes the workflow integration creation flow. Your projects in the organization can now use this Slack integration to send real-time updates to your Slack workspace.- - -- </Step>-</Steps>--## Configure project to use Slack workflow integration--<Steps>- <Step title="Navigate to the Workflow Integrations tab in the project settings">- - </Step>- <Step title="Select the Slack integration to use for the project">- Your project will send notifications to the connected Slack workspace of the- selected Slack integration when the configured events are triggered.- - </Step>- <Step title="Configure the Slack notification settings for the project and click Save.">- - You now have a working native integration with Slack!- </Step>-</Steps>diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsxindex 87a49647eb..281061db4a 100644--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx@@ -2,6 +2,7 @@ import { useEffect } from "react";import { Controller, useForm } from "react-hook-form";import { useRouter } from "next/router";import { zodResolver } from "@hookform/resolvers/zod";+import slugify from "@sindresorhus/slugify";import axios from "axios";import { z } from "zod";@@ -21,7 +22,13 @@ type Props = {};const slackFormSchema = z.object({- slug: z.string(),+ slug: z+ .string()+ .trim()+ .min(1)+ .refine((v) => slugify(v) === v, {+ message: "Alias must be a valid slug"+ }),description: z.string().optional()});diff --git a/frontend/src/views/admin/DashboardPage/IntegrationPanel.tsx b/frontend/src/views/admin/DashboardPage/IntegrationPanel.tsxindex 33c4a76398..b07dde77eb 100644--- a/frontend/src/views/admin/DashboardPage/IntegrationPanel.tsx+++ b/frontend/src/views/admin/DashboardPage/IntegrationPanel.tsx@@ -42,7 +42,7 @@ const getCustomSlackAppCreationUrl = () =>oauth_config: {redirect_urls: [`${window.origin}/api/v1/workflow-integrations/slack/oauth_redirect`],scopes: {- bot: ["chat:write.public", "chat:write"]+ bot: ["chat:write.public", "chat:write", "channels:read", "groups:read"]}},settings: {