[datagsm] 이벤트 웹훅 누락 복구#97
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces integration with DataGSM webhook events, specifically handling the student.updated event to synchronize user information. It includes signature verification, idempotency checks using Redis, and updates to the user entity and security configurations. The review feedback highlights several important areas for improvement: addressing a potential race condition in the idempotency check by using Redis setIfAbsent, adding a null check for rawBody to prevent exceptions during signature verification, optimizing student updates to avoid N+1 queries, and enhancing integer parsing to handle decimal values formatted as strings.
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.
개요
#93에서 추가되었으나 현재develop브랜치에 누락된DataGSM이벤트 웹훅 수신 기능을 복구하였습니다.POST /api/v2/events/datagsm엔드포인트와 인증 예외 설정을 다시 반영하여DataGSM이벤트 재시도 요청이 인증 필터에서 차단되지 않도록 하였습니다.본문
DataGsmEventController를 복구하여DataGSM이벤트를 수신하고,X-DataGSM-Signature헤더 기반HmacSHA256서명을 검증하도록 하였습니다.HandleDataGsmEventServiceImpl를 복구하여student.updated이벤트 수신 시 기존User의 이름, 호실, 학년, 층, 권한 정보를 갱신하도록 하였습니다. 동일 이벤트가 중복처리되지 않도록
DataGsmEventIdempotencySupport를 통해 이벤트id를Redis에 기록하는 로직도 함께 복구하였습니다.DomainAuthorizationConfig에/api/v2/events/datagsm경로를permitAll()로 추가하여 외부DataGSM웹훅 요청이 JWT 인증 없이 컨트롤러까지 도달하도록 하였습니다. 실제 인증은 컨트롤러의 서명 검증으로 처리됩니다.
운영 설정을 위해
DataGsmEventEnvironment와THIRD_PARTY_DATAGSM_EVENT_SECRET,THIRD_PARTY_DATAGSM_EVENT_IDEMPOTENCY_TTL_DAYS설정을 복구하였습니다.검증:
./gradlew spotlessApply./gradlew test --tests "team.washer.server.v2.domain.datagsm.*"./gradlew test