feat: Apple Server to Server Notification API #113
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CHANGELOG
[Unreleased] - Apple Server-to-Server Notification 구현
🎯 변경 의도
Apple에서 2025년 6월 30일부터 Sign in with Apple을 사용하는 앱에서 Server-to-Server Notification 엔드포인트 구현을 필수로 요구함에 따라 (Apple 공지), 사용자 계정 상태 변경 알림을 처리하는 기능을 구현합니다.
✨ 새로운 기능
Apple Server-to-Server Notification API
POST /webhook/apple/notificationssigned_payload를 수신하여 처리application/x-www-form-urlencoded및application/json두 가지 Content-Type 지원이벤트 처리
consent-revokedaccount-deleteemail-enabledemailForwardingStatus를ENABLED로 변경 + 새 이메일 업데이트email-disabledemailForwardingStatus를DISABLED로 변경보안 기능
https://appleid.apple.com/auth/keys)를 사용하여 JWT 서명 검증📁 새로 생성된 파일
Production 코드
adaptor/in/web/controller/AppleNotificationController.java- 웹훅 컨트롤러adaptor/out/oidc/AppleNotificationValidator.java- JWT 검증 및 파싱adaptor/out/redis/AppleNotificationJtiStore.java- Redis JTI 저장소application/port/in/member/AppleNotificationUseCase.java- UseCase 인터페이스application/service/member/AppleNotificationService.java- 비즈니스 로직 서비스domain/value/type/EmailForwardingStatus.java- 이메일 포워딩 상태 Enum테스트 코드
integration_test/AppleNotificationIntegrationTest.java- 컨트롤러 통합 테스트adaptor/out/oidc/AppleNotificationValidatorTest.java- JWT 검증 단위 테스트adaptor/out/redis/AppleNotificationJtiStoreTest.java- Redis 저장소 단위 테스트service/AppleNotificationServiceTest.java- 서비스 단위 테스트config/TestMockConfig.java- 테스트 환경 Mock 설정🔧 수정된 파일
도메인/엔티티
domain/model/member/Member.javaemailForwardingStatus필드 추가updateEmailForwardingStatus()메서드 추가createMember()시 기본값ENABLED설정adaptor/out/persistence/entity/member/MemberEntity.javaemailForwardingStatus컬럼 추가 (@Builder.Default로 기본값ENABLED)adaptor/out/persistence/mapper/MemberMapper.javaemailForwardingStatus매핑 추가Security 설정
config/SecurityConfig.java-/webhook/apple/**경로permitAll()추가config/TestSecurityConfig.java- 테스트용 Security 설정에도 동일하게 추가🗃️ 데이터베이스 마이그레이션
📚 참고 문서