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:
Kyle Isom
2016-07-13 10:20:06 -07:00
parent 941cdb4e96
commit cb16b159f3
7 changed files with 174 additions and 16 deletions
+14
View File
@@ -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")