tenseleyflow/shithub / 8bbbb65

Browse files

web/auth_wiring: pass BaseURL + apilimit config into api.Deps

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
8bbbb65f5e4cf19b120d51e7b4d7fda4754f8dbc
Parents
8f8c84e
Tree
d2aed2b

1 changed file

StatusFile+-
M internal/web/auth_wiring.go 7 0
internal/web/auth_wiring.gomodified
@@ -28,6 +28,7 @@ import (
2828
 	"github.com/tenseleyFlow/shithub/internal/ratelimit"
2929
 	usersdb "github.com/tenseleyFlow/shithub/internal/users/sqlc"
3030
 	apih "github.com/tenseleyFlow/shithub/internal/web/handlers/api"
31
+	"github.com/tenseleyFlow/shithub/internal/web/handlers/api/apilimit"
3132
 	authh "github.com/tenseleyFlow/shithub/internal/web/handlers/auth"
3233
 	"github.com/tenseleyFlow/shithub/internal/web/middleware"
3334
 	"github.com/tenseleyFlow/shithub/internal/web/render"
@@ -68,6 +69,12 @@ func buildAPIHandlers(
6869
 		RunnerJWT:   runnerJWT,
6970
 		SecretBox:   secretBox,
7071
 		RateLimiter: rateLimiter,
72
+		BaseURL:     cfg.Auth.BaseURL,
73
+		APILimit: apilimit.Config{
74
+			AuthedPerHour: cfg.RateLimit.API.AuthedPerHour,
75
+			AnonPerHour:   cfg.RateLimit.API.AnonPerHour,
76
+			Logger:        logger,
77
+		},
7178
 	})
7279
 }
7380