Add RoomserverUserAPI interface

This commit is contained in:
Kegan Dougal 2022-05-05 20:20:08 +01:00
parent dc6729c8be
commit ed3cddeba3
6 changed files with 10 additions and 5 deletions

View file

@ -22,7 +22,7 @@ type RoomserverInternalAPI interface {
// interdependencies between the roomserver and other input APIs
SetFederationAPI(fsAPI fsAPI.RoomserverFederationAPI, keyRing *gomatrixserverlib.KeyRing)
SetAppserviceAPI(asAPI asAPI.AppServiceQueryAPI)
SetUserAPI(userAPI userapi.UserInternalAPI)
SetUserAPI(userAPI userapi.RoomserverUserAPI)
// QueryAuthChain returns the entire auth chain for the event IDs given.
// The response includes the events in the request.

View file

@ -27,7 +27,7 @@ func (t *RoomserverInternalAPITrace) SetAppserviceAPI(asAPI asAPI.AppServiceQuer
t.Impl.SetAppserviceAPI(asAPI)
}
func (t *RoomserverInternalAPITrace) SetUserAPI(userAPI userapi.UserInternalAPI) {
func (t *RoomserverInternalAPITrace) SetUserAPI(userAPI userapi.RoomserverUserAPI) {
t.Impl.SetUserAPI(userAPI)
}

View file

@ -177,7 +177,7 @@ func (r *RoomserverInternalAPI) SetFederationAPI(fsAPI fsAPI.RoomserverFederatio
}
}
func (r *RoomserverInternalAPI) SetUserAPI(userAPI userapi.UserInternalAPI) {
func (r *RoomserverInternalAPI) SetUserAPI(userAPI userapi.RoomserverUserAPI) {
r.Leaver.UserAPI = userAPI
}

View file

@ -38,7 +38,7 @@ type Leaver struct {
Cfg *config.RoomServer
DB storage.Database
FSAPI fsAPI.RoomserverFederationAPI
UserAPI userapi.UserInternalAPI
UserAPI userapi.RoomserverUserAPI
Inputer *input.Inputer
}

View file

@ -95,7 +95,7 @@ func (h *httpRoomserverInternalAPI) SetAppserviceAPI(asAPI asAPI.AppServiceQuery
}
// SetUserAPI no-ops in HTTP client mode as there is no chicken/egg scenario
func (h *httpRoomserverInternalAPI) SetUserAPI(userAPI userapi.UserInternalAPI) {
func (h *httpRoomserverInternalAPI) SetUserAPI(userAPI userapi.RoomserverUserAPI) {
}
// SetRoomAlias implements RoomserverAliasAPI

View file

@ -31,6 +31,7 @@ type UserInternalAPI interface {
ClientUserAPI
MediaUserAPI
FederationUserAPI
RoomserverUserAPI
QuerySearchProfilesAPI // used by p2p demos
}
@ -41,6 +42,10 @@ type AppserviceUserAPI interface {
PerformDeviceCreation(ctx context.Context, req *PerformDeviceCreationRequest, res *PerformDeviceCreationResponse) error
}
type RoomserverUserAPI interface {
QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, res *QueryAccountDataResponse) error
}
// api functions required by the media api
type MediaUserAPI interface {
QueryAcccessTokenAPI