Add a API call to the server:

rpc/settings: "action" = "list_ssl_checksums"
This will list the MD5 checksums of all the known SSL keys (in no particular order)

REST Request:
-------------------------------
PUT /rpc/settings
{
   "action" : "list_ssl_checksums"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "list_ssl_checksums"
   },
   "namespace" : "rpc",
   "name" : "settings",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "md5_keys": [
      "0`H\u0013\r*\u00023\u000bc"
    ]
  },
  "id": "fooid",
  "name": "response",
  "namespace": "rpc"
}
This commit is contained in:
Ken Moore
2016-05-05 09:55:38 -04:00
parent 4ef706afee
commit f9af7c2efe
3 changed files with 22 additions and 0 deletions

View File

@@ -164,6 +164,9 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmSettingsRequest(const QJsonV
}else if(act=="list_ssl_certs"){
AUTHSYSTEM->ListCertificates(SockAuthToken, out);
ok = true; //always works for current user (even if nothing found)
}else if(act=="list_ssl_checksums"){
AUTHSYSTEM->ListCertificateChecksums(out);
ok = true;
}else if(act=="revoke_ssl_cert" && keys.contains("pub_key") ){
//Additional arguments: "user" (optional), "pub_key" (String)
QString user; if(keys.contains("user")){ user = argsO.value("user").toString(); }