chore: 네트워크 디버깅을 위한 Chucker 라이브러리 연동#286
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughChucker 디버깅 라이브러리를 프로젝트에 추가하고 DI 모듈에서 ChuckerInterceptor를 제공해 OkHttpClient 빌드 파이프라인에 삽입했습니다. 또한 Gradle 버전 관리 파일과 모듈 빌드스크립트에 debug/release 의존성을 선언하고 앱 버전 정보를 올렸습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant App as 클라이언트
participant Retrofit as Retrofit
participant OkHttp as OkHttpClient
participant Chucker as ChuckerInterceptor
participant Server as 외부서버
App->>Retrofit: API 호출
Retrofit->>OkHttp: 요청 전달
OkHttp->>Chucker: 요청/응답 가로채기
Chucker-->>OkHttp: 검사용 데이터 로깅/표시
OkHttp->>Server: 네트워크 요청 전송
Server-->>OkHttp: 응답 반환
OkHttp->>Retrofit: 응답 전달
Retrofit-->>App: 결과 반환
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 개요Chucker 네트워크 디버깅 라이브러리를 프로젝트에 추가하고 OkHttpClient에 통합합니다. 디버그 빌드에서는 전체 기능을 사용하고 릴리스 빌드에서는 no-op 버전을 사용하도록 구성했습니다. 변경 사항
토끼의 한마디
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@core/network/src/main/kotlin/com/ninecraft/booket/core/network/di/NetworkGraph.kt`:
- Around line 89-109: provideChuckerInterceptor 및 OkHttp 클라이언트 설정에서
ChuckerInterceptor를 기본 생성자로 사용해 민감 헤더가 수집되고 있으니, provideChuckerInterceptor에서
ChuckerInterceptor(context) 대신 ChuckerInterceptor.Builder(context)로 생성하고
addHeaderToMask("Authorization"), addHeaderToMask("Cookie"),
addHeaderToMask("Set-Cookie") 등을 호출해 인증 관련 헤더를 마스킹하도록 변경한 뒤 provideOkHttpClient의
인자로 넘기도록 수정하세요; 대상 식별자는 provideChuckerInterceptor, provideOkHttpClient,
ChuckerInterceptor(context)/ChuckerInterceptor.Builder를 참고하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 91b29e4c-74a3-4433-96f7-b8e530baca2f
📒 Files selected for processing (3)
core/network/build.gradle.ktscore/network/src/main/kotlin/com/ninecraft/booket/core/network/di/NetworkGraph.ktgradle/libs.versions.toml
| @Provides | ||
| fun provideChuckerInterceptor( | ||
| @ApplicationContext context: Context, | ||
| ): ChuckerInterceptor { | ||
| return ChuckerInterceptor(context) | ||
| } | ||
|
|
||
| @Provides | ||
| fun provideOkHttpClient( | ||
| httpLoggingInterceptor: HttpLoggingInterceptor, | ||
| tokenInterceptor: TokenInterceptor, | ||
| tokenAuthenticator: TokenAuthenticator, | ||
| chuckerInterceptor: ChuckerInterceptor, | ||
| ): OkHttpClient { | ||
| return OkHttpClient.Builder() | ||
| .connectTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | ||
| .readTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | ||
| .writeTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | ||
| .addInterceptor(tokenInterceptor) | ||
| .authenticator(tokenAuthenticator) | ||
| .addInterceptor(chuckerInterceptor) |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Chucker 4.3.1 ChuckerInterceptor Builder redactHeaders Authorization Cookie Set-Cookie Android OkHttp
💡 Result:
In Chucker, header redaction is configured on ChuckerInterceptor.Builder via redactHeaders(vararg String)—so to hide auth/cookie values you can do:
val chucker = ChuckerInterceptor.Builder(context)
.redactHeaders("Authorization", "Cookie", "Set-Cookie")
.build()
val okHttp = OkHttpClient.Builder()
.addInterceptor(chucker)
.build()Chucker will replace the values of those headers with ** in the Chucker UI/logged transactions. [1]
Also, I couldn’t find a Chucker 4.3.1 artifact published to common indexes; the latest listed in early 2026 appears to be 4.3.0. [2]
Sources: [1] [2]
🏁 Script executed:
# Find build configuration files to identify Chucker version
find . -type f \( -name "*.gradle" -o -name "*.gradle.kts" -o -name "*.toml" \) | head -20Repository: YAPP-Github/Reed-Android
Length of output: 696
🏁 Script executed:
# Search for Chucker dependency declaration
rg "chucker|Chucker" -t gradle -t kotlin | head -30Repository: YAPP-Github/Reed-Android
Length of output: 959
🏁 Script executed:
# Read the actual NetworkGraph.kt file
cat -n core/network/src/main/kotlin/com/ninecraft/booket/core/network/di/NetworkGraph.kt | sed -n '80,120p'Repository: YAPP-Github/Reed-Android
Length of output: 1676
🏁 Script executed:
# Find version catalog/libs definition
find . -type f -name "*.versions.toml" -o -name "libs.gradle.kts"Repository: YAPP-Github/Reed-Android
Length of output: 95
🏁 Script executed:
# Search for Chucker version definition in gradle files
rg "chucker.*=" -A 2 -B 2 --type gradle --type kotlinRepository: YAPP-Github/Reed-Android
Length of output: 50
🏁 Script executed:
# Read the version catalog
cat gradle/libs.versions.tomlRepository: YAPP-Github/Reed-Android
Length of output: 11177
인증 헤더는 Chucker 수집 대상에서 제외해 주세요.
현재 코드는 ChuckerInterceptor(context) 기본 생성자로 생성되어 Authorization, Cookie, Set-Cookie 같은 민감 헤더가 그대로 저장될 수 있습니다. 디버그 빌드여도 기기에서 열람·공유 가능한 네트워크 캡처가 남기 때문에 보안/프라이버시 관점에서 위험합니다. 93번 줄에서 Builder로 변경하면서 인증 관련 헤더를 마스킹하세요.
민감 헤더 마스킹 예시
fun provideChuckerInterceptor(
`@ApplicationContext` context: Context,
): ChuckerInterceptor {
- return ChuckerInterceptor(context)
+ return ChuckerInterceptor.Builder(context)
+ .redactHeaders("Authorization", "Cookie", "Set-Cookie")
+ .build()
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @Provides | |
| fun provideChuckerInterceptor( | |
| @ApplicationContext context: Context, | |
| ): ChuckerInterceptor { | |
| return ChuckerInterceptor(context) | |
| } | |
| @Provides | |
| fun provideOkHttpClient( | |
| httpLoggingInterceptor: HttpLoggingInterceptor, | |
| tokenInterceptor: TokenInterceptor, | |
| tokenAuthenticator: TokenAuthenticator, | |
| chuckerInterceptor: ChuckerInterceptor, | |
| ): OkHttpClient { | |
| return OkHttpClient.Builder() | |
| .connectTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | |
| .readTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | |
| .writeTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | |
| .addInterceptor(tokenInterceptor) | |
| .authenticator(tokenAuthenticator) | |
| .addInterceptor(chuckerInterceptor) | |
| `@Provides` | |
| fun provideChuckerInterceptor( | |
| `@ApplicationContext` context: Context, | |
| ): ChuckerInterceptor { | |
| return ChuckerInterceptor.Builder(context) | |
| .redactHeaders("Authorization", "Cookie", "Set-Cookie") | |
| .build() | |
| } | |
| `@Provides` | |
| fun provideOkHttpClient( | |
| httpLoggingInterceptor: HttpLoggingInterceptor, | |
| tokenInterceptor: TokenInterceptor, | |
| tokenAuthenticator: TokenAuthenticator, | |
| chuckerInterceptor: ChuckerInterceptor, | |
| ): OkHttpClient { | |
| return OkHttpClient.Builder() | |
| .connectTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | |
| .readTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | |
| .writeTimeout(MaxTimeoutMillis, TimeUnit.MILLISECONDS) | |
| .addInterceptor(tokenInterceptor) | |
| .authenticator(tokenAuthenticator) | |
| .addInterceptor(chuckerInterceptor) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@core/network/src/main/kotlin/com/ninecraft/booket/core/network/di/NetworkGraph.kt`
around lines 89 - 109, provideChuckerInterceptor 및 OkHttp 클라이언트 설정에서
ChuckerInterceptor를 기본 생성자로 사용해 민감 헤더가 수집되고 있으니, provideChuckerInterceptor에서
ChuckerInterceptor(context) 대신 ChuckerInterceptor.Builder(context)로 생성하고
addHeaderToMask("Authorization"), addHeaderToMask("Cookie"),
addHeaderToMask("Set-Cookie") 등을 호출해 인증 관련 헤더를 마스킹하도록 변경한 뒤 provideOkHttpClient의
인자로 넘기도록 수정하세요; 대상 식별자는 provideChuckerInterceptor, provideOkHttpClient,
ChuckerInterceptor(context)/ChuckerInterceptor.Builder를 참고하세요.
versionName 1.3.0 -> 1.4.0 versionCode 9 -> 11
🔗 관련 이슈
📙 작업 설명
🧪 테스트 내역 (선택)
📸 스크린샷 또는 시연 영상 (선택)
💬 추가 설명 or 리뷰 포인트 (선택)
Summary by CodeRabbit
릴리스 노트
릴리스
개선 사항