Skip to content

Commit

Permalink
pvxinfo -v show server credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Dec 12, 2024
1 parent 44e338f commit 1a3df50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/serverconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ std::set<std::string> PeerCredentials::roles() const

std::ostream& operator<<(std::ostream& strm, const PeerCredentials& cred)
{
if(cred.isTLS)
strm<<"TLS ";
strm<<cred.method;
if(!cred.authority.empty())
strm<<cred.authority;
strm<<":"<<cred.authority;
strm<<"/"<<cred.account<<"@"<<cred.peer;
return strm;
}
Expand Down
5 changes: 5 additions & 0 deletions tools/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,16 @@ int main(int argc, char *argv[])
std::cout<<"Effective config\n"<<ctxt.config();

std::list<std::shared_ptr<client::Operation>> ops;
std::list<std::shared_ptr<client::Connect>> conns;

std::atomic<int> remaining{argc-optind};
epicsEvent done;

for(auto n : range(optind, argc)) {
if(verbose)
conns.push_back(ctxt.connect(argv[n]).onConnect([](const client::Connected& cb) {
std::cout<<"# "<<(*cb.cred)<<"\n";
}).exec());

ops.push_back(ctxt.info(argv[n])
.result([&argv, n, &remaining, &done](client::Result&& result) {
Expand Down

0 comments on commit 1a3df50

Please sign in to comment.