Skip to content

fix: 관리자 API 권한 체크 활성화 및 Redis 리프레시 토큰 TTL 단위 수정#250

Merged
dongmin0204 merged 1 commit into
developfrom
fix/c1-c2-security-auth
Jul 6, 2026
Merged

fix: 관리자 API 권한 체크 활성화 및 Redis 리프레시 토큰 TTL 단위 수정#250
dongmin0204 merged 1 commit into
developfrom
fix/c1-c2-security-auth

Conversation

@yoon6yo

@yoon6yo yoon6yo commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

변경 사항

[C-1] SecurityConfig.java — 관리자 API 권한 체크 활성화

주석 처리되어 있던 /api/admin/** 경로의 ADMIN 롤 체크를 활성화합니다.
일반 USER 토큰으로 관리자 API 호출이 가능했던 보안 취약점을 제거합니다.

// Before
// .requestMatchers("/api/admin/**").hasRole("ADMIN")

// After
.requestMatchers("/api/admin/**").hasRole("ADMIN")

[C-2] TokenService.java — Redis TTL 단위 수정

application.ymlrefresh-token-expire-time: 604800000 값은 밀리초(7일) 기준입니다.
TimeUnit.SECONDS로 처리하면 약 19.2년이 되는 버그를 TimeUnit.MILLISECONDS로 수정합니다.

// Before (604,800,000초 ≈ 19.2년)
redisTemplate.opsForValue().set(redisKey, token, REFRESH_TOKEN_EXPIRE_TIME, TimeUnit.SECONDS);

// After (604,800,000밀리초 = 7일)
redisTemplate.opsForValue().set(redisKey, token, REFRESH_TOKEN_EXPIRE_TIME, TimeUnit.MILLISECONDS);

테스트

  • 기존 테스트 전체 통과 확인 (./gradlew test)

🤖 Generated with Claude Code

- [C-1] SecurityConfig에서 주석 처리된 /api/admin/** ADMIN 롤 체크 활성화
- [C-2] TokenService Redis TTL TimeUnit.SECONDS → TimeUnit.MILLISECONDS로 수정
  (604800000ms = 7일이 604800000초 ≈ 19년으로 설정되던 버그)

Closes #243, #244

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 79892b0e-de1a-491e-927d-9748215ef94b

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/c1-c2-security-auth

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.

@dongmin0204 dongmin0204 merged commit ae9c1a0 into develop Jul 6, 2026
1 check 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.

[C-2] Redis 리프레시 토큰 TTL 약 19년 버그 [C-1] 관리자 API 권한 체크 누락

2 participants