feat: 결제/구독 도메인 모델 및 OAuth2 리소스 서버 구축#4
Merged
DongHyeonka merged 1 commit intoSynapsesa:developfrom Jun 23, 2025
Merged
Conversation
결제 서비스의 핵심 기능인 구독과 주문을 관리하기 위한 도메인 모델(`Subscription`, `Order`)과 관련 Repository를 구축합니다. 또한, 서비스의 내부 API를 안전하게 보호하기 위해 Spring Security를 사용하여 OAuth2 리소스 서버를 구성하고, `api.internal` 및 `account:read` 스코프를 가진 클라이언트만 접근할 수 있도록 인가 규칙을 설정합니다. 주요 변경 사항: - **도메인 모델:** `Subscription`, `Order` 엔티티 및 관련 `enum`(`PaymentStatus`, `SubscriptionStatus`, `SubscriptionTier`) 정의 - **JPA 설정:** `BaseEntity`를 통한 공통 필드 상속 및 `JpaAuditingConfig` 활성화 - **보안 설정:** `ResourceServerConfig`를 통한 OAuth2 리소스 서버 구성 및 스코프 기반 접근 제어 구현
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📌 관련 이슈
✨ PR 작업 내용
이번 PR은 결제 서비스의 핵심 기반을 마련하는 작업으로, 도메인 모델링과 API 보안 설정이라는 두 가지 큰 축으로 구성되어 있습니다.
도메인 모델 구축:
Subscription엔티티와 결제/주문 내역을 기록하는Order엔티티를 구현했습니다.enum으로 명확하게 정의하여 관리의 용이성과 타입 안정성을 높였습니다.OAuth2 리소스 서버 보안 설정:
ResourceServerConfig를 통해 서비스의/api/internal/**엔드포인트를 보호하도록 구성했습니다.api.internal및account:read스코프를 모두 요구하도록 설정하여, 인가된 클라이언트만 내부 API를 호출할 수 있도록 제한합니다.통합 테스트 및 환경 분리:
ResourceServerIntegrationTest를 작성했습니다.@ActiveProfiles("test")와application-test.yml을 통해 실제 DB나 외부 인증 서버 없이도 테스트가 가능하도록 H2 DB 및 Mock OAuth2 서버 환경을 구축했습니다.이미지 첨부
다음 할 일