-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: Token VO 적용, 제공과 저장 관심사 분리, 환경변수 사용하도록 수정 #479
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
Merged
nayonsoso
merged 24 commits into
solid-connection:develop
from
nayonsoso:refactor/adjust-token-vo
Aug 30, 2025
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b61bed8
refactor: Token VO 패키지 이동
nayonsoso 4b3d811
refactor: Token VO의 구성을 단순화
nayonsoso 332be93
test: 변경된 토큰 객체를 테스트 코드에 반영
nayonsoso 3a4cc07
refactor: 토큰 '저장소'와 '제공자' 클래스 분리
nayonsoso 7bf9d9d
refactor: TokenProvider가 jwt 의존하지 않도록 메서드 시그니처 변경
nayonsoso 5a1ee42
test: TokenStorage와 TokenProvider 변경사항 테스트코드에 반영
nayonsoso 1319eae
refactor: SignUpToken VO 생성, Token VO가 공통 인터페이스 구현하도록
nayonsoso 15709d6
refactor: signup 관련 클래스 하나의 패키지로 위치
nayonsoso 0aa559a
refactor: signin 관련 클래스 하나의 패키지로 위치
nayonsoso 25e94f5
refactor: 토큰 관련 변수를 환경 변수로 관리
nayonsoso 57ba58c
refactor: 토큰 생성 시, TokenType을 사용하지 않도록
nayonsoso 5b75f99
refactor: parseSubject함수의 반환 타입이 Subject가 되도록
nayonsoso d348386
refactor: TokenStorage의 함수들이 값 객체를 인자로 갖도록
nayonsoso bad0187
test: 메서드 시그니처 변경 테스트 코드에 반영
nayonsoso a5e05ca
test: 변수 분리로 중복 코드 제거
nayonsoso bb371a4
refactor: TokenValue를 사용하지 않고, TokenProperties를 사용하도록
nayonsoso cef0864
refactor: 로그아웃 시, 액세스 토큰을 새로 만드는 부분 제거
nayonsoso a75f144
chore: 주석 보강
nayonsoso baecd6a
refactor: 회원가입 토큰 검증 시, 서버에 저장된 값과 동일한지 검증 추가
nayonsoso 7a2acdf
refactor: 회원가입 토큰 검증 시, subject 존재 검증 추가
nayonsoso b085289
refactor: subject 추출 시, subject가 없으면 예외 발생하도록
nayonsoso 66f4cb4
refactor: blacklist token 저장 시 TTL 설정되도록
nayonsoso 21542c6
refactor: duration 사용으로 시간 단위 통일
nayonsoso 97d3075
Merge remote-tracking branch 'origin/develop' into refactor/adjust-to…
nayonsoso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/com/example/solidconnection/auth/domain/AccessToken.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.example.solidconnection.auth.domain; | ||
|
|
||
| public record AccessToken( | ||
| String token | ||
| ) implements Token { | ||
|
|
||
| } | ||
7 changes: 7 additions & 0 deletions
7
src/main/java/com/example/solidconnection/auth/domain/RefreshToken.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.example.solidconnection.auth.domain; | ||
|
|
||
| public record RefreshToken( | ||
| String token | ||
| ) implements Token { | ||
|
|
||
| } | ||
nayonsoso marked this conversation as resolved.
Show resolved
Hide resolved
|
||
7 changes: 7 additions & 0 deletions
7
src/main/java/com/example/solidconnection/auth/domain/SignUpToken.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.example.solidconnection.auth.domain; | ||
|
|
||
| public record SignUpToken( | ||
| String token | ||
| ) implements Token { | ||
|
|
||
| } | ||
nayonsoso marked this conversation as resolved.
Show resolved
Hide resolved
|
||
2 changes: 1 addition & 1 deletion
2
...solidconnection/auth/service/Subject.java → .../solidconnection/auth/domain/Subject.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/java/com/example/solidconnection/auth/domain/Token.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package com.example.solidconnection.auth.domain; | ||
|
|
||
| public interface Token { | ||
|
|
||
| String token(); | ||
| } | ||
nayonsoso marked this conversation as resolved.
Show resolved
Hide resolved
|
||
25 changes: 0 additions & 25 deletions
25
src/main/java/com/example/solidconnection/auth/domain/TokenType.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/main/java/com/example/solidconnection/auth/dto/ReissueResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/com/example/solidconnection/auth/dto/SignInResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
src/main/java/com/example/solidconnection/auth/service/AccessToken.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| import static com.example.solidconnection.common.exception.ErrorCode.REFRESH_TOKEN_EXPIRED; | ||
| import static com.example.solidconnection.common.exception.ErrorCode.USER_NOT_FOUND; | ||
|
|
||
| import com.example.solidconnection.auth.domain.AccessToken; | ||
| import com.example.solidconnection.auth.dto.ReissueResponse; | ||
| import com.example.solidconnection.auth.token.TokenBlackListService; | ||
| import com.example.solidconnection.common.exception.CustomException; | ||
|
|
@@ -26,11 +27,9 @@ public class AuthService { | |
| * - 엑세스 토큰을 블랙리스트에 추가한다. | ||
| * - 리프레시 토큰을 삭제한다. | ||
| * */ | ||
| public void signOut(String token) { | ||
| SiteUser siteUser = authTokenProvider.parseSiteUser(token); | ||
| AccessToken accessToken = authTokenProvider.generateAccessToken(siteUser); | ||
| authTokenProvider.deleteRefreshTokenByAccessToken(accessToken); | ||
| public void signOut(String accessToken) { | ||
| tokenBlackListService.addToBlacklist(accessToken); | ||
| authTokenProvider.deleteRefreshTokenByAccessToken(accessToken); | ||
|
Comment on lines
-29
to
+32
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| /* | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
src/main/java/com/example/solidconnection/auth/service/RefreshToken.java
This file was deleted.
Oops, something went wrong.
84 changes: 0 additions & 84 deletions
84
src/main/java/com/example/solidconnection/auth/service/SignUpTokenProvider.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.