Commit Graph

8 Commits

Author SHA1 Message Date
b006fe77c2 fix: API 서버 코드 리뷰 버그 15건 수정 (CRITICAL 2, HIGH 2, MEDIUM 11)
All checks were successful
Server CI/CD / lint-and-build (push) Successful in 38s
Server CI/CD / deploy (push) Successful in 50s
CRITICAL:
- graceful shutdown 레이스 수정 — Listen을 goroutine으로 이동
- Register 레이스 컨디션 — sentinel error + MySQL duplicate key 처리

HIGH:
- 멱등성 키에 method+path 포함 — 엔드포인트 간 캐시 충돌 방지
- 입장 토큰 생성 실패 시 방/슬롯 롤백 추가

MEDIUM:
- RequestEntry 슬롯 없음 시 503 반환
- chain ExportWallet/GetWalletInfo/GrantReward 에러 처리 개선
- resolveUsername 에러 타입 구분 (duplicate key vs 기타)
- 공지사항 길이 검증 byte→rune (한국어 256자 허용)
- Level 검증 범위 MaxLevel(50)로 통일
- admin 자기 강등 방지
- CORS ExposeHeaders 추가
- MySQL DSN loc=Local→loc=UTC
- hashGameExeFromZip 100MB 초과 절단 감지

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 18:05:27 +09:00
4393503245 Fix: GrantExperience에서 프로필 미존재 시 자동 생성 fallback 추가
FindByUserID → GetProfile(auto-create 포함)로 변경하여
프로필 없는 유저의 경험치 지급 실패 방지.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:15:49 +09:00
0dfa744c16 feat: DB DI 전환 + download 하위 호환성 + race condition 수정
- middleware(Auth, Idempotency)를 클로저 팩토리 패턴으로 DI 전환
- database.DB/RDB 전역 변수 제거, ConnectMySQL/Redis 값 반환으로 변경
- download API X-API-Version 헤더 + 하위 호환성 규칙 문서화
- SaveGameData PlayTimeDelta 원자적 UPDATE (race condition 해소)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:58:36 +09:00
82adb37ecb fix: BossRoom soft delete → hard delete + 프로필 자동 생성
All checks were successful
Server CI/CD / lint-and-build (push) Successful in 17s
Server CI/CD / deploy (push) Successful in 57s
- BossRoom 삭제 시 Unscoped() hard delete로 변경하여 unique index 충돌 방지
- GetProfile에서 프로필 없으면 기본값으로 자동 생성

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 13:09:23 +09:00
befea9dd68 feat: Swagger API 문서 추가 + 보스레이드/플레이어 레벨 시스템
Some checks failed
Server CI/CD / lint-and-build (push) Failing after 12m3s
Server CI/CD / deploy (push) Has been cancelled
- swaggo/swag 기반 전체 API 엔드포인트 Swagger 어노테이션 (59개)
- /swagger/ 경로에 Swagger UI 제공
- 보스레이드 데디서버 관리 (등록, 하트비트, 슬롯 리셋)
- 플레이어 레벨/경험치 시스템 및 스탯 성장

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 17:51:37 +09:00
423e2832a0 fix: 3차 리뷰 LOW — 에러 메시지 일관성, Redis 타임아웃, 입력 검증
Some checks failed
Server CI/CD / lint-and-build (push) Failing after 30s
Server CI/CD / deploy (push) Has been skipped
- 5개 핸들러 err.Error() → 제네릭 메시지 (Login, Refresh, SSAFY, Ticket, BossRaid)
- Redis context.Background() → WithTimeout 5s (10곳)
- SprintMultiplier 범위 검증 추가
- 방어적 문서화 (SSAFY 충돌, zip bomb, body limit prefix, 로그 주입)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:05:17 +09:00
b0de89a18a feat: 코드 리뷰 기반 전면 개선 — 보안, 검증, 테스트, 안정성
Some checks failed
Server CI/CD / lint-and-build (push) Failing after 47s
Server CI/CD / deploy (push) Has been skipped
- 체인 nonce 경쟁 조건 수정 (operatorMu + per-user mutex)
- 등록/SSAFY 원자적 트랜잭션 (wallet+profile 롤백 보장)
- IdempotencyRequired 미들웨어 (SETNX 원자적 클레임)
- 런치 티켓 API (JWT URL 노출 방지)
- HttpOnly 쿠키 refresh token
- SSAFY OAuth state 파라미터 (CSRF 방지)
- Refresh 시 DB 조회로 최신 role 사용
- 공지사항/유저목록 페이지네이션
- BodyLimit 미들웨어 (1MB, upload 제외)
- 입력 검증 강화 (닉네임, 게임데이터, 공지 길이)
- 에러 메시지 내부 정보 노출 방지
- io.LimitReader (RPC 10MB, SSAFY 1MB)
- RequestID 비출력 문자 제거
- 단위 테스트 (auth 11, announcement 9, bossraid 16)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 18:03:25 +09:00
cc8368dfba feat: 인프라 개선 — 헬스체크, 로깅, 보안, CI 검증
Some checks failed
Server CI/CD / lint-and-build (push) Failing after 1m13s
Server CI/CD / deploy (push) Has been skipped
- /health + /ready 엔드포인트 추가 (DB/Redis 상태 확인)
- RequestID 미들웨어 + 구조화 JSON 로깅
- 체인 트랜잭션 per-user rate limit (20 req/min)
- DB 커넥션 풀 설정 (MaxOpen 25, MaxIdle 10, MaxLifetime 5m)
- Graceful Shutdown 시 Redis/MySQL 연결 정리
- Dockerfile HEALTHCHECK 추가
- CI에 go vet + 빌드 검증 단계 추가 (deploy 전 실행)
- 보스 레이드 클라이언트 입장 API (JWT 인증)
- Player 프로필 모듈 추가

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 03:41:34 +09:00