diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-09 22:15:33 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-09 22:15:33 +0300 |
| commit | adec17e01da2539d1b1826148e77993d5e3271b5 (patch) | |
| tree | ce0ed20e695e4cea7eb41928919a1ff713f4426e /internal/service | |
| parent | d4d79e17433858d27846774274e38d907621b184 (diff) | |
Extract SessionManager interface to fix DIP violation
- Introduce auth.SessionManager interface in internal/auth/interfaces.go
- Rename concrete struct to sessionManager (unexported) and have it satisfy interface
- Update api/service layers to depend on interface, not concrete type
- Add MockSessionManager for testing
- Update all call sites and tests to use interface
Diffstat (limited to 'internal/service')
| -rw-r--r-- | internal/service/auth.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/service/auth.go b/internal/service/auth.go index af3543d..b5f2720 100644 --- a/internal/service/auth.go +++ b/internal/service/auth.go @@ -15,11 +15,11 @@ type authService struct { store repository.AuthServiceStore clock clock.Clock hasher auth.Hasher - sm *auth.SessionManager + sm auth.SessionManager } // NewAuthService creates a concrete AuthService. -func NewAuthService(store repository.AuthServiceStore, clk clock.Clock, hasher auth.Hasher, sm *auth.SessionManager) AuthService { +func NewAuthService(store repository.AuthServiceStore, clk clock.Clock, hasher auth.Hasher, sm auth.SessionManager) AuthService { return &authService{ store: store, clock: clk, |
