Skip to content

Refactor/#240 api versioning#245

Merged
oculo0204 merged 4 commits intodevelopfrom
refactor/#240-api-versioning
Feb 25, 2026
Merged

Refactor/#240 api versioning#245
oculo0204 merged 4 commits intodevelopfrom
refactor/#240-api-versioning

Conversation

@hyorim-jo
Copy link
Collaborator

@hyorim-jo hyorim-jo commented Feb 25, 2026

🔗 관련 이슈

#240


📌 작업 내용

API 버전 관리 체계 도입 — @apiv1 / @apiv2 어노테이션 기반 /api/v1, /api/v2 prefix 적용


📎 참고 사항 (선택)

딥링크 리디렉션 페이지는 경로 유지를 위해 versioning에서 제외했습니다.

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 12개 컨트롤러의 공개 API 경로에서 /api 접두사를 제거하고 일관된 API 버전 어노테이션을 적용했습니다. 일부 컨트롤러는 경로 변경 없이 버전 어노테이션(또는 관련 import)만 추가되었습니다.

@hyorim-jo hyorim-jo requested a review from oculo0204 February 25, 2026 03:19
@hyorim-jo hyorim-jo self-assigned this Feb 25, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ddb1e6b and 2fb76fc.

📒 Files selected for processing (1)
  • src/main/java/com/umc/linkyou/awsS3/controller/AwsS3Controller.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/umc/linkyou/awsS3/controller/AwsS3Controller.java

Walkthrough

여러 컨트롤러 클래스에 @ApiV1 어노테이션을 추가하고 클래스 레벨 @RequestMapping에서 /api 접두사를 제거하거나 경로를 변경했습니다. 일부 파일에는 임포트만 추가되었습니다. 메서드 로직과 시퀀스는 변경되지 않았습니다.

Changes

Cohort / File(s) Summary
API V1 Annotation & Path Mapping Updates
src/main/java/com/umc/linkyou/web/controller/AiArticleController.java, src/main/java/com/umc/linkyou/web/controller/AlarmController.java, src/main/java/com/umc/linkyou/web/controller/CategoryController.java, src/main/java/com/umc/linkyou/web/controller/CurationController.java, src/main/java/com/umc/linkyou/web/controller/DomainController.java, src/main/java/com/umc/linkyou/web/controller/FolderController.java, src/main/java/com/umc/linkyou/web/controller/InvitationController.java, src/main/java/com/umc/linkyou/web/controller/LinkuController.java, src/main/java/com/umc/linkyou/web/controller/ShareFolderController.java, src/main/java/com/umc/linkyou/web/controller/SharedFolderController.java
각 컨트롤러 클래스에 @ApiV1 어노테이션을 추가하고 클래스 레벨 @RequestMapping에서 /api 접두사를 제거함(예: /api/aiarticle/aiarticle). 메서드 시그니처 및 로직 불변.
AWS S3 Controller Annotation
src/main/java/com/umc/linkyou/awsS3/controller/AwsS3Controller.java
ApiV1 임포트 및 클래스 레벨 @ApiV1 어노테이션 추가. 메서드 로직은 변경 없음.
DeepLink Controller Import Only
src/main/java/com/umc/linkyou/web/controller/DeepLinkController.java
ApiV1 임포트 추가만 이루어짐; 어노테이션 적용 또는 경로 변경은 없음.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 새 어노테이션 달고
길에서 /api 빼고 나왔네
짧아진 경로 따라 홉홉 뛰며
컨트롤러들 인사하네
당근 하나에 축하 춤 💃✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Refactor/#240 api versioning' accurately summarizes the main change: introducing API versioning with @ApiV1 and @ApiV2 annotations and route restructuring across multiple controllers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#240-api-versioning

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/main/java/com/umc/linkyou/web/controller/LinkuController.java (1)

98-103: ⚠️ Potential issue | 🟠 Major

인증 없이 임의 사용자 링크 조회 가능 (기존 문제)

GET /{userId}/{linkuId} 엔드포인트는 @AuthenticationPrincipal을 사용하지 않고 userId를 경로 변수로 직접 수신합니다. 이로 인해 인증된 사용자라면 타인의 userIdlinkuId를 알고 있을 경우 해당 링크 상세 정보를 무제한으로 조회할 수 있습니다. 이번 PR의 변경 사항은 아니지만, 버전 경로가 갱신되면서 외부에 더 명확히 노출될 수 있는 엔드포인트입니다. 요청자의 인증 정보와 대상 userId가 일치하는지 또는 공유 폴더 뷰어 권한을 가지고 있는지 검사하는 로직이 필요합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/umc/linkyou/web/controller/LinkuController.java` around
lines 98 - 103, The detailLinku endpoint currently accepts userId and linkuId
directly which allows unauthenticated access to arbitrary users' links; update
the controller method detailLinku to accept the authenticated principal (e.g.,
add an `@AuthenticationPrincipal` parameter or Authentication/Principal) and pass
the principal's user id into linkuService.detailGetLinku (or add a new service
method that accepts both requesterId and target userId/linkuId) so the service
can verify requesterId == userId or that the requester has shared-folder/viewer
permission before returning data; ensure permission checks live in linkuService
(e.g., in detailGetLinku) to centralize auth logic and avoid relying on
client-supplied path userId.
src/main/java/com/umc/linkyou/web/controller/ShareFolderController.java (1)

43-43: ⚠️ Potential issue | 🟡 Minor

쿼리 파라미터명을 token으로 변경하여 명확성 개선

ShareFolderController.java 라인 43에서 생성되는 딥링크 URL은 folderId 파라미터에 실제 초대 토큰값을 담고 있습니다. DeepLinkController.java 라인 31에서 이 파라미터를 그대로 받아 라인 34에서 템플릿에 전달하고 있습니다. 파라미터명이 실제 데이터와 맞지 않아 혼동을 야기할 수 있으므로, folderId 대신 token으로 변경하는 것이 권장됩니다.

URL 생성 코드
deeplinkBaseUrl + "/open?action=share&folderId=" + token
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/umc/linkyou/web/controller/ShareFolderController.java` at
line 43, Change the deep link query parameter from folderId to token to match
the actual value: update the URL construction in ShareFolderController (the
return ApiResponse.of(...) that builds deeplinkBaseUrl +
"/open?action=share&folderId=" + token) to use "token" instead of "folderId",
and update DeepLinkController to read the "token" request parameter (the code
around where it currently reads the folderId at line ~31 and passes it to the
template at ~34) so the param name matches across both controllers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/main/java/com/umc/linkyou/web/controller/LinkuController.java`:
- Around line 98-103: The detailLinku endpoint currently accepts userId and
linkuId directly which allows unauthenticated access to arbitrary users' links;
update the controller method detailLinku to accept the authenticated principal
(e.g., add an `@AuthenticationPrincipal` parameter or Authentication/Principal)
and pass the principal's user id into linkuService.detailGetLinku (or add a new
service method that accepts both requesterId and target userId/linkuId) so the
service can verify requesterId == userId or that the requester has
shared-folder/viewer permission before returning data; ensure permission checks
live in linkuService (e.g., in detailGetLinku) to centralize auth logic and
avoid relying on client-supplied path userId.

In `@src/main/java/com/umc/linkyou/web/controller/ShareFolderController.java`:
- Line 43: Change the deep link query parameter from folderId to token to match
the actual value: update the URL construction in ShareFolderController (the
return ApiResponse.of(...) that builds deeplinkBaseUrl +
"/open?action=share&folderId=" + token) to use "token" instead of "folderId",
and update DeepLinkController to read the "token" request parameter (the code
around where it currently reads the folderId at line ~31 and passes it to the
template at ~34) so the param name matches across both controllers.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa3dd02 and ddb1e6b.

📒 Files selected for processing (12)
  • src/main/java/com/umc/linkyou/awsS3/controller/AwsS3Controller.java
  • src/main/java/com/umc/linkyou/web/controller/AiArticleController.java
  • src/main/java/com/umc/linkyou/web/controller/AlarmController.java
  • src/main/java/com/umc/linkyou/web/controller/CategoryController.java
  • src/main/java/com/umc/linkyou/web/controller/CurationController.java
  • src/main/java/com/umc/linkyou/web/controller/DeepLinkController.java
  • src/main/java/com/umc/linkyou/web/controller/DomainController.java
  • src/main/java/com/umc/linkyou/web/controller/FolderController.java
  • src/main/java/com/umc/linkyou/web/controller/InvitationController.java
  • src/main/java/com/umc/linkyou/web/controller/LinkuController.java
  • src/main/java/com/umc/linkyou/web/controller/ShareFolderController.java
  • src/main/java/com/umc/linkyou/web/controller/SharedFolderController.java

@oculo0204 oculo0204 merged commit a245f65 into develop Feb 25, 2026
2 checks passed
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