summaryrefslogtreecommitdiff
path: root/internal/service
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-09 22:15:33 +0300
committerPaul Buetow <paul@buetow.org>2026-05-09 22:15:33 +0300
commitadec17e01da2539d1b1826148e77993d5e3271b5 (patch)
treece0ed20e695e4cea7eb41928919a1ff713f4426e /internal/service
parentd4d79e17433858d27846774274e38d907621b184 (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.go4
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,