misc: addressed comments
@@ -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=
|
||||
|
||||
@@ -147,8 +147,8 @@ const envSchema = z
|
||||
PLAIN_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,
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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.orgId
|
||||
|
||||
@@ -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>
|
||||
|
Before Width: | Height: | Size: 688 KiB After Width: | Height: | Size: 688 KiB |
|
Before Width: | Height: | Size: 516 KiB After Width: | Height: | Size: 516 KiB |
|
Before Width: | Height: | Size: 439 KiB After Width: | Height: | Size: 439 KiB |
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 341 KiB |
|
Before Width: | Height: | Size: 687 KiB After Width: | Height: | Size: 687 KiB |
|
Before Width: | Height: | Size: 531 KiB After Width: | Height: | Size: 531 KiB |
|
Before Width: | Height: | Size: 377 KiB After Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 209 KiB |
|
Before Width: | Height: | Size: 520 KiB After Width: | Height: | Size: 520 KiB |
|
Before Width: | Height: | Size: 348 KiB After Width: | Height: | Size: 348 KiB |
|
Before Width: | Height: | Size: 509 KiB After Width: | Height: | Size: 509 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 552 KiB After Width: | Height: | Size: 552 KiB |
|
Before Width: | Height: | Size: 498 KiB After Width: | Height: | Size: 498 KiB |
|
Before Width: | Height: | Size: 528 KiB After Width: | Height: | Size: 528 KiB |
@@ -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"]
|
||||
|
||||
@@ -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>
|
||||
@@ -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()
|
||||
});
|
||||
|
||||
|
||||
@@ -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: {
|
||||
|
||||