Commit Graph

18 Commits

Author SHA1 Message Date
23bec776ab fix: 코드 리뷰 기반 보안·안정성 개선 (14건)
All checks were successful
Server CI/CD / deploy (push) Successful in 1m36s
- unsafe 타입 단언 → safe assertion (chain handler 11곳, auth Logout)
- Repository 에러 시 nil 반환으로 통일 (chain, auth, announcement)
- string ID → uint 파싱으로 타입 안전성 확보 (auth, announcement)
- CORS AllowHeaders에 Idempotency-Key, X-API-Key 추가
- /verify 엔드포인트 rate limiter 적용
- Redis 호출에 context timeout 적용 (auth, idempotency 미들웨어)
- chain handler 에러 응답에서 내부 정보 노출 방지
- f.Close() 에러 검사 추가 (download service 2곳)
- 공지사항 Delete 404 응답 추가
- 회원가입 롤백 시 Delete 에러 로깅

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:47:00 +09:00
9738f1a83c fix: SSAFYTokenResponse.expires_in 타입을 int로 수정
All checks were successful
Server CI/CD / deploy (push) Successful in 1m26s
SSAFY 서버가 expires_in을 숫자로 반환하므로 string에서 int로 변경.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 01:21:01 +09:00
0ce39a48b9 feat: SSAFY OAuth 2.0 로그인 구현
All checks were successful
Server CI/CD / deploy (push) Successful in 26s
SSAFY 인증 서버를 통한 소셜 로그인 기능 추가.
인가 코드 교환, 사용자 정보 조회, 자동 회원가입 처리.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:54:22 +09:00
26876ba8ca fix: 보안 강화 및 안정성 개선
All checks were successful
Server CI/CD / deploy (push) Successful in 5s
- fileHash 빈 문자열 시 게임 업로드 거부 (A301.exe 누락 zip 차단)
- Rate limiting 추가: 인증 API 10req/min, 일반 API 60req/min
- 블록체인 트랜잭션 Idempotency-Key 미들웨어 (Redis 캐싱, 10분 TTL)
- 파일 업로드 크기 제한 4GB (BodyLimit)
- Username 대소문자 정규화 (Register/Login에서 소문자 변환)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 11:10:23 +09:00
4843470310 fix: 보안 강화 및 리프레시 토큰 도입
All checks were successful
Server CI/CD / deploy (push) Successful in 7s
- middleware: JWT MapClaims 타입 단언 패닉 → ok 패턴으로 방어
- auth/service: Redis Set 오류 처리, 지갑 생성 실패 시 유저 롤백
- auth/service: EnsureAdmin 지갑 생성 추가, Logout 리프레시 토큰도 삭제
- auth/service: 리프레시 토큰 발급(7일) 및 로테이션, REFRESH_SECRET 분리
- auth/handler: Login 응답에 refreshToken 포함, Refresh 핸들러 추가
- auth/handler: Logout 에러 처리 추가
- download/service: hashGameExeFromZip io.Copy 오류 처리
- download/handler: Content-Disposition mime.FormatMediaType으로 헤더 인젝션 방어
- announcement/handler: Update 빈 body 400 반환
- config: REFRESH_SECRET 환경변수 추가
- routes: POST /api/auth/refresh 엔드포인트 추가
- main: INTERNAL_API_KEY 미설정 시 경고 출력
- .env.example: 누락 환경변수 7개 보완

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 09:51:17 +09:00
f8b23e93bf feat: 블록체인(chain) 통합 및 내부 API 추가
All checks were successful
Server CI/CD / deploy (push) Successful in 7s
- internal/chain 패키지 추가 (client, handler, service, repository, model)
- 체인 연동 엔드포인트: 지갑 조회, 잔액, 자산, 인벤토리, 마켓 등
- 관리자 전용 체인 엔드포인트: 민팅, 보상, 템플릿 등록
- 게임 서버용 내부 API (/api/internal/chain/*) + ServerAuth 미들웨어
- 회원가입 시 블록체인 월렛 자동 생성
- 체인 관련 환경변수 및 InternalAPIKey 설정 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 13:18:15 +09:00
1b6260ee4e refactor: verify 응답에서 userId 제거
All checks were successful
Server CI/CD / deploy (push) Successful in 37s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 14:14:39 +09:00
d6abac3f0a feat: JWT 검증 엔드포인트 추가 (POST /api/auth/verify)
All checks were successful
Server CI/CD / deploy (push) Successful in 1m17s
게임 서버가 클라이언트로부터 받은 JWT를 웹 서버에 전달하면,
서명 검증 + Redis 세션 확인 후 userId와 username을 응답한다.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 13:13:26 +09:00
f547593c6f feat: launcher.exe와 game.zip 별도 업로드/서빙 분리
All checks were successful
Server CI/CD / deploy (push) Successful in 36s
- POST /api/download/upload/game - 게임 zip 업로드
- POST /api/download/upload/launcher - launcher.exe 업로드
- GET /api/download/launcher - launcher.exe 서빙
- Info 모델에 LauncherURL, LauncherSize 필드 추가
- Content-Disposition 헤더로 올바른 파일명 설정

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 23:34:09 +09:00
18c39bd4c5 feat: 게임 파일 직접 업로드 방식으로 전환
All checks were successful
Server CI/CD / deploy (push) Successful in 35s
- zip 스트리밍 업로드 (StreamRequestBody) → /data/game/game.zip 저장
- A301.exe SHA256 해시 자동 추출 (zip 분석)
- 버전·파일명·크기 파일명 및 용량에서 자동 추출
- GET /api/download/file 엔드포인트 추가
- BASE_URL, GAME_DIR 환경변수 추가
- Dockerfile에 /data/game 디렉토리 생성

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 23:25:07 +09:00
003eb4c1c2 fix: fileHash 필수 조건 제거 (선택 입력으로 변경)
All checks were successful
Server CI/CD / deploy (push) Successful in 35s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 22:34:53 +09:00
8dee6f70b3 feat: 다운로드 정보에 fileHash 필드 추가
All checks were successful
Server CI/CD / deploy (push) Successful in 38s
게임 EXE의 SHA256 해시를 저장하여 런처가 버전 검증에 활용

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 22:22:37 +09:00
3fb182c271 feat: 회원가입 API 추가 (POST /api/auth/register)
All checks were successful
Server CI/CD / deploy (push) Successful in 37s
- Register 서비스 메서드 추가 (중복 아이디 체크, bcrypt 해시, role: user로 생성)
- Register 핸들러 추가 (빈값, 6자 미만 비밀번호 유효성 검사)
- /api/auth/register 라우트 등록 (public)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 15:11:34 +09:00
17983ad775 feat: 유저 관리 API 추가 (목록 조회, 권한 변경, 삭제)
- GET /api/users - 전체 유저 목록 (admin only)
- PATCH /api/users/:id/role - 권한 변경 (admin only)
- DELETE /api/users/:id - 유저 삭제 (admin only)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 14:52:45 +09:00
ec6ac35ac7 refactor: 모델에 JSON 태그 추가 및 gorm.Model 인라인 확장
All checks were successful
Server CI/CD / deploy (push) Successful in 35s
camelCase JSON 필드명으로 통일, PasswordHash json:"-" 처리

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 14:32:11 +09:00
633175f5be feat: 환경변수로 초기 admin 계정 자동 생성
서버 시작 시 ADMIN_USERNAME, ADMIN_PASSWORD 환경변수 기반으로
admin 계정이 없을 경우 자동 생성 (이미 있으면 스킵)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 14:28:33 +09:00
bf17d4d1da fix: username 컬럼 타입을 varchar(100)으로 명시
All checks were successful
Server CI/CD / deploy (push) Successful in 38s
longtext 타입은 MySQL에서 uniqueIndex를 걸 수 없어
AutoMigrate 실패 및 announcements 테이블 미생성 문제 해결

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 14:24:37 +09:00
3345549051 Chore: project init 2026-02-24 13:18:43 +09:00