server: change how operation credentials are presented

This commit is contained in:
Michael Davidsaver
2020-12-26 13:14:07 -08:00
parent dbed32309e
commit 9ec69c784a
9 changed files with 94 additions and 111 deletions
+1 -16
View File
@@ -67,8 +67,7 @@ struct ServerIntrospectControl : public server::ConnectOp
{
_op = Info;
_name = chan->name;
_peerName = conn->peerName;
_ifaceName = conn->iface->name;
_cred = conn->cred;
}
virtual ~ServerIntrospectControl() {
error("Implict Cancel");
@@ -112,20 +111,6 @@ struct ServerIntrospectControl : public server::ConnectOp
});
}
virtual std::pair<std::string, Value> rawCredentials() const override final
{
std::pair<std::string, Value> ret;
auto serv = server.lock();
if(serv)
serv->acceptor_loop.call([this, &ret](){
if(auto oper = op.lock())
if(auto chan = oper->chan.lock())
if(auto conn = chan->conn.lock())
ret = std::make_pair(conn->autoMethod, conn->credentials.clone());
});
return ret;
}
// we'll never use these, so no reason to store
virtual void onGet(std::function<void(std::unique_ptr<server::ExecOp>&& fn)>&& fn) override final {}
virtual void onPut(std::function<void(std::unique_ptr<server::ExecOp>&& fn, Value&&)>&& fn) override final {}