mirror of
https://github.com/cloudflare/redoctober.git
synced 2026-09-06 08:07:00 +00:00
Add a status endpoint to the server.
This pull request adds a status endpoint to the Red October server; as of this pull request, the status endpoint only returns the current delegation persistence state. The HTTP UI has not been updated, as this is scoped out for a future request; however, the CLI utility now features a status command to fetch this information.
This commit is contained in:
@@ -43,6 +43,7 @@ var commandSet = map[string]command{
|
||||
"re-encrypt": command{Run: runReEncrypt, Desc: "re-encrypt a file"},
|
||||
"order": command{Run: runOrder, Desc: "place an order for delegations"},
|
||||
"owners": command{Run: runOwner, Desc: "show owners list"},
|
||||
"status": command{Run: runStatus, Desc: "show Red October persistent delegation state"},
|
||||
}
|
||||
|
||||
func registerFlags() {
|
||||
@@ -260,6 +261,19 @@ func runOwner() {
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func runStatus() {
|
||||
req := core.StatusRequest{
|
||||
Name: user,
|
||||
Password: pswd,
|
||||
}
|
||||
|
||||
resp, err := roServer.Status(req)
|
||||
processError(err)
|
||||
|
||||
fmt.Println(resp.Status)
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Usage = func() {
|
||||
fmt.Println("Usage: ro [options] subcommand")
|
||||
|
||||
Reference in New Issue
Block a user