Skip to content

[FE] Slack 에러 웹훅을 서버 라우트로 이동 - #406

Merged
sumi-0011 merged 1 commit into
devfrom
fix/slack-error-token-leak
Sep 2, 2026
Merged

sumi-0011 merged 1 commit into
devfrom
fix/slack-error-token-leak

Conversation

@sumi-0011

@sumi-0011 sumi-0011 commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

💻 작업 내용

에러 채널 웹훅 URL 이 브라우저 번들에서 사라집니다. 알림은 /api/slack/error 서버 라우트를 거칩니다. 호출부 6곳은 그대로입니다.

  • 환경변수 NEXT_PUBLIC_SLACK_ERROR_CHANNEL_WEBHOOK_URL → SLACK_ERROR_CHANNEL_WEBHOOK_URL
  • 라우트에서 message 타입·공백·길이(4000자)를 검사합니다. 브라우저가 보내는 값이라 그대로 흘려보내지 않습니다.
  • 웹훅이 죽어도 호출한 화면은 그대로 뜹니다.
  • 가챠 실패 리포트에서 <!here> 를 뺐습니다. /gotchas 가 42% 실패 중이라([BE] /gotchas 전 요청 500 — UN HANDLED EXCEPTION gitanimals#507) 채널 전체 핑이 계속 울려 정작 장애 중에 에러 채널을 뮤트하게 만듭니다. 전역 에러·not-found 는 그대로 둡니다.

accessToken 제거는 #407 에서 이미 처리돼 이 PR에서 뺐습니다.

⚠️ 리뷰 시 봐주실 점

  1. 배포 전에 환경변수를 새 이름으로 등록해야 합니다. 없으면 알림이 조용히 204 로 끝나고 화면은 정상 동작합니다(의도한 동작).
  2. 기존 웹훅 URL 은 폐기하고 새로 발급하는 편이 좋습니다. 그동안 번들에 실려 공개돼 있었습니다.
  3. 라우트에 인증을 걸지 않았습니다. not-found.tsx 가 비로그인 방문자에게도 알림을 보내서, 인증을 걸면 그 경로가 죽습니다. 대신 길이 상한만 뒀습니다 — 이 선택이 맞는지 봐주세요.

검증: type-check, vitest run (26 passed, 라우트 4건 신규), pnpm build:web 통과. 빌드 결과에 /api/slack/error 등록 확인.

🤖 Generated with Claude Code

@sumi-0011
sumi-0011 requested a review from hyesungoh as a code owner September 2, 2026 02:19
@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: a5259cca-b76b-4f48-93ed-49ed11283493

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

웹훅 URL 이 NEXT_PUBLIC_ 이라 브라우저 번들에 실려 있었다. 누구나 그
채널에 쓸 수 있는 상태였다.

- 웹훅 호출을 /api/slack/error 서버 라우트로 이동
- SLACK_ERROR_CHANNEL_WEBHOOK_URL 로 이름 변경 (NEXT_PUBLIC_ 제거)
- 브라우저가 보내는 값이라 라우트에서 타입·공백·길이(4000자) 검사
- 가챠 실패 리포트에서 <!here> 제거. 실패율이 높은 구간에 채널 전체
  핑이 되어 에러 채널을 뮤트하게 만든다. 전역 에러/not-found 는 유지

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEU7s7NYEZXX6dmjBEuUy6
@sumi-0011
sumi-0011 force-pushed the fix/slack-error-token-leak branch from d553b52 to c3cef22 Compare September 2, 2026 07:47
@sumi-0011 sumi-0011 changed the title [FE] Slack 에러 리포팅에서 액세스 토큰·웹훅 URL 노출 제거 [FE] Slack 에러 웹훅을 서버 라우트로 이동 Sep 2, 2026
@sumi-0011
sumi-0011 changed the base branch from issue-505-get-10-pets to dev September 2, 2026 07:47
@sumi-0011 sumi-0011 closed this Sep 2, 2026
@sumi-0011 sumi-0011 reopened this Sep 2, 2026
@sumi-0011
sumi-0011 merged commit 14ff3d6 into dev Sep 2, 2026
5 checks passed
@sumi-0011
sumi-0011 deleted the fix/slack-error-token-leak branch September 2, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant