|
|
|
|
@ -68,7 +68,7 @@ func New(deps Deps) *chi.Mux {
|
|
|
|
|
r.Post("/api/v1/payments/telegram-webhook", paymentsH.TelegramWebhook)
|
|
|
|
|
|
|
|
|
|
// Admin routes protected with HTTP Basic authentication.
|
|
|
|
|
adminH := handler.NewAdminHandler(heroStore, gearStore, questStore, deps.Engine, deps.Hub, deps.PgPool, deps.Logger)
|
|
|
|
|
adminH := handler.NewAdminHandler(heroStore, gearStore, questStore, deps.Engine, deps.Hub, deps.PgPool, deps.Logger, deps.AdminBasicAuthUsername, deps.AdminBasicAuthPassword)
|
|
|
|
|
r.Route("/admin", func(r chi.Router) {
|
|
|
|
|
r.Use(handler.BasicAuthMiddleware(handler.BasicAuthConfig{
|
|
|
|
|
Username: deps.AdminBasicAuthUsername,
|
|
|
|
|
@ -128,6 +128,8 @@ func New(deps Deps) *chi.Mux {
|
|
|
|
|
r.Get("/payments/{paymentId}", adminH.GetPayment)
|
|
|
|
|
r.Post("/payments/set-webhook", paymentsH.SetWebhook)
|
|
|
|
|
})
|
|
|
|
|
// Admin WebSocket snapshot (auth via query params in handler).
|
|
|
|
|
r.Get("/admin-ws/hero/{heroId}", adminH.AdminHeroSnapshotWS)
|
|
|
|
|
|
|
|
|
|
// API v1 (authenticated routes).
|
|
|
|
|
gameH := handler.NewGameHandler(deps.Engine, heroStore, logStore, worldSvc, deps.Logger, deps.ServerStartedAt, questStore, gearStore, achievementStore, taskStore, deps.Hub)
|
|
|
|
|
|