| 42 | } |
| 43 | |
| 44 | void RESTSender::initialize(core::controller::ControllerServiceProvider* controller, const std::shared_ptr<Configure> &configure) { |
| 45 | C2Protocol::initialize(controller, configure); |
| 46 | // base URL when one is not specified. |
| 47 | if (nullptr != configure) { |
| 48 | std::string update_str, ssl_context_service_str; |
| 49 | configure->get("nifi.c2.rest.url", "c2.rest.url", rest_uri_); |
| 50 | configure->get("nifi.c2.rest.url.ack", "c2.rest.url.ack", ack_uri_); |
| 51 | if (configure->get("nifi.c2.rest.ssl.context.service", "c2.rest.ssl.context.service", ssl_context_service_str)) { |
| 52 | auto service = controller->getControllerService(ssl_context_service_str); |
| 53 | if (nullptr != service) { |
| 54 | ssl_context_service_ = std::static_pointer_cast<minifi::controllers::SSLContextService>(service); |
| 55 | } |
| 56 | } |
| 57 | configure->get("nifi.c2.rest.heartbeat.minimize.updates", "c2.rest.heartbeat.minimize.updates", update_str); |
| 58 | utils::StringUtils::StringToBool(update_str, minimize_updates_); |
| 59 | } |
| 60 | logger_->log_debug("Submitting to %s", rest_uri_); |
| 61 | } |
| 62 | |
| 63 | C2Payload RESTSender::consumePayload(const std::string &url, const C2Payload &payload, Direction direction, bool /*async*/) { |
| 64 | std::string outputConfig; |
no test coverage detected