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 committed Apr 18, 2022
1 parent 82a0d4d commit d412895
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions source/agora/api/Admin.d
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down 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 d412895

Please sign in to comment.