Skip to content

Commit

Permalink
Apply new requirement for Admin endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
linked0 authored and mkykadir committed Apr 21, 2022
1 parent 2bd2e07 commit 26b7df8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions source/agora/api/Admin.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/***************************************************************************
Expand All @@ -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);
}
12 changes: 6 additions & 6 deletions source/agora/node/admin/AdminInterface.d
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
}

/***************************************************************************
Expand All @@ -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.
Expand All @@ -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);
}

/***************************************************************************
Expand Down

0 comments on commit 26b7df8

Please sign in to comment.