-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: 미션 인증 유효성 검사 추가 #30
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f43517e
feat: 내가 참여중인 미션 조회 API 구현
songyi00 ef86f0e
refactor: dto 패키지 정리
songyi00 8d9dae1
fix: 미션 인증 시 요일 검증 추가
kimyu0218 16d11e0
feat: 장기말 타입 추가
kimyu0218 449ce1e
feat: 구글을 위한 자체 토큰 생성 추가
kimyu0218 35c1572
remove: identity token 필드 제거
kimyu0218 5b5b730
refactor: identity token 자체 생성
kimyu0218 05c3888
fix: 충돌 해결
kimyu0218 0ebfad6
fix: 충돌 해결
kimyu0218 6299ef2
feat: 에러 코드 추가
kimyu0218 4525237
rename: command -> query
kimyu0218 1b536de
refactor: 서비스 로직 단순화
kimyu0218 e7a1871
refactor: 인터페이스 및 구현체 분리
kimyu0218 14c1687
refactor: 서비스 로직 단순화
kimyu0218 712cad2
remove: 불필요한 코드 제거
kimyu0218 0d1b5ef
rename: bean 이름 변경
kimyu0218 c073ab6
remove: 불필요한 dto 제거
kimyu0218 f75280c
fix: 서비스 및 레포지토리 에러 픽스
kimyu0218 7c653de
feat: BadRequest 400 던지도록 변경
kimyu0218 5c79b2a
fix: java.time.DayOfWeek 호환 문제 해결
kimyu0218 5c2631b
test: 미션 인증 테스트 작성
kimyu0218 231dd75
test: 중복 인증 테스트케이스 추가
kimyu0218 d21be66
refactor: DayOfWeek 검증 방식 변경
kimyu0218 a4ba8a4
docs: swagger 수정
kimyu0218 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 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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/nexters/goalpanzi/application/auth/google/GoogleIdentityToken.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,28 @@ | ||
package com.nexters.goalpanzi.application.auth.google; | ||
|
||
import com.nexters.goalpanzi.domain.member.SocialType; | ||
import com.nexters.goalpanzi.exception.BaseException; | ||
import com.nexters.goalpanzi.exception.ErrorCode; | ||
|
||
import java.nio.charset.StandardCharsets; | ||
import java.security.MessageDigest; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.util.Base64; | ||
|
||
public class GoogleIdentityToken { | ||
|
||
private static String SHA_256 = "SHA-256"; | ||
|
||
public static String generate(final String email) { | ||
return generateHash(email + "__" + SocialType.GOOGLE); | ||
} | ||
|
||
private static String generateHash(final String input) { | ||
try { | ||
return Base64.getUrlEncoder().withoutPadding().encodeToString( | ||
MessageDigest.getInstance(SHA_256).digest(input.getBytes(StandardCharsets.UTF_8))); | ||
} catch (NoSuchAlgorithmException e) { | ||
throw new BaseException(ErrorCode.FAILED_TO_GENERATE_HASH); | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...request/MyMissionVerificationCommand.java → ...o/request/MyMissionVerificationQuery.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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/nexters/goalpanzi/application/ncp/ObjectStorageClient.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,12 @@ | ||
package com.nexters.goalpanzi.application.ncp; | ||
|
||
import org.springframework.stereotype.Repository; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
@Repository | ||
public interface ObjectStorageClient { | ||
|
||
String uploadFile(final MultipartFile file); | ||
|
||
void deleteFile(final String uploadedFileUrl); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,5 @@ public enum DayOfWeek { | |
THURSDAY, | ||
FRIDAY, | ||
SATURDAY, | ||
SUNDAY | ||
; | ||
SUNDAY; | ||
} |
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.
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 가 nullable인 것 같아서!
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.
아! 이 부분
null
허용해줬어date
안 보내면 그냥 오늘 기준으로 인증 정보 조회하도록 만들었는데 그냥 무조건 보내도록 만들까?? (딱히 이유가 있는 건 아니야!! 기본값 느낌으로..)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.
응응 기본값 오늘 기준으로 인증해줘도 괜찮을 것 같아!
쿼리 dto에 스웨거 스키마 필수값 여부만 추가해줘 ㅎㅎ