Skip to content

[Artist] Spotify AccessToken 자동 재발급 로직 추가#291

Merged
Creamcheesepie merged 3 commits into
mainfrom
feat/#290
Jan 7, 2026
Merged

[Artist] Spotify AccessToken 자동 재발급 로직 추가#291
Creamcheesepie merged 3 commits into
mainfrom
feat/#290

Conversation

@ys0221

@ys0221 ys0221 commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

🔗 관련 이슈

관련된 이슈 번호를 연결해주세요.
Close #이슈번호 를 쓰면 PR merge 시 자동으로 close 됩니다.

🚀 PR 개요

이 PR이 어떤 변경을 포함하고 있는지 간단히 설명해주세요.

Spotify AccessToken은 약 1시간의 유효 시간을 가지며, 만료 시 모든 Spotify API 호출에서 401 Unauthorized 오류가 발생합니다.
이를 해결하기 위해 AccessToken을 중앙에서 관리하도록 개선하고, 토큰 만료 또는 401 응답 발생 시 자동으로 토큰을 재발급한 뒤 Spotify API 요청을 1회 재시도하는 로직을 추가했습니다.

📌 변경 사항

주요 변경 내용을 체크리스트 형태로 정리해주세요.

  • 기능 추가
  • 버그 수정
  • 리팩터링
  • 문서 업데이트
  • 테스트 추가/수정

🧪 테스트 방법

변경된 내용을 어떻게 테스트했는지 구체적으로 적어주세요.

테스트 코드를 직접 작성하여 테스트하였습니다.

📸 스크린샷 (선택)

UI 변경 또는 시각적으로 확인할 수 있는 변경이 있다면 첨부해주세요.

⚠️ 참고 사항

리뷰어가 알아야 할 사항이 있다면 자유롭게 작성해주세요.

@ys0221 ys0221 self-assigned this Jan 6, 2026
@ys0221 ys0221 added the Feature label Jan 6, 2026
@github-actions

github-actions Bot commented Jan 6, 2026

Copy link
Copy Markdown

Test Results

44 tests  +11   44 ✅ +11   5s ⏱️ -1s
 8 suites + 2    0 💤 ± 0 
 8 files   + 2    0 ❌ ± 0 

Results for commit 6909477. ± Comparison against base commit 0cbe505.

@github-actions

github-actions Bot commented Jan 6, 2026

Copy link
Copy Markdown

⭐ JaCoCo Coverage

Line Coverage: 7.11%

📄 Coverage Details

Overall Line Coverage: 7.11% (514 covered / 7231 lines)

Package Summary (lowest first)
Package Line % Covered Missed
com/back/web7_9_codecrete_be/domain/plans/controller 0.00% 0 63
com/back/web7_9_codecrete_be/domain/chats/entity 0.00% 0 4
com/back/web7_9_codecrete_be/domain/serverTime/entity 0.00% 0 9
com/back/web7_9_codecrete_be/domain/auth/entity 0.00% 0 0
com/back/web7_9_codecrete_be/domain/auth/service 0.00% 0 150
com/back/web7_9_codecrete_be/domain/auth/controller 0.00% 0 24
com/back/web7_9_codecrete_be/domain/community/comment/controller 0.00% 0 7
com/back/web7_9_codecrete_be/domain/community/comment/entity 0.00% 0 12
com/back/web7_9_codecrete_be/domain/serverTime/controller 0.00% 0 3
com/back/web7_9_codecrete_be/domain/location/controller 0.00% 0 73
com/back/web7_9_codecrete_be/domain/location/entity 0.00% 0 15
com/back/web7_9_codecrete_be/global/scheduler 0.00% 0 11
com/back/web7_9_codecrete_be/global/initData 0.00% 0 59
com/back/web7_9_codecrete_be/domain/email/entity 0.00% 0 6
com/back/web7_9_codecrete_be/domain/community/comment/service 0.00% 0 17
com/back/web7_9_codecrete_be/domain/artists/controller 0.00% 0 37
com/back/web7_9_codecrete_be/domain/artists/service 0.00% 0 107
com/back/web7_9_codecrete_be/domain/community/post/controller 0.00% 0 59
com/back/web7_9_codecrete_be/domain/plans/service 0.20% 1 492
com/back/web7_9_codecrete_be/domain/artists/service/artistEnrichService 0.29% 4 1376
com/back/web7_9_codecrete_be/domain/community/post/service 0.39% 1 253
com/back/web7_9_codecrete_be/global/wikidata 0.76% 5 652
com/back/web7_9_codecrete_be/global/musicbrainz 0.99% 5 501
com/back/web7_9_codecrete_be/global/maniadb 1.22% 1 81
com/back/web7_9_codecrete_be/domain/email/service 1.61% 1 61
com/back/web7_9_codecrete_be/domain/chats/service 1.68% 2 117
com/back/web7_9_codecrete_be/global/flo 1.85% 1 53
com/back/web7_9_codecrete_be/domain/concerts/controller 2.27% 1 43
com/back/web7_9_codecrete_be/domain/concerts/repository 3.45% 1 28
com/back/web7_9_codecrete_be/global/storage 3.57% 2 54
com/back/web7_9_codecrete_be/global/websocket 4.65% 4 82
com/back/web7_9_codecrete_be/domain/artists/service/spotifyService 6.18% 66 1002
com/back/web7_9_codecrete_be/domain/serverTime/service 6.25% 3 45
com/back/web7_9_codecrete_be/domain/artists/entity 7.89% 6 70
com/back/web7_9_codecrete_be/global/redis 8.33% 2 22
com/back/web7_9_codecrete_be/global/rq 9.80% 5 46
com/back/web7_9_codecrete_be/domain/chats/controller 10.00% 2 18
com/back/web7_9_codecrete_be/domain/concerts/service 13.89% 81 502
com/back/web7_9_codecrete_be/domain/community/post/entity 14.13% 13 79
com/back/web7_9_codecrete_be/domain/users/util 14.29% 1 6
com/back/web7_9_codecrete_be/domain/plans/entity 18.10% 21 95
com/back/web7_9_codecrete_be/domain/location/service 29.50% 59 141
com/back/web7_9_codecrete_be/domain/users/service 31.53% 35 76
com/back/web7_9_codecrete_be/global/security 37.38% 40 67
com/back/web7_9_codecrete_be/domain/concerts/entity 37.63% 35 58
com/back/web7_9_codecrete_be/domain/users/controller 51.61% 16 15
com/back/web7_9_codecrete_be/domain/users/entity 64.81% 35 19
com/back/web7_9_codecrete_be/global/rsData 81.82% 9 2
com/back/web7_9_codecrete_be/global/spotify 87.50% 35 5
com/back/web7_9_codecrete_be/global/doc 100.00% 17 0
com/back/web7_9_codecrete_be/global/aspect 100.00% 4 0
Lowest Covered Classes (Top 20)
Class Line % Covered Missed
com.back.web7_9_codecrete_be.domain.artists.service.artistEnrichService.EnrichStepExecutor 0.00% 0 183
com.back.web7_9_codecrete_be.domain.artists.service.ArtistService 0.00% 0 99
com.back.web7_9_codecrete_be.domain.auth.service.AuthService 0.00% 0 88
com.back.web7_9_codecrete_be.domain.plans.controller.PlanController 0.00% 0 63
com.back.web7_9_codecrete_be.domain.location.controller.KakaoApiController 0.00% 0 60
com.back.web7_9_codecrete_be.global.initData.BaseInitData 0.00% 0 59
com.back.web7_9_codecrete_be.domain.plans.entity.Schedule 0.00% 0 54
com.back.web7_9_codecrete_be.domain.community.post.service.MyCommunityService 0.00% 0 47
com.back.web7_9_codecrete_be.domain.location.service.PlanCostTimeService 0.00% 0 43
com.back.web7_9_codecrete_be.domain.community.post.service.JoinPostService 0.00% 0 41
com.back.web7_9_codecrete_be.domain.artists.entity.Artist 0.00% 0 40
com.back.web7_9_codecrete_be.domain.community.post.service.PostService 0.00% 0 39
com.back.web7_9_codecrete_be.domain.chats.service.ChatPolicyService 0.00% 0 38
com.back.web7_9_codecrete_be.global.security.JwtTokenProvider 0.00% 0 37
com.back.web7_9_codecrete_be.domain.location.service.LocationService 0.00% 0 30
com.back.web7_9_codecrete_be.domain.plans.entity.Plan 0.00% 0 30
com.back.web7_9_codecrete_be.domain.artists.controller.ArtistsController 0.00% 0 30
com.back.web7_9_codecrete_be.domain.auth.service.TokenService 0.00% 0 26
com.back.web7_9_codecrete_be.domain.auth.controller.AuthController 0.00% 0 24
com.back.web7_9_codecrete_be.domain.community.post.entity.Post 0.00% 0 24
Changed Classes (from this PR)
Source (PR) Class Prefix Line % Covered Missed
src/main/java/com/back/web7_9_codecrete_be/domain/artists/service/spotifyService/SpotifyRateLimitHandler.java com.back.web7_9_codecrete_be.domain.artists.service.spotifyService.SpotifyRateLimitHandler 48.74% 58 61
src/main/java/com/back/web7_9_codecrete_be/global/spotify/SpotifyClient.java com.back.web7_9_codecrete_be.global.spotify.SpotifyClient 85.71% 30 5

🔗 Full HTML report: See artifact jacoco-full-html on this run → https://github.com/prgrms-web-devcourse-final-project/WEB7_9_codecrete_BE/actions/runs/20734680429

@Creamcheesepie Creamcheesepie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

토큰 재발급까지.. 수고하셨습니다!

@tobbot16 tobbot16 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@larama-C larama-C left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

@heygeeji heygeeji left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

@Creamcheesepie Creamcheesepie merged commit ee3aeeb into main Jan 7, 2026
2 checks passed
@Creamcheesepie Creamcheesepie deleted the feat/#290 branch January 7, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Artist] Spotify AccessToken 재발급

5 participants