From 9980ef544ddba34be25443831475ec367085bc47 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 21 May 2019 19:13:06 +0100 Subject: [PATCH] Bring code up to date so that it passes lint --- clientapi/routing/routing.go | 6 +++++- cmd/create-room-events/main.go | 2 +- mediaapi/routing/routing.go | 6 +++++- publicroomsapi/routing/routing.go | 6 +++++- syncapi/routing/routing.go | 6 +++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 1d95ffe72..7d056a3af 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -77,7 +77,11 @@ func Setup( v1mux := apiMux.PathPrefix(pathPrefixV1).Subrouter() unstableMux := apiMux.PathPrefix(pathPrefixUnstable).Subrouter() - authData := auth.Data{accountDB, deviceDB, cfg.Derived.ApplicationServices} + authData := auth.Data{ + AccountDB: accountDB, + DeviceDB: deviceDB, + AppServices: cfg.Derived.ApplicationServices, + } r0mux.Handle("/createRoom", common.MakeAuthAPI("createRoom", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { diff --git a/cmd/create-room-events/main.go b/cmd/create-room-events/main.go index 2992cba9d..1d05b2a12 100644 --- a/cmd/create-room-events/main.go +++ b/cmd/create-room-events/main.go @@ -139,6 +139,6 @@ func writeEvent(event gomatrixserverlib.Event) { panic(err) } } else { - panic(fmt.Errorf("Format %q is not valid, must be %q or %q", format, "InputRoomEvent", "Event")) + panic(fmt.Errorf("Format %q is not valid, must be %q or %q", *format, "InputRoomEvent", "Event")) } } diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go index 253be7751..60698ab22 100644 --- a/mediaapi/routing/routing.go +++ b/mediaapi/routing/routing.go @@ -46,7 +46,11 @@ func Setup( activeThumbnailGeneration := &types.ActiveThumbnailGeneration{ PathToResult: map[string]*types.ThumbnailGenerationResult{}, } - authData := auth.Data{nil, deviceDB, nil} + authData := auth.Data{ + AccountDB: nil, + DeviceDB: deviceDB, + AppServices: nil, + } // TODO: Add AS support r0mux.Handle("/upload", common.MakeAuthAPI( diff --git a/publicroomsapi/routing/routing.go b/publicroomsapi/routing/routing.go index 804f8cce6..5d2b58063 100644 --- a/publicroomsapi/routing/routing.go +++ b/publicroomsapi/routing/routing.go @@ -33,7 +33,11 @@ const pathPrefixR0 = "/_matrix/client/r0" func Setup(apiMux *mux.Router, deviceDB *devices.Database, publicRoomsDB *storage.PublicRoomsServerDatabase) { r0mux := apiMux.PathPrefix(pathPrefixR0).Subrouter() - authData := auth.Data{nil, deviceDB, nil} + authData := auth.Data{ + AccountDB: nil, + DeviceDB: deviceDB, + AppServices: nil, + } r0mux.Handle("/directory/list/room/{roomID}", common.MakeExternalAPI("directory_list", func(req *http.Request) util.JSONResponse { diff --git a/syncapi/routing/routing.go b/syncapi/routing/routing.go index 0671eca8e..30e1b3ea6 100644 --- a/syncapi/routing/routing.go +++ b/syncapi/routing/routing.go @@ -33,7 +33,11 @@ const pathPrefixR0 = "/_matrix/client/r0" func Setup(apiMux *mux.Router, srp *sync.RequestPool, syncDB *storage.SyncServerDatabase, deviceDB *devices.Database) { r0mux := apiMux.PathPrefix(pathPrefixR0).Subrouter() - authData := auth.Data{nil, deviceDB, nil} + authData := auth.Data{ + AccountDB: nil, + DeviceDB: deviceDB, + AppServices: nil, + } // TODO: Add AS support for all handlers below. r0mux.Handle("/sync", common.MakeAuthAPI("sync", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse {