Skip to content

Commit

Permalink
Add login endpoint for Admin interface
Browse files Browse the repository at this point in the history
  • Loading branch information
linked0 committed Apr 18, 2022
1 parent be9b8d1 commit 82a0d4d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/agora/api/Admin.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ public interface NodeControlAPI
@viaQuery("console") Nullable!bool console = Nullable!(bool).init,
@viaQuery("file") Nullable!string file = Nullable!(string).init);

/***************************************************************************
Log in to the admin server
This is dummy endpoint for checking the username and password in
HTTP basic authentication.
API:
GET /login
***************************************************************************/

@method(HTTPMethod.GET)
@resultSerializer!(RawStringSerializer.serialize,
RawStringSerializer.deserialize,
"application/json")()
public void login ();

/***************************************************************************
Respond with QR code containing login information.
Expand Down
6 changes: 6 additions & 0 deletions source/agora/node/admin/AdminInterface.d
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import core.time : days;
This will added by node management and monitoring interfaces.
API:
GET /login : Log in to the admin server
GET /loginQR : Respond with QR code containing login information.
GET /encryptionKeyQR : Respond with QR code containing EncryptionKey.
Expand Down Expand Up @@ -119,6 +120,11 @@ public class AdminInterface : NodeControlAPI
configureLogger(config, !console.isNull() || !file.isNull());
}

// GET: /login
public override void login ()
{
}

/***************************************************************************
Respond with QR code containing login information.
Expand Down

0 comments on commit 82a0d4d

Please sign in to comment.