refactor: narrow auth service to smaller units

Easier for testing, and omits need for full dep injection for pusher service, where we passed in nil for deps dangerously.
This commit is contained in:
Arjun Patel
2026-04-27 16:14:37 -07:00
parent 48d6d5cb07
commit 0f73d685c2
4 changed files with 60 additions and 26 deletions
+2 -2
View File
@@ -18,12 +18,12 @@ type Server struct {
ctx context.Context // server-scoped context for graceful shutdown
hub *Hub
bridge *RedisBridge
authSvc auth.AuthService
authSvc auth.SessionReader
}
// NewServer creates a new pusher server. The ctx controls the lifetime of all
// WebSocket connections — when cancelled, all connections are closed gracefully.
func NewServer(ctx context.Context, hub *Hub, bridge *RedisBridge, authSvc auth.AuthService) *Server {
func NewServer(ctx context.Context, hub *Hub, bridge *RedisBridge, authSvc auth.SessionReader) *Server {
return &Server{
ctx: ctx,
hub: hub,