Skip to content

fix: 코스 생성 시 GPS 경로 전체를 로그에 남기던 코드 제거 (dev) - #232

Merged
unam98 merged 1 commit into
devfrom
fix/course-path-log-pii-dev
Aug 11, 2026
Merged

fix: 코스 생성 시 GPS 경로 전체를 로그에 남기던 코드 제거 (dev)#232
unam98 merged 1 commit into
devfrom
fix/course-path-log-pii-dev

Conversation

@unam98

@unam98 unam98 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

작업 배경

dev/main 브랜치 정합성을 점검하다가, 개인정보(GPS 경로) 로깅 관련 실제 취약점을 발견했다.

변경 사항

영역 내용
CoordinatePathConverter.java 코스 생성 시 유저의 실제 GPS 좌표 전체를 log.info로 남기던 코드 제거, main의 안전한 버전으로 교체

영향 범위

  • 보안/개인정보 이슈: main엔 이미 fix/course-path-log-pii(fix: 코스 생성 시 GPS 경로 전체를 로그에 남기던 코드 제거 #200)로 이 문제가 수정됐는데, dev는 그 수정을 반영받지 못했을 뿐 아니라 오히려 좌표 전체((lat, lng) 쌍 전부)를 log.info(sb.toString())으로 명시적으로 남기는 코드가 추가돼 있었음 — 지금 dev 환경에서 코스를 생성할 때마다 유저의 실제 러닝 경로가 서버 로그에 그대로 남고 있던 상태.
  • 수정 후에는 변환 실패 시에도 좌표값 자체가 아니라 size/type/에러 메시지만 로그에 남도록 main과 동일하게 맞춤 — 정상 동작(로직 자체)은 변경 없음.

Test Plan

  • ./gradlew compileJava 성공
  • 로컬 postgres/redis 기동 후 ./gradlew test 전체 251/251 통과

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved warning messages when course paths cannot be converted, including relevant path details and the error message.
    • Reduced unnecessary logging during course-path processing for cleaner system behavior.

dev/main 브랜치 정합성을 점검하다가, main엔 이미
fix/course-path-log-pii(#200)로 고쳐진 문제가 dev엔 반영이 안 돼
있었을 뿐 아니라, 오히려 유저의 실제 GPS 좌표 전체를 log.info로
그대로 남기는 코드가 남아있는 걸 발견했다. main의 안전한 버전
(에러 시에도 좌표값 자체는 로그에 안 남기고 size/type/메시지만
남김)으로 맞췄다.
@unam98 unam98 self-assigned this Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The converter now emits one structured warning for conversion failures. The getLineString method removes temporary coordinate-string construction and informational logging, then returns the created LineString directly.

Changes

Coordinate path conversion

Layer / File(s) Summary
Logging and LineString conversion
src/main/java/org/runnect/server/common/module/convert/CoordinatePathConverter.java
The converter logs path size, runtime type, and exception details in one parameterized warning. getLineString returns the created LineString without temporary logging data.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removing full GPS path logging during course creation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/course-path-log-pii-dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/org/runnect/server/common/module/convert/CoordinatePathConverter.java`:
- Line 21: Update the failure logging in CoordinatePathConverter so the catch
handler remains null-safe when path is null. Replace direct path.size() and
path.getClass() access with null-safe size and type values, or validate path
before getLineString(path), while preserving the intended BadRequestException
flow.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2aea820a-6e5d-482a-a938-b7a945e6a8fe

📥 Commits

Reviewing files that changed from the base of the PR and between 4322980 and ec4a901.

📒 Files selected for processing (1)
  • src/main/java/org/runnect/server/common/module/convert/CoordinatePathConverter.java

} catch (Exception e) {
log.warn("course 요청 데이터 값 (path) -> " + path);
log.warn("course 요청 데이터 값의 타입 (path) -> " + path.getClass().getName());
log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}", path.size(), path.getClass().getName(), e.getMessage());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Keep failure logging null-safe.

When path is null, getLineString(path) fails first, but the catch block then evaluates path.size() and path.getClass(). The handler throws NullPointerException instead of the intended BadRequestException.

Use null-safe size/type values or validate path before conversion.

Proposed fix
-            log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}", path.size(), path.getClass().getName(), e.getMessage());
+            log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}",
+                path == null ? null : path.size(),
+                path == null ? "null" : path.getClass().getName(),
+                e.getMessage());
📝 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.

Suggested change
log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}", path.size(), path.getClass().getName(), e.getMessage());
log.warn("course 요청 데이터 변환 실패 (size={}, type={}): {}",
path == null ? null : path.size(),
path == null ? "null" : path.getClass().getName(),
e.getMessage());
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/org/runnect/server/common/module/convert/CoordinatePathConverter.java`
at line 21, Update the failure logging in CoordinatePathConverter so the catch
handler remains null-safe when path is null. Replace direct path.size() and
path.getClass() access with null-safe size and type values, or validate path
before getLineString(path), while preserving the intended BadRequestException
flow.

@unam98
unam98 merged commit b070376 into dev Aug 11, 2026
2 checks passed
@unam98
unam98 deleted the fix/course-path-log-pii-dev branch August 11, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants