Skip to content

[Fix] STOMP 연결 인증 규칙 보강 - #357

Merged
Gimini-3 merged 5 commits into
developfrom
fix/356
Sep 27, 2026
Merged

Gimini-3 merged 5 commits into
developfrom
fix/356

Conversation

@Gimini-3

Copy link
Copy Markdown
Contributor

🔍️ 작업 내용

  • Closes [Fix] STOMP 연결 인증 규칙 보강 #356
  • STOMP 1.2의 CONNECT와 STOMP 명령을 모두 같은 연결 인증 경계로 처리합니다.
  • 로그아웃으로 blacklist에 등록된 JWT와 jti가 없는 JWT의 신규 WebSocket 연결을 거부합니다.
  • Redis에서 폐기 여부를 확인할 수 없을 때 신규 WebSocket 연결을 fail-closed로 처리합니다.
  • Redis 읽기 timeout과 별도로 접속 timeout을 1초 기본값으로 추가합니다.

✨ 상세 설명

기존 interceptor는 원본 명령을 StompCommand.CONNECT와 직접 비교했습니다. 같은 연결 의미를 갖는
STOMP 명령은 인증 분기에 들어가지 않아 token 없이 익명 session을 만들 수 있었습니다. 또한
WebSocket 인증은 JWT 서명과 만료만 확인해, HTTP 로그아웃으로 Redis blacklist에 등록된 token도
만료 전까지 새 session을 만들 수 있었습니다.

연결 판정을 Spring의 의미 단위인 SimpMessageType.CONNECT로 변경하고, JWT 검증 뒤 jti와
TokenBlacklistService를 확인한 다음에만 현재 권한을 조회해 Principal을 등록하도록 순서를
고정했습니다. 정상 경로와 거부 경로는 SockJS native WebSocket endpoint에 raw STOMP frame을 보내는
통합 테스트로 검증했습니다.

설계와 실행 결과는 다음 문서에 기록했습니다.

  • docs/design/gimin-#356-stomp-connect-authentication.md
  • docs/test-results/gimin-#356-stomp-connect-authentication-test.md

✅ 검증

  • 인증·HTTP·dashboard WebSocket 주요 회귀 테스트 20건 통과
  • Backend 전체 테스트 1,172건 통과
  • ./backend/gradlew -p backend build 통과

🛠️ 추후 리팩토링 및 고도화 계획

연결 시점 인증만 보강했습니다. 로그아웃·token 만료 후 이미 열린 session의 강제 종료와 dashboard
destination의 pattern·wildcard subscription 권한 규칙은 별도 범위입니다.

📸 스크린샷 (선택)

해당 없음

💬 리뷰 요구사항

  • HTTP는 기존 Redis fail-open을 유지하고, REST polling 대체 경로가 있는 WebSocket 신규 연결만
    fail-closed로 둔 장애 정책이 적절한지 확인 부탁드립니다.
  • 두 wire-level 명령을 SimpMessageType.CONNECT 하나로 판정하는 경계와 raw WebSocket 검증 범위를
    확인 부탁드립니다.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: DocGrid/docgrid/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: ebd5b145-61cd-4dee-88cb-5555b8723c68


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.

@Gimini-3
Gimini-3 merged commit 14fbcf4 into develop Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] STOMP 연결 인증 규칙 보강

1 participant