-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: 쿠키 정책 변경 - 환경에 따른 Domain과 SameSite=Lax #461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: 쿠키 정책 변경 - 환경에 따른 Domain과 SameSite=Lax #461
Conversation
Walkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
src/main/java/com/example/solidconnection/auth/controller/RefreshTokenCookieManager.java (2)
50-50: [2] SameSite=Lax 고정은 목적에 부합합니다. 다만 문자열 직접 지정으로 결합도를 낮춰보세요.
- PR 목표인 SameSite=Lax 고정과 정확히 일치합니다.
- enum의 attributeValue() 대신 문자열 "Lax"를 바로 쓰면 Boot 내부 API 변화에 덜 민감해집니다.
- 테스트와도 쉽게 맞출 수 있습니다.
아래처럼 간단히 치환 가능합니다.
- .sameSite(SameSite.LAX.attributeValue()) + .sameSite("Lax")
13-13: 🚀 SameSite enum 의존성 경량화 제안
확인 결과, Spring Boot 3.x에서도org.springframework.boot.web.server.Cookie.SameSiteenum은 여전히 유효합니다! 그럼에도 문자열 직접 지정으로 결합도를 낮춰 유지보수를 더 편하게 만들어 봅시다.변경사항 안내:
1️⃣ import 제거
-import org.springframework.boot.web.server.Cookie.SameSite;삭제
2️⃣ 문자열로 교체
-ResponseCookie.from(...).sameSite("Lax")사용
3️⃣ 유지보수 안정성 강화
- 향후 메이저 업그레이드 시 패키지/타입 이동 리스크 감소가볍게 검토 후 반영하시면 좋겠습니다! 😄
src/test/java/com/example/solidconnection/auth/controller/RefreshTokenCookieManagerTest.java (2)
22-22: [1] 테스트에서도 Boot enum 의존을 제거하면 업그레이드 내성이 좋아집니다.
- 프로덕션 코드에서 문자열 "Lax"로 전환 시, 테스트도 같은 방식으로 검증하면 일관성이 좋아집니다.
- 외부(enum) 의존을 끊어두면 프레임워크 변경에 따른 불필요한 테스트 수정이 줄어듭니다.
-import org.springframework.boot.web.server.Cookie.SameSite;
64-64: [2] 검증 문자열을 고정해 enum 의존을 없애면 더 단단해집니다.
- 헤더 포맷은 "SameSite=Lax"가 표준적인 표기입니다.
- enum.attributeValue() 대신 문자열을 직접 비교하면 테스트가 더 단순하고 안정적입니다.
- () -> assertThat(header).contains("SameSite=" + SameSite.LAX.attributeValue()) + () -> assertThat(header).contains("SameSite=Lax")Also applies to: 86-86
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
src/main/java/com/example/solidconnection/auth/controller/RefreshTokenCookieManager.java(2 hunks)src/main/java/com/example/solidconnection/auth/controller/config/RefreshTokenCookieProperties.java(0 hunks)src/test/java/com/example/solidconnection/auth/controller/RefreshTokenCookieManagerTest.java(3 hunks)src/test/java/com/example/solidconnection/auth/controller/config/RefreshTokenCookiePropertiesTest.java(0 hunks)
💤 Files with no reviewable changes (2)
- src/main/java/com/example/solidconnection/auth/controller/config/RefreshTokenCookieProperties.java
- src/test/java/com/example/solidconnection/auth/controller/config/RefreshTokenCookiePropertiesTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
관련 이슈
작업 내용
프론트 만옥님의 요청으로 local, dev 환경에서
Domain=.stage.solid-connection.com; SameSite=Lax;가 설정되게 합니다.