From 88d6764b1c90226fab40a4a9f560b2a041850a6e Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 26 Dec 2023 19:08:15 -0700 Subject: [PATCH] wip Signed-off-by: Sumner Evans --- provisioning.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/provisioning.go b/provisioning.go index ae995c93..aff6cf22 100644 --- a/provisioning.go +++ b/provisioning.go @@ -30,8 +30,10 @@ import ( "sync" "time" + "github.com/beeper/libserv/pkg/requestlog" "github.com/gorilla/mux" "github.com/rs/zerolog" + "github.com/rs/zerolog/hlog" "maunium.net/go/mautrix/id" "go.mau.fi/mautrix-signal/pkg/signalmeow" @@ -53,10 +55,12 @@ type ProvisioningAPI struct { } func (prov *ProvisioningAPI) Init() { - prov.log.Debug().Msgf("Enabling provisioning API at %v", prov.bridge.Config.Bridge.Provisioning.Prefix) + prov.log.Debug().Str("prefix", prov.bridge.Config.Bridge.Provisioning.Prefix).Msg("Enabling provisioning API") prov.provisioningUsers = make(map[string]int) prov.provisioningMutexes = make(map[string]*sync.Mutex) r := prov.bridge.AS.Router.PathPrefix(prov.bridge.Config.Bridge.Provisioning.Prefix).Subrouter() + r.Use(hlog.NewHandler(prov.log)) + r.Use(requestlog.AccessLogger(true)) r.Use(prov.AuthMiddleware) r.HandleFunc("/v2/link/new", prov.LinkNew).Methods(http.MethodPost) r.HandleFunc("/v2/link/wait/scan", prov.LinkWaitForScan).Methods(http.MethodPost)