Skip to content
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

Api: ✏️ Modify the format of chat search api #182

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

psychology50
Copy link
Member

작업 이유

  • JSend 프로토콜에 맞추어 Slice 응답 템플릿 수정
  • Swagger 수정
  • Sql Injection Defense

작업 사항

1️⃣ Slice 응답 포맷

{
    "code": "",
    "data": {
        "domain": { // 복수 명사에서 단수 명사로 수정
            "contents": [ // 단수 명사에서 복수 명사로 수정

            ],
            // ... 이하 동일
        }
    }
}
  • 새벽에 웹 프론트 팀과 이야기하다 보니, 단수/복수 명칭을 혼용하고 있는 것 같아 SliceResponseTemplate를 수정했습니다.
  • 단, 해당 Template는 최근에 개발한 Api: ✨ 채팅방 검색 API #181 에만 반영하고, 이전의 무한 스크롤 API들에는 반영되어 있지 않습니다. (수정하면 iOS팀에서 모두 바꿔줘야 함.)

2️⃣ SQL Injection Defense

JPA는 기본적으로 SQL Injection 공격을 방어해주긴 하지만,
JPA와 JPASQLQuery를 혼용하고 있기 때문에 혹시나 싶은 상황에 대비하여 몇 가지 키워드를 target parameter로 전달해보았습니다.

  • ;delete from chat_room where id=4;
  • ;drop table chat_room;
  • ;delete from user;

머쓱할 정도로 잘 막아주더라구요. 허허.
SQLQueryFactory를 사용하지 않아서, Hibernate 기반의 SQL을 실행할 수 있기 때문에 괜찮다고 판단하였습니다.


리뷰어가 중점적으로 확인해야 하는 부분

  • 없음.

발견한 이슈

  • 없음.

@psychology50 psychology50 added the fix 기능 수정 label Oct 24, 2024
@psychology50 psychology50 self-assigned this Oct 24, 2024
@psychology50 psychology50 merged commit 149756f into dev Oct 24, 2024
1 check passed
@psychology50 psychology50 deleted the fix/search-chat-rooms branch October 24, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 기능 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant