kjh2064
|
8ea4e20f36
|
feat(wbs): AEG-VS-01-03 Domain policy implementation
AEG-VS-01-03: Identity & Role Assignment State Machines
Implementation:
1. IdentityState.cs
- 7 states: UNDEFINED → ACTIVE → REQUIRES_MFA_SETUP → MFA_CONFIGURED → MFA_SUSPENDED → INACTIVE → REVOKED
- Immutable value object with typed transitions
- State queries (IsActive, IsMfaRequired, CanReceiveRoles)
- No infrastructure dependencies (pure domain logic)
2. RoleAssignmentState.cs
- Maker-Checker workflow: PENDING_APPROVAL → APPROVED_BY_1 → APPROVED_BY_2 → ACTIVE → EXPIRED/REVOKED/REJECTED
- Approval count constraints enforced at state level
- Immutable state transitions
3. IdentityStateTests.cs
- 9 unit tests covering all transitions
- Boundary testing (invalid transitions throw)
- State query tests
- Value object equality
Principles:
- 정공법: State machine encoded in domain, not middleware
- SOLID: Single responsibility (state transitions)
- 과유불액: Only what contract requires
- 안정성: Immutable value objects, exception-based validation
- 재현성: Pure C# logic, no DB/external dependencies
All tests PASSING (9/9)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
2026-08-17 17:37:35 +09:00 |
|