Add login_api::get_info API, which returns a string defined by the node operator via a new api-node-info node startup option. For #626. E.G.
$ curl -d '{"id":1,"method":"call","params":["login","get_info",[]]}' http://localhost:8090; echo
{"id":1,"result":"Hello, this is my API node"}
Add login_api::get_config API, which returns the configured application options, including API limits and etc. It requires the user to be logged in and have access to at least one API set other than login_api. For #626. E.G.
Update login_api::login API to accept an empty argument list, in this case it returns the API set ID allocated to the login API set, which is always 1. This is needed to support named API call in the login API set itself.
Update docs to clarify that authentication via HTTP Basic authentication is always tried by default, thus calling login_api::login API explicitly is not always required by clients.
If authentication via HTTP Basic authentication fails (E.G. due to a wrong password), or the authenticated user does not have access to the database API set, the API set ID 0 will be allocated to a dummy API set. If the authentication succeeds, 0 will be allocated to the database API set, and the login_api::database API will always return 0, even after logged out and re-logged in.
Only create API objects when required (except the ID 0).
PR for #626, #2614, #1689.
login_api::get_available_api_sets
API, which returns a list of API sets that the user has access to. For #1689. E.G.login_api::get_info
API, which returns a string defined by the node operator via a newapi-node-info
node startup option. For #626. E.G.login_api::get_config
API, which returns the configured application options, including API limits and etc. It requires the user to be logged in and have access to at least one API set other thanlogin_api
. For #626. E.G.login_api::logout
API, which always returnsfalse
. E.G.login_api::login
API to accept an empty argument list, in this case it returns the API set ID allocated to thelogin
API set, which is always1
. This is needed to support named API call in thelogin
API set itself.login_api::login
API explicitly is not always required by clients.database
API set, the API set ID0
will be allocated to adummy
API set. If the authentication succeeds,0
will be allocated to thedatabase
API set, and thelogin_api::database
API will always return0
, even after logged out and re-logged in.0
).