-
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
Feature/#17 signup encrypt #18
base: feature/#15-encrypt
Are you sure you want to change the base?
Conversation
*/ | ||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@ToString |
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.
해당 어노테이션에 대한 설명이 없습니다. ToString 을 추가하신 이유가 무엇인가요~?
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.
제가 제거하고 올렸어야했는데 제거하겠습니다.
public static BuyerResponse of(Buyer buyer) { | ||
return new BuyerResponse(buyer.getBuyerId(), buyer.getEmail(), buyer.getName(), buyer.getPhoneNumber(), | ||
buyer.getBuyerStatus()); | ||
public static BuyerResponse of(Buyer buyer, final String email, final String phoneNumber) { |
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.
email 과 phonNumber 도 결국 buyer 의 정보아닌가요? 따로 받는 이유가 있으신가요?
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.
응답으로 반환할 때는 복호화를 해서 반환하고 싶었습니다.
@@ -27,10 +33,14 @@ public class BuyerService implements LoginHandler { | |||
*/ | |||
@Transactional | |||
public BuyerResponse signUp(final BuyerRequest buyerRequest, final LocalDateTime createdAt) { | |||
final Buyer buyer = Buyer.create(buyerRequest.email(), buyerRequest.password(), buyerRequest.name(), | |||
final String encryptEmail = symmetricCryptoService.encrypt(buyerRequest.email()); |
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.
encryptEmail 은 명사로 변수이름으로는 부적합합니다.
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.
넵 수정하겠습니다 !!
.orElseThrow(() -> new IllegalArgumentException("해당 이메일로 가입된 회원이 없습니다.")); | ||
findBuyer.validatePassword(user.password()); | ||
return LoginResponse.of(findBuyer); | ||
final String encryptPassword = encryptPassword(user.password(), findBuyer.getSalt()); |
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.
email 과 일관성있게 encrypted
가 더 적합해보입니다.
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.
네 변경하도록 하겠습니다
@@ -0,0 +1,8 @@ | |||
package shop.sendbox.sendbox.buyer; | |||
|
|||
public interface SymmetricCryptoService { |
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.
HashingEncrypt 와 다르게 interface 로 분리한 이유는 무엇인가요 ?
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.
처음에 암호화 라이브러리를 직접 의존하지 않으려고 했습니다.
만들고 올리고 나니 라이브러리 내부 동작이 어떻게 되는지에 따라 결과가 달라지기 때문에
결합도를 낮춘다고 하더라도 자유로운 변경이 어렵다는 걸 알게 되었습니다.
…nto feature/#17-signup-encrypt
#️⃣연관된 이슈
📝작업 내용
✒️ 코드 변경 이유
💬리뷰 요구사항(선택)
객체지향 체조 3가지 확인📌