diff options
author | kegsay <kegan@matrix.org> | 2022-05-05 09:56:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-05 09:56:03 +0100 |
commit | d86dcbef66dad344bc38c58762a9634ff126d5c7 (patch) | |
tree | a8c95692a64a6303e02911c9a2d6b00fec3c84c8 /keyserver | |
parent | 3c940c428d529476b6fa2cbf1ba28d53ec011584 (diff) |
syncapi: define specific interfaces for internal HTTP communications (#2416)
* syncapi: use finer-grained interfaces when making the syncapi
* Use specific interfaces for syncapi-roomserver interactions
* Define query access token api for shared http auth code
Diffstat (limited to 'keyserver')
-rw-r--r-- | keyserver/api/api.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/keyserver/api/api.go b/keyserver/api/api.go index 429617b1..ce651ba4 100644 --- a/keyserver/api/api.go +++ b/keyserver/api/api.go @@ -27,6 +27,7 @@ import ( ) type KeyInternalAPI interface { + SyncKeyAPI // SetUserAPI assigns a user API to query when extracting device names. SetUserAPI(i userapi.UserInternalAPI) // InputDeviceListUpdate from a federated server EDU @@ -38,12 +39,16 @@ type KeyInternalAPI interface { PerformUploadDeviceKeys(ctx context.Context, req *PerformUploadDeviceKeysRequest, res *PerformUploadDeviceKeysResponse) PerformUploadDeviceSignatures(ctx context.Context, req *PerformUploadDeviceSignaturesRequest, res *PerformUploadDeviceSignaturesResponse) QueryKeys(ctx context.Context, req *QueryKeysRequest, res *QueryKeysResponse) - QueryKeyChanges(ctx context.Context, req *QueryKeyChangesRequest, res *QueryKeyChangesResponse) - QueryOneTimeKeys(ctx context.Context, req *QueryOneTimeKeysRequest, res *QueryOneTimeKeysResponse) QueryDeviceMessages(ctx context.Context, req *QueryDeviceMessagesRequest, res *QueryDeviceMessagesResponse) QuerySignatures(ctx context.Context, req *QuerySignaturesRequest, res *QuerySignaturesResponse) } +// API functions required by the syncapi +type SyncKeyAPI interface { + QueryKeyChanges(ctx context.Context, req *QueryKeyChangesRequest, res *QueryKeyChangesResponse) + QueryOneTimeKeys(ctx context.Context, req *QueryOneTimeKeysRequest, res *QueryOneTimeKeysResponse) +} + // KeyError is returned if there was a problem performing/querying the server type KeyError struct { Err string `json:"error"` |