aboutsummaryrefslogtreecommitdiff
path: root/keyserver/api/api.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-08-03 12:29:58 +0100
committerGitHub <noreply@github.com>2020-08-03 12:29:58 +0100
commitffcb6d2ea199cfa985e72ffbdcb884fb9bc9f54d (patch)
tree6d25818803444fead9ab18db15e88e30be6641c6 /keyserver/api/api.go
parentb5cb1d153458ad83abdfbebed7405dd9da159cb8 (diff)
Produce OTK counts in /sync response (#1235)
* Add QueryOneTimeKeys for /sync extensions * Unbreak tests * Produce OTK counts in /sync response * Linting
Diffstat (limited to 'keyserver/api/api.go')
-rw-r--r--keyserver/api/api.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/keyserver/api/api.go b/keyserver/api/api.go
index 6795498f..eb2f9e24 100644
--- a/keyserver/api/api.go
+++ b/keyserver/api/api.go
@@ -31,6 +31,7 @@ type KeyInternalAPI interface {
PerformClaimKeys(ctx context.Context, req *PerformClaimKeysRequest, res *PerformClaimKeysResponse)
QueryKeys(ctx context.Context, req *QueryKeysRequest, res *QueryKeysResponse)
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
@@ -157,3 +158,16 @@ type QueryKeyChangesResponse struct {
// Set if there was a problem handling the request.
Error *KeyError
}
+
+type QueryOneTimeKeysRequest struct {
+ // The local user to query OTK counts for
+ UserID string
+ // The device to query OTK counts for
+ DeviceID string
+}
+
+type QueryOneTimeKeysResponse struct {
+ // OTK key counts, in the extended /sync form described by https://matrix.org/docs/spec/client_server/r0.6.1#id84
+ Count OneTimeKeysCount
+ Error *KeyError
+}