본문으로 건너뛰기

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: 익명화 ID
  • dataRetentionEndDate: 데이터 보존 종료일
  • deletedAt: 계정 삭제일
  • createdAt: 생성일시
  • updatedAt: 수정일시

Operation Sessions

  • id: 식별자
  • userId: Operation User Id
  • deviceInfo: 클라이언트 장비 정보
  • lastActivityAt: 마지막 활동 일시
  • expiresAt: 만료일시
  • data: 데이터
  • createdAt: 생성일시
  • updatedAt: 수정일시

Operation AccessTokens

  • id: 식별자
  • userId: Operation User Id
  • token: 토큰
  • deviceId: device id
  • status: 상태 (TokenStatus)
  • expiresAt: 만료일시
  • createdAt: 생성일시
  • lastUsedAt: 마지막 사용 일시

Operation RefreshTokens

  • id: 식별자
  • userId: Operation User Id
  • token: 토큰
  • deviceId: device id
  • status: 상태 (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.02025-12-16mook@weltcorp.com문서 최초 작성
0.62.02025-12-29jeff@weltcorp.comAuth 범위 재정렬에 따른 도메인 모델 보강