Make federationapi use userapi (#1135)

Removes dependencies on account DB, device DB and ASAPI.
This commit is contained in:
Kegsay 2020-06-16 14:53:19 +01:00 committed by GitHub
parent 45011579eb
commit 1942928ee5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 102 additions and 66 deletions

View file

@ -28,6 +28,7 @@ import (
const (
QueryProfilePath = "/userapi/queryProfile"
QueryAccessTokenPath = "/userapi/queryAccessToken"
QueryDevicesPath = "/userapi/queryDevices"
)
// NewUserAPIClient creates a UserInternalAPI implemented by talking to a HTTP POST API.
@ -73,3 +74,11 @@ func (h *httpUserInternalAPI) QueryAccessToken(
apiURL := h.apiURL + QueryAccessTokenPath
return httputil.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
}
func (h *httpUserInternalAPI) QueryDevices(ctx context.Context, req *api.QueryDevicesRequest, res *api.QueryDevicesResponse) error {
span, ctx := opentracing.StartSpanFromContext(ctx, "QueryDevices")
defer span.Finish()
apiURL := h.apiURL + QueryDevicesPath
return httputil.PostJSON(ctx, span, h.httpClient, apiURL, req, res)
}