tenseleyflow/shithub / 5be109c

Browse files

S35: wire ratelimit.Limiter into auth Deps

Authored by espadonne
SHA
5be109c456c3c730bcfd5a99e31bf9839492087c
Parents
337355f
Tree
3b64d2f

1 changed file

StatusFile+-
M internal/web/auth_wiring.go 2 0
internal/web/auth_wiring.gomodified
@@ -22,6 +22,7 @@ import (
22
 	"github.com/tenseleyFlow/shithub/internal/auth/throttle"
22
 	"github.com/tenseleyFlow/shithub/internal/auth/throttle"
23
 	"github.com/tenseleyFlow/shithub/internal/infra/config"
23
 	"github.com/tenseleyFlow/shithub/internal/infra/config"
24
 	"github.com/tenseleyFlow/shithub/internal/infra/storage"
24
 	"github.com/tenseleyFlow/shithub/internal/infra/storage"
25
+	"github.com/tenseleyFlow/shithub/internal/ratelimit"
25
 	usersdb "github.com/tenseleyFlow/shithub/internal/users/sqlc"
26
 	usersdb "github.com/tenseleyFlow/shithub/internal/users/sqlc"
26
 	apih "github.com/tenseleyFlow/shithub/internal/web/handlers/api"
27
 	apih "github.com/tenseleyFlow/shithub/internal/web/handlers/api"
27
 	authh "github.com/tenseleyFlow/shithub/internal/web/handlers/auth"
28
 	authh "github.com/tenseleyFlow/shithub/internal/web/handlers/auth"
@@ -112,6 +113,7 @@ func buildAuthHandlers(
112
 			KeyLen:  32,
113
 			KeyLen:  32,
113
 		},
114
 		},
114
 		Limiter:                  throttle.NewLimiter(),
115
 		Limiter:                  throttle.NewLimiter(),
116
+		RateLimiter:              ratelimit.New(pool),
115
 		RequireEmailVerification: cfg.Auth.RequireEmailVerification,
117
 		RequireEmailVerification: cfg.Auth.RequireEmailVerification,
116
 		SecretBox:                box,
118
 		SecretBox:                box,
117
 		Audit:                    audit.NewRecorder(),
119
 		Audit:                    audit.NewRecorder(),