Skip to content

[room] 방 조회 엔드포인트 rate limiting 적용 - #63

Open
Sean-mn wants to merge 2 commits into
developfrom
add/room-read-rate-limit
Open

Sean-mn wants to merge 2 commits into
developfrom
add/room-read-rate-limit

Conversation

@Sean-mn

@Sean-mn Sean-mn commented Jul 7, 2026

Copy link
Copy Markdown
Member

개요

인증 없이 열려 있는 방 조회 엔드포인트에 IP 기반 rate limiting을 적용하여 방 목록 열거 및 스크래핑을 제한하였습니다. 아울러 HttpClient 요청 로그 노이즈를 줄이도록 로그 레벨을 조정하였습니다.

변경 사항

  • RateLimitConfigread_room 정책을 추가하였습니다. IP 단위 Fixed Window 방식으로 분당 60회로 제한하였습니다.
  • RoomController의 방 단일 조회(GET {roomCode})와 방 목록 조회(GET all) 엔드포인트에 [EnableRateLimiting("read_room")]를 적용하였습니다.
  • appsettings.json의 로깅 설정에 System.Net.Http.HttpClient 레벨을 Warning으로 추가하여 HttpClient 요청 로그를 억제하였습니다.

검증

  • 로컬 빌드로 컴파일 정상 확인하였습니다.

영향

  • 동일 IP에서 방 조회 요청이 분당 60회를 초과하면 429 응답을 반환하게 되었습니다. 정상 사용자 트래픽 범위에는 영향이 없도록 여유 있게 설정하였습니다.
  • 로깅 변경으로 HttpClient 관련 Information 로그가 더 이상 출력되지 않습니다.

@Sean-mn Sean-mn added the enhancement:개선사항 New feature or request label Jul 7, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces rate limiting to the room retrieval endpoints ('GetRoom' and 'GetAllRoom') using a new 'read_room' policy, and configures the log level for 'System.Net.Http.HttpClient' to 'Warning'. The review feedback suggests a performance optimization in the rate limiting configuration: using 'IPAddress' directly as the partition key instead of generating a string key, which avoids unnecessary string allocations and reduces GC overhead under high traffic.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/PushAndPull/Global/Config/RateLimitConfig.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement:개선사항 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant