Skip to content

Comments

[FEAT] sns 수정 API (#361)#363

Merged
lingard1234 merged 3 commits intodevfrom
feat/361-snsedit
Feb 10, 2026
Merged

[FEAT] sns 수정 API (#361)#363
lingard1234 merged 3 commits intodevfrom
feat/361-snsedit

Conversation

@lingard1234
Copy link
Contributor

Summary

sns 수정 API 엔드포인트 생성 및 스웨거 정리

Changes

UseService, UserSwagger, MyInstagramUpdateRequestDto

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)
  • New feature (기존 기능에 영향을 주지 않는 새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 수정)
  • Refactoring (기능 변경 없는 코드 개선)
  • Documentation (문서 수정)
  • Chore (빌드, 설정 등 기타 변경)
  • Release (develop → main 배포)

Related Issues

Closes #361

참고 사항

@lingard1234 lingard1234 self-assigned this Feb 10, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lingard1234, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 사용자가 전용 API 엔드포인트를 통해 인스타그램 계정 ID를 업데이트할 수 있는 새로운 기능을 도입합니다. 이는 소셜 미디어 링크를 수정하는 구조화된 방법을 제공하여 사용자 프로필 관리를 개선하고, 데이터 일관성을 보장하며 사용자 경험을 향상시킵니다.

Highlights

  • 새로운 API 엔드포인트 추가: 사용자의 인스타그램 ID를 수정하기 위한 새로운 API 엔드포인트가 추가되었습니다.
  • 서비스 로직 구현: UserService에 인스타그램 ID 업데이트를 처리하는 updateSns 메서드가 구현되었습니다.
  • 도메인 엔티티 업데이트: UserMatchingDetail 엔티티에 SNS 계정 업데이트를 처리하고 URL 형식으로 저장하는 로직이 추가되었습니다.
  • 새로운 DTO 도입: 인스타그램 ID 업데이트 요청을 위한 MyInstagramUpdateRequestDto라는 새로운 DTO가 생성되었습니다.
  • Swagger 문서 업데이트: 새로운 인스타그램 ID 수정 API에 대한 Swagger 문서가 추가되었으며, 기존 프로필 이미지 수정 API 문서도 개선되었습니다.
Changelog
  • src/main/java/com/example/RealMatch/user/application/service/UserService.java
    • MyInstagramUpdateRequestDto 임포트가 추가되었습니다.
    • 인스타그램 ID 업데이트를 처리하는 updateSns 메서드가 구현되었습니다.
  • src/main/java/com/example/RealMatch/user/domain/entity/UserMatchingDetail.java
    • snsUrl 필드를 업데이트하고 인스타그램 계정을 URL 형식으로 변환하는 updateSns 메서드가 추가되었습니다.
  • src/main/java/com/example/RealMatch/user/presentation/controller/UserController.java
    • MyInstagramUpdateRequestDto 임포트가 추가되었습니다.
    • 사용자 인스타그램 ID 업데이트를 위한 새로운 PATCH /me/instagram 엔드포인트가 구현되었습니다.
  • src/main/java/com/example/RealMatch/user/presentation/dto/request/MyInstagramUpdateRequestDto.java
    • 인스타그램 업데이트 요청을 캡슐화하는 새로운 DTO가 생성되었으며, snsAccount 필드에 크기 제약 조건이 포함되었습니다.
  • src/main/java/com/example/RealMatch/user/presentation/swagger/UserSwagger.java
    • MyInstagramUpdateRequestDto 임포트가 추가되었습니다.
    • 새로운 인스타그램 업데이트 API를 포함하도록 Swagger 문서가 업데이트되었으며, 자세한 설명과 응답 코드가 추가되었습니다.
    • 기존 프로필 이미지 업데이트 문서가 더 자세하게 개선되었습니다.
Activity
  • 현재까지 이 Pull Request에 대한 사람의 활동은 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR successfully adds a new API endpoint for updating user Instagram account information, with the functionality generally well-implemented. However, a significant security concern exists due to the lack of input validation for the "snsAccount" field. This oversight can lead to potential Stored Cross-Site Scripting (XSS) and Open Redirect vulnerabilities, as unvalidated input is used to construct URLs and is returned in API responses. Implementing strict regex validation at the DTO level is recommended to mitigate these risks.

Comment on lines 11 to 12
@Size(max = 100)
private String snsAccount;
Copy link
Contributor

Choose a reason for hiding this comment

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

security-high high

The snsAccount field lacks proper validation, allowing arbitrary strings to be submitted. This can lead to potential Open Redirect and Stored Cross-Site Scripting (XSS) vulnerabilities, as the input is used to construct URLs and is returned in API responses. For example, an attacker could provide a payload like ../../attacker.com to manipulate the constructed URL or "><script>alert(1)</script> to inject malicious scripts. Additionally, Instagram account IDs have a maximum length of 30 characters, so the @Size(max = 100) should be adjusted to 30 to align with this requirement and strengthen data validation.

    @Size(max = 30)
    @jakarta.validation.constraints.Pattern(regexp = "^[a-zA-Z0-9._]*$", message = "Invalid Instagram handle format")
    private String snsAccount;

Comment on lines 58 to 59
String cleanAccount = snsAccount.trim().replace("@", "");
this.snsUrl = "https://www.instagram.com/" + cleanAccount + "/";
Copy link
Contributor

Choose a reason for hiding this comment

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

security-high high

The updateSns method constructs an Instagram URL by simple concatenation with the user-provided snsAccount string. Without strict validation for path traversal characters (e.g., ../), an attacker can manipulate the resulting snsUrl. For example, an input of ../../attacker.com would result in https://www.instagram.com/../../attacker.com/, which resolves to https://attacker.com/. This constitutes an Open Redirect vulnerability if the URL is used in the frontend or an SSRF risk if used server-side.

@lingard1234 lingard1234 merged commit 1e52023 into dev Feb 10, 2026
1 check passed
@lingard1234 lingard1234 deleted the feat/361-snsedit branch February 10, 2026 15:22
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.

[FEAT] 인스타그램 수정 API 구현

1 participant