-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: Bearer 헤더와 AccessToken 분리 * test: 깨지는 테스트 수정 * refactor: JwtDecoder 메서드 이름 변경 * feat: VO인 AuthorizationHeader 도입 * refactor: jwt 만료기간을 분 단위 기준으로 변경 * test: 잘못된 테스트 수정
- Loading branch information
Showing
13 changed files
with
148 additions
and
44 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
backend/baton/src/main/java/touch/baton/domain/oauth/AuthorizationHeader.java
This file contains 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,27 @@ | ||
package touch.baton.domain.oauth; | ||
|
||
public class AuthorizationHeader { | ||
|
||
private static final String BEARER = "Bearer "; | ||
|
||
private final String value; | ||
|
||
public AuthorizationHeader(final String value) { | ||
validateNotNull(value); | ||
this.value = value; | ||
} | ||
|
||
private void validateNotNull(final String value) { | ||
if (value == null) { | ||
throw new IllegalArgumentException("AuthorizationHeader 의 value 는 null 일 수 없습니다."); | ||
} | ||
} | ||
|
||
public String parseBearerAccessToken() { | ||
return value.substring(BEARER.length()); | ||
} | ||
|
||
public boolean isNotBearerAuth() { | ||
return !value.startsWith(BEARER); | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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 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 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.