Repository navigation
Feat: Add config slack app - #118
Merged
liamburja merged 1 commit intoNov 27, 2026
Conversation
liamburja
merged commit Nov 27, 2026
18c05d5
into
feat/97-alertas-canal-slack-incoming-webhook-block-kit
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the GitOps Slack app's
/gitopscommand, so people can connect Slack channels to their organization's alerts from Slack. Alerts are still created in GitOps.How it works:
commandsscope, so Slack shows no channel picker. The workspace is then linked to that organization, once per workspace./gitops login: GitOps replies with a private link that expires in 10 minutes. The user signs in to GitOps (password or Google) and confirms. Their Slack user is then linked to their GitOps account, once per person./gitops channel: opens a Slack modal asking for a name and a message language. Pick the channel in Slack then opens Slack's own channel picker in the browser; this is the only way Slack issues an Incoming Webhook. GitOps saves the channel in the organization with its webhook, posts a test message, and ends on a "Back to Slack" page./gitops statusand/gitops help.Channels connected this way are normal
slackchannels. They use the same transport, the same encryption and the same failure handling, and alerts select them as usual. Project alerts can use them because they are organization channels.Other changes:
AppCardData, so Google Chat only needs to add its own card and actions.commandsscope, the/gitopsslash command and the interactivity URL;README.md,CLAUDE.md,.env.exampleand.github/copilot-instructions.md.Related issue
Part of #97
Change type
Verification
bun run checkbun run lintbun run test(995 tests)bun run format:check: the files in this PR pass Prettier. The check still fails on files this PR doesn't touch, such asREADME.mdandCLAUDE.md, which already failed before.I also checked the CSRF guard on the production build (
node build):Origingets 403;/api/slack/commandsand/api/slack/interactionspass;/api/slack/commandsxgets 403.Review notes
Environment variables
SLACK_SIGNING_SECRET, the app's Signing Secret./gitopsis enabled only when it is set together withSLACK_CLIENT_IDandSLACK_CLIENT_SECRET. Without it, Add to Slack keeps working as before.commandsscope;/gitopscommand, pointing to<ORIGIN>/api/slack/commands;<ORIGIN>/api/slack/interactions.Data
slack_workspaces: one row per Slack team, linked to one organization. Installing the same workspace from another organization is refused withslack_workspace_taken. The row stores the bot token, encrypted withGITDB_ENCRYPTION_KEY(ChannelCipher, purposeslack-bot-token). The token is only used forviews.open, to open the modal.user.authProvidersas{ provider: 'slack', providerId: '<team>:<user>' }, the same way as the Googlesub.Security
Originheader, which SvelteKit's CSRF check rejects in production (in dev the check is off). The framework check is disabled (csrf.trustedOrigins: ['*']) and the same rule now runs inhooks.server.ts(csrfGuard,#lib/server/csrf). Only/api/slack/commandsand/api/slack/interactionsare exempt (CSRF_EXEMPT_PATHS). Like the framework, the check only runs in production. Please review this part closely.X-Slack-Signaturewith HMAC-SHA256 over the raw body, a constant-time comparison and a 5-minute window, and refuse anything without a valid signature.organization:notifications:createis checked on every command, every form submission and again in the OAuth callback;runWithActor, so GitDB commits carry the linked user;canViewOrganization); a Slack user can only be linked to one GitOps account.team.idandauthed_user.idfrom Slack. A forwarded link fails withslack_wrong_workspace./notifications/slack/callbacknow accepts requests without a session. Only flows started from Slack (kind: 'command') can finish without one. Add to Slack and the app install still require the same session that started them./notifications/slack/linkis remembered in agitops_return_tocookie (10 minutes, httpOnly) so the password and Google logins come back to it. Only that path is allowed (safeReturnPath); every other login still lands on/.Testing locally
cloudflared tunnel --url https://localhost:5173 --no-tls-verify.DEV_HTTPS=trueand__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=.trycloudflare.com.<tunnel>/gitops-settings/slackand put the three Slack variables in.env./gitops login,/gitops channeland/gitops status.Known limitations and follow-up
/gitops channelcreates organization channels only. Project channels from Slack are planned for later. Add to Slack from GitOps already supports projects.esanden./gitopsare onfeat/97-alertas-canal-slack-incoming-webhook-block-kit-app-docin gitops-web.🤖 Generated with Claude Code