Skip to content

refactor: local 환경 JWT 필터 추가 및 유저 조회 쿼리 JPQL 변경#297

Merged
YEJIRYOO merged 2 commits into
mainfrom
refactor/294-local-dev-config
May 17, 2026
Merged

refactor: local 환경 JWT 필터 추가 및 유저 조회 쿼리 JPQL 변경#297
YEJIRYOO merged 2 commits into
mainfrom
refactor/294-local-dev-config

Conversation

@jinuklee777

@jinuklee777 jinuklee777 commented May 16, 2026

Copy link
Copy Markdown
Contributor

🔎 Resolved Issue

  • ♻️ [REFACTOR] 로컬 설정 리팩토링 #294
  • 로컬 환경에서 UserRepository의 native query가 User 대문자 테이블명을 직접 참조해 발생하던 문제 해결
  • local profile의 SecurityConfig에 JWT 관련 필터를 추가했습니다.

✅ Title

  • refactor: local 환경 JWT 필터 복구 및 유저 조회 쿼리 JPQL 변경

📄 Content

  • UserRepository.findByUsernameWithDeleted의 native query를 JPQL로 변경했습니다.
  • local profile의 SecurityConfig에 JWT 관련 필터를 추가했습니다.

Summary by CodeRabbit

  • Refactor
    • 데이터베이스 쿼리 처리 방식 최적화
    • 보안 필터 체인 개선으로 인증 및 예외 처리 강화

Review Change Stack

@jinuklee777 jinuklee777 requested a review from YEJIRYOO May 16, 2026 16:14
@jinuklee777 jinuklee777 added the ♻️ refactor Refactor legacy code label May 16, 2026
@jinuklee777 jinuklee777 linked an issue May 16, 2026 that may be closed by this pull request
2 tasks
@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0b281173-26f5-4638-8cf1-d15bd6740301

📥 Commits

Reviewing files that changed from the base of the PR and between bf2c7f9 and 756e582.

📒 Files selected for processing (2)
  • src/main/java/com/soongsil/CoffeeChat/domain/user/repository/UserRepository.java
  • src/main/java/com/soongsil/CoffeeChat/global/security/SecurityConfig.java

변경 사항 요약

User 저장소의 데이터 접근 쿼리를 네이티브 SQL에서 JPQL로 마이그레이션하고, 로컬 개발 보안 설정에서 JWT 인증 및 예외 처리 필터를 필터 체인에 적용합니다.

변경 사항

데이터 접근 및 보안 구성

레이어 / 파일(들) 요약
User 저장소 JPQL 쿼리 변환
src/main/java/com/soongsil/CoffeeChat/domain/user/repository/UserRepository.java
findByUsernameWithDeleted 메서드의 @Query가 네이티브 SQL(select * from User ...)에서 JPQL(select u from User u ...)로 변경되었으며 nativeQuery=true 설정이 제거되었습니다.
로컬 보안 프로필 JWT 필터 체인 구성
src/main/java/com/soongsil/CoffeeChat/global/security/SecurityConfig.java
로컬 프로필의 보안 필터 체인에 authExceptionHandlingFilterJwtAuthenticationFilter 앞에, JwtAuthenticationFilterUsernamePasswordAuthenticationFilter 앞에 배치하여 JWT 인증 처리 순서를 명시합니다.

예상 코드 리뷰 난이도

🎯 2 (Simple) | ⏱️ ~10 minutes

시인 토끼의 한 마디

🐰 쿼리는 JPQL로 다시 태어나고,
필터는 순서대로 줄을 서니,
로컬에서도 인증의 문이 열리는군!
작지만 정교한 변화로다~ ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request 제목이 변경사항의 주요 내용을 정확하게 반영하고 있습니다. JWT 필터 추가와 유저 조회 쿼리 JPQL 변경이라는 두 가지 주요 변경사항을 명확하게 요약하고 있습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/294-local-dev-config

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@YEJIRYOO YEJIRYOO merged commit bab41a5 into main May 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ refactor Refactor legacy code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

♻️ [REFACTOR] 로컬 설정 리팩토링

2 participants