-
Notifications
You must be signed in to change notification settings - Fork 0
jwt 로그인 구현 #3
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
Merged
jwt 로그인 구현 #3
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1a4c2e8
jwt 테스트코드 작성
jinmyeong-heo eae06f3
jwt 테스트코드 작성
jinmyeong-heo 5efddf5
jwt 로그인 구현
jinmyeong-heo 01075c7
주문 임시저장
jinmyeong-heo ea2ac10
상품주문로직 추가
jinmyeong-heo aec250b
Revert "상품주문로직 추가"
jinmyeong-heo cfc60e0
Revert "주문 임시저장"
jinmyeong-heo 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
5 changes: 3 additions & 2 deletions
5
sample/src/main/java/com/temp/sample/config/auth/AuthUser.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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package com.temp.sample.config.auth; | ||
|
||
import java.util.ArrayList; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class AuthUser { | ||
private final Long userId; | ||
|
||
private final ArrayList<String> roles; | ||
private final List<String> roles; | ||
|
||
} |
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
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
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.
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.
Date 클래스를 쓰는게 약간 아쉽군요. 못쓸정도는 아니지만 epochTime이나 java.time 쪽 패키지를 보통 많이들 사용하긴 합니다
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.
파라미터로 Date를 받아서 별생각없이 사용했는데 멘토님께서 epochTime이랑 java.time패키지를 말씀해주셔서 한번 찾아 보았습니다.
2017년부터 Date 대신 Instant를 사용하자는 요청이 지속적으로 제기되어 왔습니다.
GitHub 이슈 PR : jwtk/jjwt#884
를 확인해 보니 0.12.x 버전까지는 Date 타입이 유지되었고, 1.0.0 버전부터 Date는 Deprecated되고 Instant 기반으로 변경될 계획이라고 합니다.
pr의 현재 문제 상황
JWT RFC 7519 표준에 따르면 NumericDate는 기본적으로 윤초를 무시한 정수로 표현 하지만 JSON에서는 비정수(소수점)을 허용하여 밀리초까지 표현할 수 있습니다.
따라서, Instant 타입을 사용할 경우 초(epoch seconds)와 밀리초(epoch millis)를 어떻게 구분할지 결정해야 합니다. 이 문제로 인해 현재 코드에는 TODO 주석이 남겨져 있으며 pr이 열려 있는 상태입니다.
todo만 빼면 다 끝난 상황인것 같은데, 그 외에도 jwtParser 문제점 개선과 맞물려 있어서 java8에 대한 지원은 빨리 적용될것 같진 않아 보입니다.