This PR adds a new field, user
, to getrpcinfo
’s json. Check the discussion #18827 (comment) for more info regarding this change.
The functional test interface_rpc
has been updated accordingly.
This PR adds a new field, user
, to getrpcinfo
’s json. Check the discussion #18827 (comment) for more info regarding this change.
The functional test interface_rpc
has been updated accordingly.
231@@ -231,6 +232,8 @@ static UniValue getrpcinfo(const JSONRPCRequest& request)
232 const std::string path = LogInstance().m_file_path.string();
233 UniValue log_path(UniValue::VSTR, path);
234 result.pushKV("logpath", log_path);
235+ UniValue user(UniValue::VSTR, request.authUser);
236+ result.pushKV("user", user);
result.pushKV("user", request.authUser)
?
Yes, this could be made like this. However, I saw in some other (older code) that people were putting string values into UniValue::VSTRs, so I thought, I should follow “best practices”. Not that I know, what Bitcoin Core best practices were, but I try to follow already existing code.
Long story short: yes, I’d prefer putting string directly into result. :)
–EDIT: one example is the line 233, just above my code. There you have such an example.
I don’t understand what is the use case. The client should know who he is?
I think this could help in some cases when supporting users. For example, asking to provide getrpcinfo output is simpler than asking to provide whole config file, there will be other settings user might not share or he could just by mistake give wrong config file from his computer.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.