-
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
๐ :: (#444) ํ์๊ฐ์ ๋น๋ฐ๋ฒํธ ๋์ฝ๋ฉ #445
The head ref may contain hidden characters: "feature/444-\uD68C\uC6D0\uAC00\uC785-\uBE44\uBE4C\uBC88\uD638-\uB514\uCF54\uB529"
๐ :: (#444) ํ์๊ฐ์ ๋น๋ฐ๋ฒํธ ๋์ฝ๋ฉ #445
Conversation
Walkthrough
Changes
Possibly related PRs
Suggested labels
Suggested reviewers
๐ Recent review detailsConfiguration used: CodeRabbit UI ๐ Files selected for processing (1)
๐ง Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? ๐ชง TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
๐ Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
๐ Files selected for processing (2)
feature/signup/src/main/java/team/retum/signup/viewmodel/SetPasswordViewModel.kt
(2 hunks)feature/signup/src/main/java/team/retum/signup/viewmodel/TermsViewModel.kt
(2 hunks)
๐ Additional comments (3)
feature/signup/src/main/java/team/retum/signup/viewmodel/SetPasswordViewModel.kt (1)
7-7
: Base64 ์ธ์ฝ๋ฉ ๊ด๋ จ import ์ถ๊ฐ ํ์ธ
์ ์ ํ import ๋ฌธ์ด ์ถ๊ฐ๋์์ต๋๋ค.
feature/signup/src/main/java/team/retum/signup/viewmodel/TermsViewModel.kt (2)
14-14
: Base64 ๋์ฝ๋ฉ์ ์ํ import ์ถ๊ฐ๊ฐ ์ ์ ํฉ๋๋ค.
Base64 ๋์ฝ๋ฉ ๊ตฌํ์ ์ํด ํ์ํ import๋ฌธ์ด ์ฌ๋ฐ๋ฅด๊ฒ ์ถ๊ฐ๋์์ต๋๋ค.
43-43
: ๋น๋ฐ๋ฒํธ ๋์ฝ๋ฉ ๋ฐฉ์ ๋ณ๊ฒฝ์ด ์ ์ ํฉ๋๋ค.
ํน์๋ฌธ์ ์ฒ๋ฆฌ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด URL ๋์ฝ๋ฉ์์ Base64 ๋์ฝ๋ฉ์ผ๋ก ๋ณ๊ฒฝํ ๊ฒ์ด ์ ์ ํฉ๋๋ค. ๋ค๋ง ๋ค์ ์ฌํญ๋ค์ ๊ณ ๋ คํด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค:
- ์ด ๋ณ๊ฒฝ์ฌํญ์ ๋ํ ์ฃผ์ ์ถ๊ฐ๋ฅผ ๊ถ์ฅ๋๋ฆฝ๋๋ค.
- ํด๋ผ์ด์ธํธ ์ธก์ ์ธ์ฝ๋ฉ๋ Base64๋ก ์ผ๊ด๋๊ฒ ๋ณ๊ฒฝ๋์๋์ง ํ์ธ์ด ํ์ํฉ๋๋ค.
๋ค์๊ณผ ๊ฐ์ด ์ฃผ์์ ์ถ๊ฐํ๋ ๊ฒ์ ์ ์๋๋ฆฝ๋๋ค:
+ // ํน์๋ฌธ์ ์ฒ๋ฆฌ๋ฅผ ์ํด URL ๋์ฝ๋ฉ ๋์ Base64 ๋์ฝ๋ฉ ์ฌ์ฉ
val decodedPassword = String(Base64.getDecoder().decode(password))
ํด๋ผ์ด์ธํธ ์ธก ์ธ์ฝ๋ฉ ๋ฐฉ์ ํ์ธ์ ์ํด ๋ค์ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํฉ๋๋ค:
โ Verification successful
Let me check the encoding implementation in SetPasswordViewModel.kt to verify the consistency.
๋น๋ฐ๋ฒํธ ์ธ์ฝ๋ฉ/๋์ฝ๋ฉ ๊ตฌํ์ด ์ผ๊ด๋๊ฒ ์ ์ฉ๋์์ต๋๋ค.
ํด๋ผ์ด์ธํธ์ ์๋ฒ ๊ฐ์ ๋น๋ฐ๋ฒํธ ์ฒ๋ฆฌ๊ฐ Base64๋ก ์ ํํ๊ฒ ์ผ์นํฉ๋๋ค:
- SetPasswordViewModel์์ Base64.getEncoder()๋ก ์ธ์ฝ๋ฉ
- TermsViewModel์์ Base64.getDecoder()๋ก ๋์ฝ๋ฉ
๐ Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: ๋น๋ฐ๋ฒํธ ์ธ์ฝ๋ฉ ๊ด๋ จ ์ฝ๋ ํ์ธ
# ๋น๋ฐ๋ฒํธ ์ธ์ฝ๋ฉ ๊ด๋ จ ์ฝ๋ ๊ฒ์
rg -t kotlin "password.*encode"
Length of output: 210
Script:
#!/bin/bash
# Check the implementation of password encoding in SetPasswordViewModel
rg -A 5 -B 5 "encodedPassword" feature/signup/src/main/java/team/retum/signup/viewmodel/SetPasswordViewModel.kt
Length of output: 492
val encodedPassword = Base64.getEncoder().encodeToString(state.value.password.toByteArray()) | ||
postSideEffect(SetPasswordSideEffect.MoveToNext(password = encodedPassword.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.
๐ก Codebase verification
Base64 ์ธ์ฝ๋ฉ/๋์ฝ๋ฉ ๊ตฌํ์ ๋ณด์ ๋ฐ ์์ ์ฑ ๊ฐ์ ํ์
Base64 ์ธ์ฝ๋ฉ/๋์ฝ๋ฉ ๊ตฌํ์ ๊ฒํ ํ ๊ฒฐ๊ณผ, ๋ค์๊ณผ ๊ฐ์ ๊ฐ์ ์ด ํ์ํฉ๋๋ค:
SetPasswordViewModel.kt
์์:- ๋ฌธ์ ์ธ์ฝ๋ฉ(UTF-8) ๋ช ์ ํ์
- ์์ธ ์ฒ๋ฆฌ ๋ก์ง ์ถ๊ฐ ํ์
TermsViewModel.kt
์์:- Base64 ๋์ฝ๋ฉ ์ ์์ธ ์ฒ๋ฆฌ ๋๋ฝ
- ๋ฌธ์ ์ธ์ฝ๋ฉ ๋ช ์ ํ์
์ ์ํ๋ ๊ฐ์ ์ฌํญ:
// SetPasswordViewModel.kt
try {
val encodedPassword = Base64.getEncoder().encodeToString(
state.value.password.toByteArray(Charsets.UTF_8)
)
postSideEffect(SetPasswordSideEffect.MoveToNext(password = encodedPassword))
} catch (e: Exception) {
setState { state.value.copy(buttonEnabled = true) }
// ์๋ฌ ์ฒ๋ฆฌ ๋ก์ง ์ถ๊ฐ
}
// TermsViewModel.kt
try {
val decodedPassword = String(
Base64.getDecoder().decode(password),
Charsets.UTF_8
)
// ํ์ ์ฒ๋ฆฌ
} catch (e: IllegalArgumentException) {
// ๋์ฝ๋ฉ ์คํจ ์ฒ๋ฆฌ
}
๐ Analysis chain
Base64 ์ธ์ฝ๋ฉ ๊ตฌํ ๊ด๋ จ ๋ณด์ ๊ฒํ ํ์
Base64 ์ธ์ฝ๋ฉ์ผ๋ก์ ๋ณ๊ฒฝ์ ํน์ ๋ฌธ์ ์ฒ๋ฆฌ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ง๋ง, ๋ช ๊ฐ์ง ๊ณ ๋ ค์ฌํญ์ด ์์ต๋๋ค:
- Base64 ์ธ์ฝ๋ฉ์ ๊ฐ์ญ์ ์ด๋ฏ๋ก ๋ฏผ๊ฐํ ๋ฐ์ดํฐ ์ ์ก ์ ๋ฐ๋์ ์ถ๊ฐ์ ์ธ ๋ณด์ ๊ณ์ธต(์: HTTPS)์ด ํ์ํฉ๋๋ค.
- ์ธ์ฝ๋ฉ ๊ณผ์ ์์ ๋ฐ์ํ ์ ์๋ ์์ธ ์ฒ๋ฆฌ๊ฐ ๋๋ฝ๋์ด ์์ต๋๋ค.
- ๋ฌธ์์ด ์ธ์ฝ๋ฉ(Charset) ์ฒ๋ฆฌ๊ฐ ๋ช ์์ ์ด์ง ์์ต๋๋ค.
๋ค์๊ณผ ๊ฐ์ ๊ฐ์ ์ ์ ์๋๋ฆฝ๋๋ค:
- val encodedPassword = Base64.getEncoder().encodeToString(state.value.password.toByteArray())
- postSideEffect(SetPasswordSideEffect.MoveToNext(password = encodedPassword.toString()))
+ try {
+ val encodedPassword = Base64.getEncoder().encodeToString(
+ state.value.password.toByteArray(Charsets.UTF_8)
+ )
+ postSideEffect(SetPasswordSideEffect.MoveToNext(password = encodedPassword))
+ } catch (e: Exception) {
+ // ์๋ฌ ์ฒ๋ฆฌ ๋ก์ง ์ถ๊ฐ
+ setState { state.value.copy(buttonEnabled = true) }
+ }
Base64 ๋์ฝ๋ฉ์ด ์ฌ๋ฐ๋ฅด๊ฒ ๊ตฌํ๋์ด ์๋์ง ํ์ธ์ด ํ์ํฉ๋๋ค:
Let's check the implementation of Base64 decoding in the found file.
๐ Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Base64 ๋์ฝ๋ฉ ๊ตฌํ ํ์ธ
rg -l "Base64.*decode" --type kotlin
Length of output: 113
Script:
#!/bin/bash
# Check Base64 decoding implementation in TermsViewModel.kt
rg "Base64.*decode" -A 5 -B 5 feature/signup/src/main/java/team/retum/signup/viewmodel/TermsViewModel.kt
Length of output: 521
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.
Actionable comments posted: 1
๐ Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
๐ Files selected for processing (2)
feature/signup/src/main/java/team/retum/signup/viewmodel/SetPasswordViewModel.kt
(2 hunks)feature/signup/src/main/java/team/retum/signup/viewmodel/TermsViewModel.kt
(2 hunks)
๐ง Files skipped from review as they are similar to previous changes (1)
- feature/signup/src/main/java/team/retum/signup/viewmodel/TermsViewModel.kt
๐ Additional comments (2)
feature/signup/src/main/java/team/retum/signup/viewmodel/SetPasswordViewModel.kt (2)
7-7
: Base64 ์ธ์ฝ๋ฉ์ ์ํ import ์ถ๊ฐ๊ฐ ์ ์ ํ ์ด๋ฃจ์ด์ก์ต๋๋ค.
Line range hint 1-89
: ๋ณด์ ๊ด๋ จ ์ถ๊ฐ ๊ณ ๋ ค์ฌํญ
Base64 ์ธ์ฝ๋ฉ์ ์ํธํ๊ฐ ์๋ ์ธ์ฝ๋ฉ ๋ฐฉ์์ด๋ฏ๋ก, ๋ค์ ์ฌํญ๋ค์ ๊ณ ๋ คํด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค:
- ๋คํธ์ํฌ ์ ์ก ์ ๋ฐ๋์ HTTPS๋ฅผ ์ฌ์ฉํ์ฌ ์ถ๊ฐ์ ์ธ ๋ณด์ ๊ณ์ธต์ ํ๋ณดํด์ผ ํฉ๋๋ค.
- ์๋ฒ ์ธก์์๋ ์ ์ ํ ๋น๋ฐ๋ฒํธ ํด์ฑ์ด ์ด๋ฃจ์ด์ง๋์ง ํ์ธ์ด ํ์ํฉ๋๋ค.
์๋ฒ ์ธก ๊ตฌํ์ ํ์ธํ๊ธฐ ์ํด ๋ค์ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํฉ๋๋ค:
val encodedPassword = Base64.getEncoder().encodeToString(state.value.password.toByteArray(Charsets.UTF_8)) | ||
postSideEffect(SetPasswordSideEffect.MoveToNext(password = encodedPassword.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.
Base64 ์ธ์ฝ๋ฉ ๊ตฌํ์ ๊ฐ์ ์ด ํ์ํฉ๋๋ค.
encodedPassword.toString()
์ ๋ถํ์ํฉ๋๋ค.encodeToString()
์ด ์ด๋ฏธ ๋ฌธ์์ด์ ๋ฐํํ๊ธฐ ๋๋ฌธ์ ๋๋ค.- Base64 ์ธ์ฝ๋ฉ ๊ณผ์ ์์ ๋ฐ์ํ ์ ์๋ ์์ธ ์ฒ๋ฆฌ๊ฐ ๋๋ฝ๋์ด ์์ต๋๋ค.
๋ค์๊ณผ ๊ฐ์ด ์์ ํ๋ ๊ฒ์ ์ ์๋๋ฆฝ๋๋ค:
- val encodedPassword = Base64.getEncoder().encodeToString(state.value.password.toByteArray(Charsets.UTF_8))
- postSideEffect(SetPasswordSideEffect.MoveToNext(password = encodedPassword.toString()))
+ try {
+ val encodedPassword = Base64.getEncoder().encodeToString(
+ state.value.password.toByteArray(Charsets.UTF_8)
+ )
+ postSideEffect(SetPasswordSideEffect.MoveToNext(password = encodedPassword))
+ } catch (e: Exception) {
+ setState { state.value.copy(buttonEnabled = true) }
+ // TODO: ์๋ฌ ์ฒ๋ฆฌ ๋ก์ง ์ถ๊ฐ (์: ์ฌ์ฉ์์๊ฒ ์๋ฆผ)
+ }
Committable suggestion skipped: line range outside the PR's diff.
๊ฐ์
ํ์๊ฐ์ ๋น๋ฐ๋ฒํธ ์ ๋ ฅ์์ #(ํน์๋ฌธ์)์ด ์ ๋ ฅ๋๋ฉด JsonDecode์์ ์ค๋ฅ ๋ฐ์ํจ
์์ธ: navigation์ ํตํด ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌํ ๋ URL ๋์ฝ๋ฉ์ด ์๋์ผ๋ก ๋ฐ์ํจ
ํด๊ฒฐ: URL๋์ฝ๋ฉ์ ๋ฐฉ์์ Base64 ๋ฐฉ์์ผ๋ก ๋ณ๊ฒฝํจ
์์ ๋ด์ฉ
ํ ๋ง
Summary by CodeRabbit