| 200 | } |
| 201 | |
| 202 | virtual bool Authorize(const google::protobuf::Message* req, |
| 203 | google::protobuf::Message* resp, RpcContext* context) override { |
| 204 | if (!IsKerberosEnabled()) { |
| 205 | const RemoteUser& remote_user = context->remote_user(); |
| 206 | if (remote_user.username() != "impala") { |
| 207 | mem_tracker_.Release(context->GetTransferSize()); |
| 208 | context->RespondFailure(kudu::Status::NotAuthorized( |
| 209 | Substitute("$0 is not allowed to access PingService", |
| 210 | remote_user.ToString()))); |
| 211 | return false; |
| 212 | } |
| 213 | return true; |
| 214 | } else { |
| 215 | return rpc_mgr_->Authorize("PingService", context, mem_tracker()); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | virtual void Ping(const PingRequestPB* request, PingResponsePB* response, RpcContext* |
| 220 | context) override { |
nothing calls this directly
no test coverage detected