From a9323a6a343f5ce6461a2e5bd570fe06465f1b15 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 8 Aug 2022 16:04:05 +0100 Subject: [PATCH] Use paths as metric names --- appservice/inthttp/server.go | 4 +- federationapi/inthttp/server.go | 48 +++++++++++---------- keyserver/inthttp/server.go | 20 ++++----- roomserver/inthttp/server.go | 76 ++++++++++++++++----------------- userapi/inthttp/server.go | 68 ++++++++++++++--------------- 5 files changed, 109 insertions(+), 107 deletions(-) diff --git a/appservice/inthttp/server.go b/appservice/inthttp/server.go index 01d9f9895..bdd0afd7b 100644 --- a/appservice/inthttp/server.go +++ b/appservice/inthttp/server.go @@ -10,11 +10,11 @@ import ( func AddRoutes(a api.AppServiceInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( AppServiceRoomAliasExistsPath, - httputil.MakeInternalRPCAPI("AppserviceRoomAliasExists", a.RoomAliasExists), + httputil.MakeInternalRPCAPI(AppServiceRoomAliasExistsPath, a.RoomAliasExists), ) internalAPIMux.Handle( AppServiceUserIDExistsPath, - httputil.MakeInternalRPCAPI("AppserviceUserIDExists", a.UserIDExists), + httputil.MakeInternalRPCAPI(AppServiceUserIDExistsPath, a.UserIDExists), ) } diff --git a/federationapi/inthttp/server.go b/federationapi/inthttp/server.go index 3cbd48f39..7ebb19d9e 100644 --- a/federationapi/inthttp/server.go +++ b/federationapi/inthttp/server.go @@ -17,33 +17,33 @@ import ( func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIQueryJoinedHostServerNamesInRoomPath, - httputil.MakeInternalRPCAPI("QueryJoinedHostServerNamesInRoom", intAPI.QueryJoinedHostServerNamesInRoom), + httputil.MakeInternalRPCAPI(FederationAPIQueryJoinedHostServerNamesInRoomPath, intAPI.QueryJoinedHostServerNamesInRoom), ) internalAPIMux.Handle( FederationAPIPerformInviteRequestPath, - httputil.MakeInternalRPCAPI("PerformInvite", intAPI.PerformInvite), + httputil.MakeInternalRPCAPI(FederationAPIPerformInviteRequestPath, intAPI.PerformInvite), ) internalAPIMux.Handle( FederationAPIPerformLeaveRequestPath, - httputil.MakeInternalRPCAPI("PerformLeave", intAPI.PerformLeave), + httputil.MakeInternalRPCAPI(FederationAPIPerformLeaveRequestPath, intAPI.PerformLeave), ) internalAPIMux.Handle( FederationAPIPerformDirectoryLookupRequestPath, - httputil.MakeInternalRPCAPI("PerformDirectoryLookupRequest", intAPI.PerformDirectoryLookup), + httputil.MakeInternalRPCAPI(FederationAPIPerformDirectoryLookupRequestPath, intAPI.PerformDirectoryLookup), ) internalAPIMux.Handle( FederationAPIPerformBroadcastEDUPath, - httputil.MakeInternalRPCAPI("PerformBroadcastEDU", intAPI.PerformBroadcastEDU), + httputil.MakeInternalRPCAPI(FederationAPIPerformBroadcastEDUPath, intAPI.PerformBroadcastEDU), ) internalAPIMux.Handle( FederationAPIPerformJoinRequestPath, httputil.MakeInternalRPCAPI( - "PerformJoinRequest", + FederationAPIPerformJoinRequestPath, func(ctx context.Context, req *api.PerformJoinRequest, res *api.PerformJoinResponse) error { intAPI.PerformJoin(ctx, req, res) return nil @@ -54,7 +54,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIPerformJoinRequestPath, httputil.MakeInternalProxyAPI( - "GetUserDevices", + FederationAPIPerformJoinRequestPath, func(ctx context.Context, req *getUserDevices) (*gomatrixserverlib.RespUserDevices, error) { res, err := intAPI.GetUserDevices(ctx, req.S, req.UserID) return &res, federationClientError(err) @@ -65,7 +65,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIClaimKeysPath, httputil.MakeInternalProxyAPI( - "ClaimKeys", + FederationAPIClaimKeysPath, func(ctx context.Context, req *claimKeys) (*gomatrixserverlib.RespClaimKeys, error) { res, err := intAPI.ClaimKeys(ctx, req.S, req.OneTimeKeys) return &res, federationClientError(err) @@ -76,7 +76,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIQueryKeysPath, httputil.MakeInternalProxyAPI( - "QueryKeys", + FederationAPIQueryKeysPath, func(ctx context.Context, req *queryKeys) (*gomatrixserverlib.RespQueryKeys, error) { res, err := intAPI.QueryKeys(ctx, req.S, req.Keys) return &res, federationClientError(err) @@ -87,7 +87,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIBackfillPath, httputil.MakeInternalProxyAPI( - "Backfill", + FederationAPIBackfillPath, func(ctx context.Context, req *backfill) (*gomatrixserverlib.Transaction, error) { res, err := intAPI.Backfill(ctx, req.S, req.RoomID, req.Limit, req.EventIDs) return &res, federationClientError(err) @@ -98,7 +98,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPILookupStatePath, httputil.MakeInternalProxyAPI( - "LookupState", + FederationAPILookupStatePath, func(ctx context.Context, req *lookupState) (*gomatrixserverlib.RespState, error) { res, err := intAPI.LookupState(ctx, req.S, req.RoomID, req.EventID, req.RoomVersion) return &res, federationClientError(err) @@ -109,7 +109,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPILookupStateIDsPath, httputil.MakeInternalProxyAPI( - "LookupStateIDs", + FederationAPILookupStateIDsPath, func(ctx context.Context, req *lookupStateIDs) (*gomatrixserverlib.RespStateIDs, error) { res, err := intAPI.LookupStateIDs(ctx, req.S, req.RoomID, req.EventID) return &res, federationClientError(err) @@ -120,7 +120,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPILookupMissingEventsPath, httputil.MakeInternalProxyAPI( - "LookupMissingEvents", + FederationAPILookupMissingEventsPath, func(ctx context.Context, req *lookupMissingEvents) (*gomatrixserverlib.RespMissingEvents, error) { res, err := intAPI.LookupMissingEvents(ctx, req.S, req.RoomID, req.Missing, req.RoomVersion) return &res, federationClientError(err) @@ -131,7 +131,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIGetEventPath, httputil.MakeInternalProxyAPI( - "GetEvent", + FederationAPIGetEventPath, func(ctx context.Context, req *getEvent) (*gomatrixserverlib.Transaction, error) { res, err := intAPI.GetEvent(ctx, req.S, req.EventID) return &res, federationClientError(err) @@ -142,7 +142,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIGetEventAuthPath, httputil.MakeInternalProxyAPI( - "GetEventAuth", + FederationAPIGetEventAuthPath, func(ctx context.Context, req *getEventAuth) (*gomatrixserverlib.RespEventAuth, error) { res, err := intAPI.GetEventAuth(ctx, req.S, req.RoomVersion, req.RoomID, req.EventID) return &res, federationClientError(err) @@ -152,13 +152,13 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIQueryServerKeysPath, - httputil.MakeInternalRPCAPI("QueryServerKeys", intAPI.QueryServerKeys), + httputil.MakeInternalRPCAPI(FederationAPIQueryServerKeysPath, intAPI.QueryServerKeys), ) internalAPIMux.Handle( FederationAPILookupServerKeysPath, httputil.MakeInternalProxyAPI( - "LookupServerKeys", + FederationAPILookupServerKeysPath, func(ctx context.Context, req *lookupServerKeys) (*[]gomatrixserverlib.ServerKeys, error) { res, err := intAPI.LookupServerKeys(ctx, req.S, req.KeyRequests) return &res, federationClientError(err) @@ -169,7 +169,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPIEventRelationshipsPath, httputil.MakeInternalProxyAPI( - "MSC2836EventRelationships", + FederationAPIEventRelationshipsPath, func(ctx context.Context, req *eventRelationships) (*gomatrixserverlib.MSC2836EventRelationshipsResponse, error) { res, err := intAPI.MSC2836EventRelationships(ctx, req.S, req.Req, req.RoomVer) return &res, federationClientError(err) @@ -180,7 +180,7 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( FederationAPISpacesSummaryPath, httputil.MakeInternalProxyAPI( - "MSC2946SpacesSummary", + FederationAPISpacesSummaryPath, func(ctx context.Context, req *spacesReq) (*gomatrixserverlib.MSC2946SpacesResponse, error) { res, err := intAPI.MSC2946Spaces(ctx, req.S, req.RoomID, req.SuggestedOnly) return &res, federationClientError(err) @@ -189,8 +189,9 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { ) // TODO: Look at this shape - internalAPIMux.Handle(FederationAPIQueryPublicKeyPath, - httputil.MakeInternalAPI("queryPublicKeys", func(req *http.Request) util.JSONResponse { + internalAPIMux.Handle( + FederationAPIQueryPublicKeyPath, + httputil.MakeInternalAPI(FederationAPIQueryPublicKeyPath, func(req *http.Request) util.JSONResponse { request := api.QueryPublicKeysRequest{} response := api.QueryPublicKeysResponse{} if err := json.NewDecoder(req.Body).Decode(&request); err != nil { @@ -206,8 +207,9 @@ func AddRoutes(intAPI api.FederationInternalAPI, internalAPIMux *mux.Router) { ) // TODO: Look at this shape - internalAPIMux.Handle(FederationAPIInputPublicKeyPath, - httputil.MakeInternalAPI("inputPublicKeys", func(req *http.Request) util.JSONResponse { + internalAPIMux.Handle( + FederationAPIInputPublicKeyPath, + httputil.MakeInternalAPI(FederationAPIInputPublicKeyPath, func(req *http.Request) util.JSONResponse { request := api.InputPublicKeysRequest{} response := api.InputPublicKeysResponse{} if err := json.NewDecoder(req.Body).Decode(&request); err != nil { diff --git a/keyserver/inthttp/server.go b/keyserver/inthttp/server.go index 4c5965b2d..d6028a180 100644 --- a/keyserver/inthttp/server.go +++ b/keyserver/inthttp/server.go @@ -23,51 +23,51 @@ import ( func AddRoutes(internalAPIMux *mux.Router, s api.KeyInternalAPI) { internalAPIMux.Handle( PerformClaimKeysPath, - httputil.MakeInternalRPCAPI("PerformClaimKeys", s.PerformClaimKeys), + httputil.MakeInternalRPCAPI(PerformClaimKeysPath, s.PerformClaimKeys), ) internalAPIMux.Handle( PerformClaimKeysPath, - httputil.MakeInternalRPCAPI("PerformDeleteKeys", s.PerformDeleteKeys), + httputil.MakeInternalRPCAPI(PerformClaimKeysPath, s.PerformDeleteKeys), ) internalAPIMux.Handle( PerformUploadKeysPath, - httputil.MakeInternalRPCAPI("PerformUploadKeys", s.PerformUploadKeys), + httputil.MakeInternalRPCAPI(PerformUploadKeysPath, s.PerformUploadKeys), ) internalAPIMux.Handle( PerformUploadDeviceKeysPath, - httputil.MakeInternalRPCAPI("PerformUploadDeviceKeys", s.PerformUploadDeviceKeys), + httputil.MakeInternalRPCAPI(PerformUploadDeviceKeysPath, s.PerformUploadDeviceKeys), ) internalAPIMux.Handle( PerformUploadDeviceSignaturesPath, - httputil.MakeInternalRPCAPI("PerformUploadDeviceSignatures", s.PerformUploadDeviceSignatures), + httputil.MakeInternalRPCAPI(PerformUploadDeviceSignaturesPath, s.PerformUploadDeviceSignatures), ) internalAPIMux.Handle( QueryKeysPath, - httputil.MakeInternalRPCAPI("QueryKeys", s.QueryKeys), + httputil.MakeInternalRPCAPI(QueryKeysPath, s.QueryKeys), ) internalAPIMux.Handle( QueryOneTimeKeysPath, - httputil.MakeInternalRPCAPI("QueryOneTimeKeys", s.QueryOneTimeKeys), + httputil.MakeInternalRPCAPI(QueryOneTimeKeysPath, s.QueryOneTimeKeys), ) internalAPIMux.Handle( QueryDeviceMessagesPath, - httputil.MakeInternalRPCAPI("QueryDeviceMessages", s.QueryDeviceMessages), + httputil.MakeInternalRPCAPI(QueryDeviceMessagesPath, s.QueryDeviceMessages), ) internalAPIMux.Handle( QueryKeyChangesPath, - httputil.MakeInternalRPCAPI("queryKeyChanges", s.QueryKeyChanges), + httputil.MakeInternalRPCAPI(QueryKeyChangesPath, s.QueryKeyChanges), ) internalAPIMux.Handle( QuerySignaturesPath, - httputil.MakeInternalRPCAPI("QuerySignatures", s.QuerySignatures), + httputil.MakeInternalRPCAPI(QuerySignaturesPath, s.QuerySignatures), ) } diff --git a/roomserver/inthttp/server.go b/roomserver/inthttp/server.go index f3846c956..432ccd881 100644 --- a/roomserver/inthttp/server.go +++ b/roomserver/inthttp/server.go @@ -11,191 +11,191 @@ import ( func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) { internalAPIMux.Handle( RoomserverInputRoomEventsPath, - httputil.MakeInternalRPCAPI("InputRoomEvents", r.InputRoomEvents), + httputil.MakeInternalRPCAPI(RoomserverInputRoomEventsPath, r.InputRoomEvents), ) internalAPIMux.Handle( RoomserverPerformInvitePath, - httputil.MakeInternalRPCAPI("PerformInvite", r.PerformInvite), + httputil.MakeInternalRPCAPI(RoomserverPerformInvitePath, r.PerformInvite), ) internalAPIMux.Handle( RoomserverPerformJoinPath, - httputil.MakeInternalRPCAPI("PerformJoin", r.PerformJoin), + httputil.MakeInternalRPCAPI(RoomserverPerformJoinPath, r.PerformJoin), ) internalAPIMux.Handle( RoomserverPerformLeavePath, - httputil.MakeInternalRPCAPI("PerformLeave", r.PerformLeave), + httputil.MakeInternalRPCAPI(RoomserverPerformLeavePath, r.PerformLeave), ) internalAPIMux.Handle( RoomserverPerformPeekPath, - httputil.MakeInternalRPCAPI("PerformPeek", r.PerformPeek), + httputil.MakeInternalRPCAPI(RoomserverPerformPeekPath, r.PerformPeek), ) internalAPIMux.Handle( RoomserverPerformInboundPeekPath, - httputil.MakeInternalRPCAPI("PerformInboundPeek", r.PerformInboundPeek), + httputil.MakeInternalRPCAPI(RoomserverPerformInboundPeekPath, r.PerformInboundPeek), ) internalAPIMux.Handle( RoomserverPerformUnpeekPath, - httputil.MakeInternalRPCAPI("PerformUnpeek", r.PerformUnpeek), + httputil.MakeInternalRPCAPI(RoomserverPerformUnpeekPath, r.PerformUnpeek), ) internalAPIMux.Handle( RoomserverPerformRoomUpgradePath, - httputil.MakeInternalRPCAPI("PerformRoomUpgrade", r.PerformRoomUpgrade), + httputil.MakeInternalRPCAPI(RoomserverPerformRoomUpgradePath, r.PerformRoomUpgrade), ) internalAPIMux.Handle( RoomserverPerformPublishPath, - httputil.MakeInternalRPCAPI("PerformPublish", r.PerformPublish), + httputil.MakeInternalRPCAPI(RoomserverPerformPublishPath, r.PerformPublish), ) internalAPIMux.Handle( RoomserverPerformAdminEvacuateRoomPath, - httputil.MakeInternalRPCAPI("PerformAdminEvacuateRoom", r.PerformAdminEvacuateRoom), + httputil.MakeInternalRPCAPI(RoomserverPerformAdminEvacuateRoomPath, r.PerformAdminEvacuateRoom), ) internalAPIMux.Handle( RoomserverPerformAdminEvacuateUserPath, - httputil.MakeInternalRPCAPI("PerformAdminEvacuateUser", r.PerformAdminEvacuateUser), + httputil.MakeInternalRPCAPI(RoomserverPerformAdminEvacuateUserPath, r.PerformAdminEvacuateUser), ) internalAPIMux.Handle( RoomserverQueryPublishedRoomsPath, - httputil.MakeInternalRPCAPI("QueryPublishedRooms", r.QueryPublishedRooms), + httputil.MakeInternalRPCAPI(RoomserverQueryPublishedRoomsPath, r.QueryPublishedRooms), ) internalAPIMux.Handle( RoomserverQueryLatestEventsAndStatePath, - httputil.MakeInternalRPCAPI("QueryLatestEventsAndState", r.QueryLatestEventsAndState), + httputil.MakeInternalRPCAPI(RoomserverQueryLatestEventsAndStatePath, r.QueryLatestEventsAndState), ) internalAPIMux.Handle( RoomserverQueryStateAfterEventsPath, - httputil.MakeInternalRPCAPI("QueryStateAfterEvents", r.QueryStateAfterEvents), + httputil.MakeInternalRPCAPI(RoomserverQueryStateAfterEventsPath, r.QueryStateAfterEvents), ) internalAPIMux.Handle( RoomserverQueryEventsByIDPath, - httputil.MakeInternalRPCAPI("QueryEventsByID", r.QueryEventsByID), + httputil.MakeInternalRPCAPI(RoomserverQueryEventsByIDPath, r.QueryEventsByID), ) internalAPIMux.Handle( RoomserverQueryMembershipForUserPath, - httputil.MakeInternalRPCAPI("QueryMembershipForUser", r.QueryMembershipForUser), + httputil.MakeInternalRPCAPI(RoomserverQueryMembershipForUserPath, r.QueryMembershipForUser), ) internalAPIMux.Handle( RoomserverQueryMembershipsForRoomPath, - httputil.MakeInternalRPCAPI("QueryMembershipsForRoom", r.QueryMembershipsForRoom), + httputil.MakeInternalRPCAPI(RoomserverQueryMembershipsForRoomPath, r.QueryMembershipsForRoom), ) internalAPIMux.Handle( RoomserverQueryServerJoinedToRoomPath, - httputil.MakeInternalRPCAPI("QueryServerJoinedToRoom", r.QueryServerJoinedToRoom), + httputil.MakeInternalRPCAPI(RoomserverQueryServerJoinedToRoomPath, r.QueryServerJoinedToRoom), ) internalAPIMux.Handle( RoomserverQueryServerJoinedToRoomPath, - httputil.MakeInternalRPCAPI("QueryServerJoinedToRoom", r.QueryServerJoinedToRoom), + httputil.MakeInternalRPCAPI(RoomserverQueryServerJoinedToRoomPath, r.QueryServerJoinedToRoom), ) internalAPIMux.Handle( RoomserverQueryServerAllowedToSeeEventPath, - httputil.MakeInternalRPCAPI("QueryServerAllowedToSeeEvent", r.QueryServerAllowedToSeeEvent), + httputil.MakeInternalRPCAPI(RoomserverQueryServerAllowedToSeeEventPath, r.QueryServerAllowedToSeeEvent), ) internalAPIMux.Handle( RoomserverQueryMissingEventsPath, - httputil.MakeInternalRPCAPI("QueryMissingEvents", r.QueryMissingEvents), + httputil.MakeInternalRPCAPI(RoomserverQueryMissingEventsPath, r.QueryMissingEvents), ) internalAPIMux.Handle( RoomserverQueryStateAndAuthChainPath, - httputil.MakeInternalRPCAPI("QueryStateAndAuthChain", r.QueryStateAndAuthChain), + httputil.MakeInternalRPCAPI(RoomserverQueryStateAndAuthChainPath, r.QueryStateAndAuthChain), ) internalAPIMux.Handle( RoomserverPerformBackfillPath, - httputil.MakeInternalRPCAPI("PerformBackfill", r.PerformBackfill), + httputil.MakeInternalRPCAPI(RoomserverPerformBackfillPath, r.PerformBackfill), ) internalAPIMux.Handle( RoomserverPerformForgetPath, - httputil.MakeInternalRPCAPI("PerformForget", r.PerformForget), + httputil.MakeInternalRPCAPI(RoomserverPerformForgetPath, r.PerformForget), ) internalAPIMux.Handle( RoomserverQueryRoomVersionCapabilitiesPath, - httputil.MakeInternalRPCAPI("QueryRoomVersionCapabilities", r.QueryRoomVersionCapabilities), + httputil.MakeInternalRPCAPI(RoomserverQueryRoomVersionCapabilitiesPath, r.QueryRoomVersionCapabilities), ) internalAPIMux.Handle( RoomserverQueryRoomVersionForRoomPath, - httputil.MakeInternalRPCAPI("QueryRoomVersionForRoom", r.QueryRoomVersionForRoom), + httputil.MakeInternalRPCAPI(RoomserverQueryRoomVersionForRoomPath, r.QueryRoomVersionForRoom), ) internalAPIMux.Handle( RoomserverSetRoomAliasPath, - httputil.MakeInternalRPCAPI("SetRoomAlias", r.SetRoomAlias), + httputil.MakeInternalRPCAPI(RoomserverSetRoomAliasPath, r.SetRoomAlias), ) internalAPIMux.Handle( RoomserverGetRoomIDForAliasPath, - httputil.MakeInternalRPCAPI("GetRoomIDForAlias", r.GetRoomIDForAlias), + httputil.MakeInternalRPCAPI(RoomserverGetRoomIDForAliasPath, r.GetRoomIDForAlias), ) internalAPIMux.Handle( RoomserverGetAliasesForRoomIDPath, - httputil.MakeInternalRPCAPI("GetAliasesForRoomID", r.GetAliasesForRoomID), + httputil.MakeInternalRPCAPI(RoomserverGetAliasesForRoomIDPath, r.GetAliasesForRoomID), ) internalAPIMux.Handle( RoomserverRemoveRoomAliasPath, - httputil.MakeInternalRPCAPI("RemoveRoomAlias", r.RemoveRoomAlias), + httputil.MakeInternalRPCAPI(RoomserverRemoveRoomAliasPath, r.RemoveRoomAlias), ) internalAPIMux.Handle( RoomserverQueryCurrentStatePath, - httputil.MakeInternalRPCAPI("QueryCurrentState", r.QueryCurrentState), + httputil.MakeInternalRPCAPI(RoomserverQueryCurrentStatePath, r.QueryCurrentState), ) internalAPIMux.Handle( RoomserverQueryRoomsForUserPath, - httputil.MakeInternalRPCAPI("QueryRoomsForUser", r.QueryRoomsForUser), + httputil.MakeInternalRPCAPI(RoomserverQueryRoomsForUserPath, r.QueryRoomsForUser), ) internalAPIMux.Handle( RoomserverQueryBulkStateContentPath, - httputil.MakeInternalRPCAPI("QueryBulkStateContent", r.QueryBulkStateContent), + httputil.MakeInternalRPCAPI(RoomserverQueryBulkStateContentPath, r.QueryBulkStateContent), ) internalAPIMux.Handle( RoomserverQuerySharedUsersPath, - httputil.MakeInternalRPCAPI("QuerySharedUsers", r.QuerySharedUsers), + httputil.MakeInternalRPCAPI(RoomserverQuerySharedUsersPath, r.QuerySharedUsers), ) internalAPIMux.Handle( RoomserverQueryKnownUsersPath, - httputil.MakeInternalRPCAPI("QueryKnownUsers", r.QueryKnownUsers), + httputil.MakeInternalRPCAPI(RoomserverQueryKnownUsersPath, r.QueryKnownUsers), ) internalAPIMux.Handle( RoomserverQueryServerBannedFromRoomPath, - httputil.MakeInternalRPCAPI("QueryServerBannedFromRoom", r.QueryServerBannedFromRoom), + httputil.MakeInternalRPCAPI(RoomserverQueryServerBannedFromRoomPath, r.QueryServerBannedFromRoom), ) internalAPIMux.Handle( RoomserverQueryAuthChainPath, - httputil.MakeInternalRPCAPI("QueryAuthChain", r.QueryAuthChain), + httputil.MakeInternalRPCAPI(RoomserverQueryAuthChainPath, r.QueryAuthChain), ) internalAPIMux.Handle( RoomserverQueryRestrictedJoinAllowed, - httputil.MakeInternalRPCAPI("QueryRestrictedJoinAllowed", r.QueryRestrictedJoinAllowed), + httputil.MakeInternalRPCAPI(RoomserverQueryRestrictedJoinAllowed, r.QueryRestrictedJoinAllowed), ) } diff --git a/userapi/inthttp/server.go b/userapi/inthttp/server.go index 5742babc1..d568bab7b 100644 --- a/userapi/inthttp/server.go +++ b/userapi/inthttp/server.go @@ -29,137 +29,137 @@ func AddRoutes(internalAPIMux *mux.Router, s api.UserInternalAPI) { internalAPIMux.Handle( PerformAccountCreationPath, - httputil.MakeInternalRPCAPI("PerformAccountCreation", s.PerformAccountCreation), + httputil.MakeInternalRPCAPI(PerformAccountCreationPath, s.PerformAccountCreation), ) internalAPIMux.Handle( PerformPasswordUpdatePath, - httputil.MakeInternalRPCAPI("PerformPasswordUpdate", s.PerformPasswordUpdate), + httputil.MakeInternalRPCAPI(PerformPasswordUpdatePath, s.PerformPasswordUpdate), ) internalAPIMux.Handle( PerformDeviceCreationPath, - httputil.MakeInternalRPCAPI("PerformDeviceCreation", s.PerformDeviceCreation), + httputil.MakeInternalRPCAPI(PerformDeviceCreationPath, s.PerformDeviceCreation), ) internalAPIMux.Handle( PerformLastSeenUpdatePath, - httputil.MakeInternalRPCAPI("PerformLastSeenUpdate", s.PerformLastSeenUpdate), + httputil.MakeInternalRPCAPI(PerformLastSeenUpdatePath, s.PerformLastSeenUpdate), ) internalAPIMux.Handle( PerformDeviceUpdatePath, - httputil.MakeInternalRPCAPI("PerformDeviceUpdate", s.PerformDeviceUpdate), + httputil.MakeInternalRPCAPI(PerformDeviceUpdatePath, s.PerformDeviceUpdate), ) internalAPIMux.Handle( PerformDeviceDeletionPath, - httputil.MakeInternalRPCAPI("PerformDeviceDeletion", s.PerformDeviceDeletion), + httputil.MakeInternalRPCAPI(PerformDeviceDeletionPath, s.PerformDeviceDeletion), ) internalAPIMux.Handle( PerformAccountDeactivationPath, - httputil.MakeInternalRPCAPI("PerformAccountDeactivation", s.PerformAccountDeactivation), + httputil.MakeInternalRPCAPI(PerformAccountDeactivationPath, s.PerformAccountDeactivation), ) internalAPIMux.Handle( PerformOpenIDTokenCreationPath, - httputil.MakeInternalRPCAPI("PerformOpenIDTokenCreation", s.PerformOpenIDTokenCreation), + httputil.MakeInternalRPCAPI(PerformOpenIDTokenCreationPath, s.PerformOpenIDTokenCreation), ) internalAPIMux.Handle( QueryProfilePath, - httputil.MakeInternalRPCAPI("QueryProfile", s.QueryProfile), + httputil.MakeInternalRPCAPI(QueryProfilePath, s.QueryProfile), ) internalAPIMux.Handle( QueryAccessTokenPath, - httputil.MakeInternalRPCAPI("QueryAccessToken", s.QueryAccessToken), + httputil.MakeInternalRPCAPI(QueryAccessTokenPath, s.QueryAccessToken), ) internalAPIMux.Handle( QueryAccessTokenPath, - httputil.MakeInternalRPCAPI("QueryAccessToken", s.QueryAccessToken), + httputil.MakeInternalRPCAPI(QueryAccessTokenPath, s.QueryAccessToken), ) internalAPIMux.Handle( QueryDevicesPath, - httputil.MakeInternalRPCAPI("QueryDevices", s.QueryDevices), + httputil.MakeInternalRPCAPI(QueryDevicesPath, s.QueryDevices), ) internalAPIMux.Handle( QueryAccountDataPath, - httputil.MakeInternalRPCAPI("QueryAccountData", s.QueryAccountData), + httputil.MakeInternalRPCAPI(QueryAccountDataPath, s.QueryAccountData), ) internalAPIMux.Handle( QueryDeviceInfosPath, - httputil.MakeInternalRPCAPI("QueryDeviceInfos", s.QueryDeviceInfos), + httputil.MakeInternalRPCAPI(QueryDeviceInfosPath, s.QueryDeviceInfos), ) internalAPIMux.Handle( QuerySearchProfilesPath, - httputil.MakeInternalRPCAPI("QuerySearchProfiles", s.QuerySearchProfiles), + httputil.MakeInternalRPCAPI(QuerySearchProfilesPath, s.QuerySearchProfiles), ) internalAPIMux.Handle( QueryOpenIDTokenPath, - httputil.MakeInternalRPCAPI("QueryOpenIDToken", s.QueryOpenIDToken), + httputil.MakeInternalRPCAPI(QueryOpenIDTokenPath, s.QueryOpenIDToken), ) internalAPIMux.Handle( InputAccountDataPath, - httputil.MakeInternalRPCAPI("InputAccountData", s.InputAccountData), + httputil.MakeInternalRPCAPI(InputAccountDataPath, s.InputAccountData), ) internalAPIMux.Handle( QueryKeyBackupPath, - httputil.MakeInternalRPCAPI("QueryKeyBackup", s.QueryKeyBackup), + httputil.MakeInternalRPCAPI(QueryKeyBackupPath, s.QueryKeyBackup), ) internalAPIMux.Handle( PerformKeyBackupPath, - httputil.MakeInternalRPCAPI("PerformKeyBackup", s.PerformKeyBackup), + httputil.MakeInternalRPCAPI(PerformKeyBackupPath, s.PerformKeyBackup), ) internalAPIMux.Handle( QueryNotificationsPath, - httputil.MakeInternalRPCAPI("QueryNotifications", s.QueryNotifications), + httputil.MakeInternalRPCAPI(QueryNotificationsPath, s.QueryNotifications), ) internalAPIMux.Handle( PerformPusherSetPath, - httputil.MakeInternalRPCAPI("PerformPusherSet", s.PerformPusherSet), + httputil.MakeInternalRPCAPI(PerformPusherSetPath, s.PerformPusherSet), ) internalAPIMux.Handle( PerformPusherDeletionPath, - httputil.MakeInternalRPCAPI("PerformPusherDeletion", s.PerformPusherDeletion), + httputil.MakeInternalRPCAPI(PerformPusherDeletionPath, s.PerformPusherDeletion), ) internalAPIMux.Handle( QueryPushersPath, - httputil.MakeInternalRPCAPI("QueryPushers", s.QueryPushers), + httputil.MakeInternalRPCAPI(QueryPushersPath, s.QueryPushers), ) internalAPIMux.Handle( PerformPushRulesPutPath, - httputil.MakeInternalRPCAPI("PerformPushRulesPut", s.PerformPushRulesPut), + httputil.MakeInternalRPCAPI(PerformPushRulesPutPath, s.PerformPushRulesPut), ) internalAPIMux.Handle( QueryPushRulesPath, - httputil.MakeInternalRPCAPI("QueryPushRules", s.QueryPushRules), + httputil.MakeInternalRPCAPI(QueryPushRulesPath, s.QueryPushRules), ) internalAPIMux.Handle( PerformSetAvatarURLPath, - httputil.MakeInternalRPCAPI("PerformSetAvatarURL", s.SetAvatarURL), + httputil.MakeInternalRPCAPI(PerformSetAvatarURLPath, s.SetAvatarURL), ) // TODO: Look at the shape of this internalAPIMux.Handle(QueryNumericLocalpartPath, - httputil.MakeInternalAPI("queryNumericLocalpart", func(req *http.Request) util.JSONResponse { + httputil.MakeInternalAPI(QueryNumericLocalpartPath, func(req *http.Request) util.JSONResponse { response := api.QueryNumericLocalpartResponse{} if err := s.QueryNumericLocalpart(req.Context(), &response); err != nil { return util.ErrorResponse(err) @@ -170,36 +170,36 @@ func AddRoutes(internalAPIMux *mux.Router, s api.UserInternalAPI) { internalAPIMux.Handle( QueryAccountAvailabilityPath, - httputil.MakeInternalRPCAPI("QueryAccountAvailability", s.QueryAccountAvailability), + httputil.MakeInternalRPCAPI(QueryAccountAvailabilityPath, s.QueryAccountAvailability), ) internalAPIMux.Handle( QueryAccountByPasswordPath, - httputil.MakeInternalRPCAPI("QueryAccountByPassword", s.QueryAccountByPassword), + httputil.MakeInternalRPCAPI(QueryAccountByPasswordPath, s.QueryAccountByPassword), ) internalAPIMux.Handle( PerformSetDisplayNamePath, - httputil.MakeInternalRPCAPI("SetDisplayName", s.SetDisplayName), + httputil.MakeInternalRPCAPI(PerformSetDisplayNamePath, s.SetDisplayName), ) internalAPIMux.Handle( QueryLocalpartForThreePIDPath, - httputil.MakeInternalRPCAPI("QueryLocalpartForThreePID", s.QueryLocalpartForThreePID), + httputil.MakeInternalRPCAPI(QueryLocalpartForThreePIDPath, s.QueryLocalpartForThreePID), ) internalAPIMux.Handle( QueryThreePIDsForLocalpartPath, - httputil.MakeInternalRPCAPI("QueryThreePIDsForLocalpart", s.QueryThreePIDsForLocalpart), + httputil.MakeInternalRPCAPI(QueryThreePIDsForLocalpartPath, s.QueryThreePIDsForLocalpart), ) internalAPIMux.Handle( PerformForgetThreePIDPath, - httputil.MakeInternalRPCAPI("PerformForgetThreePID", s.PerformForgetThreePID), + httputil.MakeInternalRPCAPI(PerformForgetThreePIDPath, s.PerformForgetThreePID), ) internalAPIMux.Handle( PerformSaveThreePIDAssociationPath, - httputil.MakeInternalRPCAPI("PerformSaveThreePIDAssociation", s.PerformSaveThreePIDAssociation), + httputil.MakeInternalRPCAPI(PerformSaveThreePIDAssociationPath, s.PerformSaveThreePIDAssociation), ) }