From 0f12a7e2bb487242dcccac74c0d997142350ff54 Mon Sep 17 00:00:00 2001 From: nfel Date: Sun, 30 Aug 2026 18:32:04 +0330 Subject: [PATCH] docs: complete auth persistence migration --- REFACTORING-AUDIT.md | 1 + REFACTORING-TODO.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/REFACTORING-AUDIT.md b/REFACTORING-AUDIT.md index f5adc8a..97584b4 100644 --- a/REFACTORING-AUDIT.md +++ b/REFACTORING-AUDIT.md @@ -279,6 +279,7 @@ The current composition root is `cmd/serve.go`; `repository.System` aggregates P - Added `auth/infrastructure/postgres` and `auth/infrastructure/redis` composition boundaries and switched `cmd/serve.go` to use them; the legacy adapters remain wrapped behind these boundaries pending per-repository port integration (`8ce3727`). - Added domain-port adapters for User, Identity, and Cache that translate legacy repository records at the infrastructure edge and satisfy `domain/ports`; mapping, full tests, and infrastructure vet pass in `7d9dd25`. - Added mappings and domain-port adapters for Session, Permission, Role, RolePermission, BankInfo, and OTPTemplate, completing the explicit persistence boundary coverage; full Auth tests pass in `e6e8e34`. +- Relocated the concrete PostgreSQL and Redis implementations from `repository/db/*` into `infrastructure/postgres` and `infrastructure/redis`, removed the temporary forwarding wrappers and empty unreferenced Mongo placeholder, and confirmed no runtime imports of the legacy implementation paths remain. Full tests, race tests, vet, and build pass in `1323aa4`; A003 is complete. ### `A004` — OTP application checkpoint diff --git a/REFACTORING-TODO.md b/REFACTORING-TODO.md index c2736b3..531af92 100644 --- a/REFACTORING-TODO.md +++ b/REFACTORING-TODO.md @@ -106,7 +106,7 @@ This is the authoritative execution tracker for the refactor. Work is performed |---|---|---|---| | A001 | `DONE` | Map every auth RPC to business operations and dependencies. | Method-level migration map is recorded in `REFACTORING-AUDIT.md`; completed on `2026-08-30`. | | A002 | `DONE` | Introduce auth domain entities, value objects, errors, and repository ports. | Added pure Auth entities/value objects, domain errors, and inward-facing repository/cache ports with no gRPC, GORM, Redis, or framework imports; committed as `32f182b`/`d292822`. | -| A003 | `STARTED` | Move auth persistence and Redis implementations into infrastructure. | Explicit mappings and domain-port adapters now cover users, identities, sessions, permissions, roles, role-permissions, bank information, OTP templates, and cache; legacy repository integration and ownership migration remain. | +| A003 | `DONE` | Move auth persistence and Redis implementations into infrastructure. | PostgreSQL and Redis implementations now live directly under `infrastructure`; legacy implementation packages and the unused Mongo placeholder are removed; full tests/race/vet/build pass. | | A004 | `DONE` | Extract OTP application use cases and thin gRPC adapters. | OTP primitives, persistence/provider adapters, runtime/template wiring, and thin gRPC registration adapters are in place; full Auth tests pass. | | A005 | `DONE` | Extract authentication/JWT application use cases and adapters. | Token policies, JWT verification, cached/persistent session reads, and session writes are extracted and runtime-wired while preserving access/refresh expiry semantics. | | A006 | `DONE` | Extract identity and permission use cases and adapters. | Permission policy/read paths and identity storage, validation, and external verification boundaries are extracted/runtime-wired; full tests and vet pass. | @@ -313,3 +313,4 @@ Append one row whenever a task changes status. Existing rows are never rewritten | 2026-08-30 | A006 | `STARTED` | `DONE` | Added and runtime-wired identity ownership/person-verification boundaries with real/fake provider selection preserved; full Auth tests and vet pass in `75c2e0d`. | | 2026-08-30 | A007 | `TODO` | `DONE` | Replaced the positional Auth constructor with a typed dependency graph assembled explicitly in bootstrap; full Auth tests and vet pass in `7d7871b`. | | 2026-08-30 | A008 | `TODO` | `DONE` | Removed the legacy constructor and superseded runtime fallback implementations across OTP, JWT/session, permission, and identity paths; full Auth tests/race/vet pass in `a9b11a3`. | +| 2026-08-30 | A003 | `STARTED` | `DONE` | Relocated all PostgreSQL and Redis implementation files from `repository/db` into `infrastructure`, removed wrapper indirection and the empty Mongo placeholder, and verified no legacy implementation imports remain; full tests/race/vet/build pass in `1323aa4`. |