Auth Operation 도메인 모델
개요
Auth Operation 도메인의 상세한 도메인 모델을 정의합니다. 도메인 이벤트, 엔티티, 열거형, 값 객체, Aggregate, Domain Service, 에러 코드를 포함합니다.
1. 도메인 이벤트
AccountRegistrationRequested
- Payload:
email - 발행 시점: 회원가입 후
- 발행: OperationUser Aggregate
AccountCreated
- Payload:
userId,email - 발행 시점: 회원가입(RegisterAccount) 후
- 발행: OperationUser Aggregate
AccountCreationRejectedDueToDuplicateGroup
- Payload:
email - 발행 시점: 회원가입(RegisterAccount) 시도에 그룹 등록 실패 후
- 발행: OperationUser Aggregate
AccountCreatedViaInvitation
- Payload:
email,name,siteId - 발행 시점: 초대 회원가입(RegisterAccountViaInvitation) 후
- 발행: OperationUser Aggregate
LoginAttempted
- Payload:
email - 발행 시점: 로그인 시도(Login) 후
- 발행: OperationUserLogin Aggregate
LoginSucceeded
- Payload:
userId - 발행 시점: 로그인 시도(Login) 성공 후
- 발행: OperationUserLogin Aggregate
LoginFailed
- Payload:
email - 발행 시점: 로그인 시도(Login) 실패 후
- 발행: OperationUserLogin Aggregate
PasswordVerificationFailed
- Payload:
userId - 발행 시점: 패스워드 검증 실패 후
- 발행: OperationUserLogin Aggregate
LoginAttemptRecorded
- Payload:
userId - 발행 시점: 로그인 시도 기록(RecordLoginAttempt) 후
- 발행: OperationUserLogin Aggregate
LoginAttemptCountReset
- Payload:
userId - 발행 시점: 로그인 시도 횟수(ResetLoginAttemptCount) 초기화 후
- 발행: OperationUserLogin Aggregate
AccountLocked
- Payload:
userId - 발행 시점: 계정 잠금(LockAccount) 후
- 발행: OperationUserLogin Aggregate
AccountLockedLoginAttempted
- Payload:
userId - 발행 시점: 잠긴 계정으로 로그인을 시도 할 경우
- 발행: 회원가입 Aggregate
TokenValidated
- Payload:
userId,token - 발행 시점: 토큰 검증 후 (ValidateToken)
- 발행: Token Aggregate
TokenValidationFailed
- Payload:
token - 발행 시점: 토큰 검증 실패 후 (ValidateToken)
- 발행: Token Aggregate
AccessTokenIssued
- Payload:
userId,token - 발행 시점: 토큰 발행(IssueAccessToken) 후
- 발행: Token Aggregate
RefreshTokenIssued
- Payload:
userId,token - 발행 시점: Refresh 토큰 발행(IssueRefreshToken) 후
- 발행: Token Aggregate
TemporaryAccessTokenIssued
- Payload:
email - 발행 시점: 임시 토큰 할행 후
- 발행: Token Aggregate
SessionCreated
- Payload:
userId,sessionId - 발행 시점: 세션 생성(CreateSession) 후
- 발행: Session Aggregate
AccountSessionExpired
- Payload:
userId - 발행 시점: 세션 만료 후
- 발행: Session Aggregate
2. 엔티티 (Entities)
Operation Users
id: 식별자email: 계정 이메일name: 이름passwordHash: 비밀번호 해시값status: 상태 (UserStatus)userType: 유저 타입 (UserType)mfaEnabled: 다중인증 활성화 여부mfaSecret: 다중인증 비밀 값lastLoginAt: 마지막 로그인 일자failedLoginAttempts: 로그인 실패 횟수lockoutUntil: 잠금 시간isSuspended: 정지 여부expiresAt: 만료 시간isAnonymized: 익명화 여부anonymizedAt: 익명화 시간anonymizationId: 익명화 IDdataRetentionEndDate: 데이터 보존 종료일deletedAt: 계정 삭제일createdAt: 생성일시updatedAt: 수정일시
Operation Sessions
id: 식별자userId: Operation User IddeviceInfo: 클라이언트 장비 정보lastActivityAt: 마지막 활동 일시expiresAt: 만료일시data: 데이터createdAt: 생성일시updatedAt: 수정일시
Operation AccessTokens
id: 식별자userId: Operation User Idtoken: 토큰deviceId: device idstatus: 상태 (TokenStatus)expiresAt: 만료일시createdAt: 생성일시lastUsedAt: 마지막 사용 일시
Operation RefreshTokens
id: 식별자userId: Operation User Idtoken: 토큰deviceId: device idstatus: 상태 (TokenStatus)expiresAt: 만료일시createdAt: 생성일시revokedAt: 취소일시
3. Enums
UserStatus
ACTIVE: 활성INACTIVE: 비활성LOCKED: 잠금PENDING: 보류SUSPENDED: 정지BANNED: 접근금지
UserType
OPERATION_USER: 내부 운영자SERVICE_ACCOUNT: 서비스 계정
TokenStatus
ACTIVE: 활성REVOKED: 취소EXPIRED: 만료
4. 값 객체 (Value Objects)
Email
email: 이메일 (String)- 동등성: email 값이 같으면 같은 객체
Mfa
mfaEnabled: Multi Fact 인증 활성화 여부mfaSecret: Multi Fact Secret- 동등성:
mfaEnabled,mfaSecret모두 동일
5. Aggregates
OperationUser
Methods:
- register
- registerViaInvitation
Repository
- save(operationUser)
Events Published
- AccountRegistrationRequested
- AccountCreated
- AccountCreationRejectedDueToDuplicateGroup
- AccountCreatedViaInvitation
OperationUserLogin
Methods:
- Login
- RecordLoginAttempt
- ResetLoginAttemptCount
- LockAccount
Events Published
- LoginAttempted
- LoginSucceeded
- LoginFailed
- PasswordVerificationFailed
- LoginAttemptRecorded
- LoginAttemptCountReset
- AccountLocked
- AccountLockedLoginAttempted
Token
Methods
- Validate
- IssueAccessToken
- IssueRefreshToken
- IssueTemporaryAccessToken
Events Published
- TokenValidated
- TokenValidationFailed
- AccessTokenIssued
- RefreshTokenIssued
- TemporaryAccessTokenIssued
Session
Methods
- Create
Events Published
- SessionCreated
- AccountSessionExpired
변경 이력
| 버전 | 날짜 | 작성자 | 변경 내용 |
|---|---|---|---|
| 0.58.0 | 2025-12-16 | mook@weltcorp.com | 문서 최초 작성 |
| 0.62.0 | 2025-12-29 | jeff@weltcorp.com | Auth 범위 재정렬에 따른 도메인 모델 보강 |