mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 13:52:46 +00:00
Key backups (1/2) : Add E2E session backup metadata tables (#1943)
* Initial key backup paths and userapi API * Fix unit tests * Add key backup table * Glue REST API to database * Linting * use writer on sqlite
This commit is contained in:
parent
e3679799ea
commit
32538640db
13 changed files with 712 additions and 0 deletions
|
@ -33,6 +33,8 @@ type UserInternalAPI interface {
|
|||
PerformDeviceUpdate(ctx context.Context, req *PerformDeviceUpdateRequest, res *PerformDeviceUpdateResponse) error
|
||||
PerformAccountDeactivation(ctx context.Context, req *PerformAccountDeactivationRequest, res *PerformAccountDeactivationResponse) error
|
||||
PerformOpenIDTokenCreation(ctx context.Context, req *PerformOpenIDTokenCreationRequest, res *PerformOpenIDTokenCreationResponse) error
|
||||
PerformKeyBackup(ctx context.Context, req *PerformKeyBackupRequest, res *PerformKeyBackupResponse)
|
||||
QueryKeyBackup(ctx context.Context, req *QueryKeyBackupRequest, res *QueryKeyBackupResponse)
|
||||
QueryProfile(ctx context.Context, req *QueryProfileRequest, res *QueryProfileResponse) error
|
||||
QueryAccessToken(ctx context.Context, req *QueryAccessTokenRequest, res *QueryAccessTokenResponse) error
|
||||
QueryDevices(ctx context.Context, req *QueryDevicesRequest, res *QueryDevicesResponse) error
|
||||
|
@ -42,6 +44,37 @@ type UserInternalAPI interface {
|
|||
QueryOpenIDToken(ctx context.Context, req *QueryOpenIDTokenRequest, res *QueryOpenIDTokenResponse) error
|
||||
}
|
||||
|
||||
type PerformKeyBackupRequest struct {
|
||||
UserID string
|
||||
Version string // optional if modifying a key backup
|
||||
AuthData json.RawMessage
|
||||
Algorithm string
|
||||
DeleteBackup bool // if true will delete the backup based on 'Version'.
|
||||
}
|
||||
|
||||
type PerformKeyBackupResponse struct {
|
||||
Error string // set if there was a problem performing the request
|
||||
BadInput bool // if set, the Error was due to bad input (HTTP 400)
|
||||
Exists bool // set to true if the Version exists
|
||||
Version string
|
||||
}
|
||||
|
||||
type QueryKeyBackupRequest struct {
|
||||
UserID string
|
||||
Version string // the version to query, if blank it means the latest
|
||||
}
|
||||
|
||||
type QueryKeyBackupResponse struct {
|
||||
Error string
|
||||
Exists bool
|
||||
|
||||
Algorithm string `json:"algorithm"`
|
||||
AuthData json.RawMessage `json:"auth_data"`
|
||||
Count int `json:"count"`
|
||||
ETag string `json:"etag"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
// InputAccountDataRequest is the request for InputAccountData
|
||||
type InputAccountDataRequest struct {
|
||||
UserID string // required: the user to set account data for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue