From d4128957ccbaeb523e1ba8ea4ff36bc0b31d974d Mon Sep 17 00:00:00 2001 From: Hyunjae Lee Date: Thu, 14 Apr 2022 16:41:39 +0900 Subject: [PATCH] Apply new requirement for Admin endpoint --- source/agora/api/Admin.d | 10 +++++----- source/agora/node/admin/AdminInterface.d | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/agora/api/Admin.d b/source/agora/api/Admin.d index 011564c2612..8507c1a075b 100644 --- a/source/agora/api/Admin.d +++ b/source/agora/api/Admin.d @@ -48,7 +48,7 @@ public interface NodeControlAPI Log in to the admin server - This is dummy endpoint for checking the username and password in + This is endpoint used only for checking the username and password in HTTP basic authentication. API: @@ -83,8 +83,8 @@ public interface NodeControlAPI @method(HTTPMethod.GET) @resultSerializer!(RawStringSerializer.serialize, RawStringSerializer.deserialize, - "image/svg+xml")() - public string loginQR (@viaHeader("Content-Type") out string contentType, + "application/json")() + public string validator (@viaHeader("Content-Type") out string contentType, @viaHeader("Vary") out string vary); /*************************************************************************** @@ -99,8 +99,8 @@ public interface NodeControlAPI @method(HTTPMethod.GET) @resultSerializer!(RawStringSerializer.serialize, RawStringSerializer.deserialize, - "image/svg+xml")() - public string encryptionKeyQR (string app, ulong height, + "application/json")() + public string encryptionkey (string app, ulong height, @viaHeader("Content-Type") out string contentType, @viaHeader("Vary") out string vary); } diff --git a/source/agora/node/admin/AdminInterface.d b/source/agora/node/admin/AdminInterface.d index 9116b122cfe..2a3e979b437 100644 --- a/source/agora/node/admin/AdminInterface.d +++ b/source/agora/node/admin/AdminInterface.d @@ -143,7 +143,7 @@ public class AdminInterface : NodeControlAPI ***************************************************************************/ - public override string loginQR (out string contentType, out string vary) + public override string validator (out string contentType, out string vary) { // The randomly generated temporary KeyPair KeyPair temp_kp = KeyPair.random(); @@ -162,9 +162,9 @@ public class AdminInterface : NodeControlAPI login_info.voter_card.signature = this.key_pair.sign(login_info.voter_card); - contentType = "image/svg+xml"; + contentType = "application/json"; vary = "Accept-Encoding"; - return this.createQRcode(login_info); + return serializeToJsonString(login_info); } /*************************************************************************** @@ -176,7 +176,7 @@ public class AdminInterface : NodeControlAPI ***************************************************************************/ - public override string encryptionKeyQR ( + public override string encryptionkey ( string app, ulong height, out string contentType, out string vary) { // Gets the pre-image of the requested height. @@ -193,9 +193,9 @@ public class AdminInterface : NodeControlAPI ); encryptionKey.signature = this.key_pair.secret.sign(encryptionKey); - contentType = "image/svg+xml"; + contentType = "application/json"; vary = "Accept-Encoding"; - return this.createQRcode(encryptionKey); + return serializeToJsonString(encryptionKey); } /***************************************************************************