mirror of
https://github.com/cloudflare/redoctober.git
synced 2026-01-07 14:05:47 +00:00
Add CLI support for restore endpoint.
+ Add the relevant parts to the command line tool and the client package. + Small improvements to cryptor's restore function: + Don't try to restore if the store is already active. + Flush the persistence key cache once the restoration occurs. + The redoctober program now explicitly mentions that a config file is invalid when that's the case.
This commit is contained in:
@@ -387,3 +387,20 @@ func (c *RemoteServer) Status(req core.StatusRequest) (*core.ResponseData, error
|
||||
|
||||
return unmarshalResponseData(respBytes)
|
||||
}
|
||||
|
||||
// Restore issues a restore request to the server. Note that a restore
|
||||
// request is the same as a delegation request, except that the user
|
||||
// and label lists are ignored.
|
||||
func (c *RemoteServer) Restore(req core.DelegateRequest) (*core.ResponseData, error) {
|
||||
reqBytes, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
respBytes, err := c.doAction("restore", reqBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return unmarshalResponseData(respBytes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user