fix: 승인 이메일에 base64 비밀번호 대신 평문 발송 - #340
Conversation
클라이언트가 base64 인코딩된 비밀번호를 전송하는데, toEntity()에서 ubuntuPassword(이메일 발송용)와 ubuntuPasswordBase64(SSH 인증용)에 동일한 base64 값을 넣어 이메일에 알아볼 수 없는 문자열이 발송되는 버그 수정. toEntity() 내에서 base64 디코딩해 ubuntuPassword에 평문 저장. Closes #334
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
이 PR은 클라이언트가 ubuntuPassword에 Base64 인코딩된 값을 보내는 상황에서, 승인 이메일에 Base64 문자열이 그대로 노출되던 문제(#334)를 해결하기 위해 요청 저장 시 Base64를 디코딩한 평문을 별도 컬럼(ubuntuPassword)에 저장하도록 변경합니다.
Changes:
SaveRequestRequestDTO.toEntity()에서 Base64 비밀번호를 UTF-8로 디코딩해ubuntuPassword(이메일 발송용)로 저장- 원본 Base64 문자열은
ubuntuPasswordBase64에 그대로 저장 - Base64/charset 관련 표준 라이브러리 import 추가
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // 클라이언트는 base64 인코딩된 값을 전송 — 평문은 디코딩해서 이메일 발송용으로 따로 보관 | ||
| String plainPassword = new String(Base64.getDecoder().decode(ubuntuPasswordBase64), StandardCharsets.UTF_8); | ||
|
|
| import java.util.Base64; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Set; |
| } | ||
|
|
||
| // 클라이언트는 base64 인코딩된 값을 전송 — 평문은 디코딩해서 이메일 발송용으로 따로 보관 | ||
| String plainPassword = new String(Base64.getDecoder().decode(ubuntuPasswordBase64), StandardCharsets.UTF_8); |
Summary
ubuntuPassword필드로 전송ubuntuPassword컬럼(이메일용)에 base64 문자열이 그대로 저장됨 → 승인 이메일에c3Ryb25n...형태로 발송toEntity()내에서 base64 디코딩 후ubuntuPassword에 평문,ubuntuPasswordBase64에 base64 저장Test plan
Closes #334