Skip to content

feat: 어드민 비밀번호 수정 API 구현#346

Merged
kdkdhoho merged 2 commits intodevfrom
feat/342
Jan 28, 2025
Merged

feat: 어드민 비밀번호 수정 API 구현#346
kdkdhoho merged 2 commits intodevfrom
feat/342

Conversation

@kdkdhoho
Copy link
Collaborator

@kdkdhoho kdkdhoho commented Jan 27, 2025

Description

어드민 계정의 비밀번호를 수정하는 API를 구현했습니다.
수정하려는 새로운 비밀번호에 SHA-256 암호화를 적용했습니다.

Relation Issues

@kdkdhoho kdkdhoho self-assigned this Jan 27, 2025
@kdkdhoho kdkdhoho requested a review from pparkjs as a code owner January 27, 2025 02:53
@kdkdhoho kdkdhoho linked an issue Jan 27, 2025 that may be closed by this pull request
1 task
@kdkdhoho kdkdhoho changed the title feat: 어드민 개인정보 수정 API feat: 어드민 비밀번호 수정 API Jan 27, 2025
@kdkdhoho kdkdhoho changed the title feat: 어드민 비밀번호 수정 API feat: 어드민 비밀번호 수정 API 구현 Jan 27, 2025
Copy link
Collaborator

@pparkjs pparkjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

암호화 구현하느라 정말 고생하셨어요 공부 많이 하셨을 거 같아요!!
제가 코맨트 남겨 드린거 어떨지 고민 한 번 하는게 좋을 거 같고

AES 암호화는 코드로 봤을때 사용은 안하던데 일단 만들어 둔거라고 생각하면 되는거죠!?

Comment on lines +32 to +37

// 암호화 적용으로 인해, 임시로 작성해둔 코드입니다.
// 모든 어드민이 암호를 변경하면 if 조건식만 제거합니다.
if (!password.equals("12345")) {
admin.validatePassword(sha256Cipher.encrypt(password)); // 해당 라인은 제거하지 않습니다.
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@Component
public class Aes256Cipher {

private static final String ALGORITHM = "AES/CBC/PKCS5Padding";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그런데 이런 값을 프로필에 안넣고 노출시켜도 될까요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음 애초에 클래스 이름부터 암호화 알고리즘을 나타내기 때문에, 숨길 필요가 있을까 싶긴 합니다.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 추가로, AES 암호화는 일반 사용자 대상으로 사용할 예정입니다!

}

private SecretKey createSecretKey() throws NoSuchAlgorithmException, InvalidKeySpecException {
SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Collaborator

@pparkjs pparkjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 ㅎㅎ

@kdkdhoho kdkdhoho merged commit dbd1691 into dev Jan 28, 2025
1 check passed
@kdkdhoho kdkdhoho deleted the feat/342 branch January 28, 2025 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

어드민 개인정보 수정 API

2 participants