kjh2064
|
dc8f3466c9
|
WIP: AEG-VS-01-04 Part 2 - DI setup + Endpoint refactoring (token budget constraint)
- Added IdentityAccessModule.cs with DI registration
- Added KArtSell.Modules.IdentityAccess.csproj with FastEndpoints deps
- Added project files for UnitTests & IntegrationTests
- Updated Program.cs to register IdentityAccessModule
- Updated Host.csproj to reference IdentityAccess module
- Fixed Directory.Packages.props with Moq + MS.Extensions.DependencyInjection
ISSUES (to fix next session):
- FastEndpoints Send/SendAsync/SendOkAsync method resolution incomplete
- Response record initialization requires field values
- Need to refactor endpoints to match ModelOperations pattern exactly
WORKING:
- Domain layer (IdentityState, RoleAssignmentState) ✅
- SQL repositories (Dapper) ✅
- Unit tests (RegisterIdentity, RequestMfaSetup handlers) ✅
- Integration test structure ready ✅
Next: Simplify endpoints using 'Endpoint<Req,Resp>' pattern from GetApprovalQueue sample
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
2026-08-17 17:50:25 +09:00 |
|
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 |
|