[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r416237833 ## File path: CMakeLists.txt ## @@ -480,6 +480,18 @@ if ((ENABLE_ALL OR ENABLE_SFTP) AND NOT DISABLE_CURL) createExtension(SFTP "SFTP EXTENSIONS" "This enables SFTP support" "extensions/sftp" "extensions/sftp/tests") endif() +## Openwsman Extesions +option(ENABLE_OPENWSMAN "Enables the Openwsman extensions." OFF) +if (ENABLE_OPENWSMAN AND NOT DISABLE_CIVET AND NOT DISABLE_CURL) + include(BundledLibXml2) + use_bundled_libxml2(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/libxml2/dummy") + + include(BundledOpenWSMAN) + use_bundled_openwsman(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + +createExtension(OPENWSMAN-EXTENSIONS "OPENWSMAN EXTENSIONS" "This enables Opwensman support" "extensions/openwsman") Review comment: Thanks, fixed. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r415129086 ## File path: cmake/BundledLibXml2.cmake ## @@ -0,0 +1,94 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +function(use_bundled_libxml2 SOURCE_DIR BINARY_DIR) +message("Using bundled libxml2") + +# Define patch step +if (WIN32) +set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/libxml2/libxml2-win.patch") +endif() + +# Define byproducts +if (WIN32) +set(BYPRODUCT "lib/xml2.lib") +else() +set(BYPRODUCT "lib/libxml2.a") +endif() + +# Set build options +if (WIN32) +set(LIBXML2_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS} + "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/libxml2-install") +endif() + +# Build project +set(LIBXML2_URL ftp://xmlsoft.org/libxml2/libxml2-2.9.10.tar.gz https://ftp.osuosl.org/pub/blfs/conglomeration/libxml2/libxml2-2.9.10.tar.gz) +set(LIBXML2_URL_HASH "SHA256=aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f") + +if (WIN32) +ExternalProject_Add( +libxml2-external +URL ${LIBXML2_URL} +URL_HASH ${LIBXML2_URL_HASH} +SOURCE_DIR "${BINARY_DIR}/thirdparty/libxml2-src" +LIST_SEPARATOR % # This is needed for passing semicolon-separated lists +CMAKE_ARGS ${LIBXML2_CMAKE_ARGS} +PATCH_COMMAND ${PC} +BUILD_BYPRODUCTS "${BINARY_DIR}/thirdparty/libxml2-install/${BYPRODUCT}" +EXCLUDE_FROM_ALL TRUE +) +else() +ExternalProject_Add( +libxml2-external +URL ${LIBXML2_URL} +URL_HASH ${LIBXML2_URL_HASH} +BUILD_IN_SOURCE true +SOURCE_DIR "${BINARY_DIR}/thirdparty/libxml2-src" +BUILD_COMMAND make +CMAKE_COMMAND "" +UPDATE_COMMAND "" +INSTALL_COMMAND make install +BUILD_BYPRODUCTS "${BINARY_DIR}/thirdparty/libxml2-install/${BYPRODUCT}" +CONFIGURE_COMMAND "" +PATCH_COMMAND ./configure --enable-shared=no --enable-static=yes --with-iconv=no --with-zlib=no --with-lzma=no --with-python=no --with-ftp=no --with-http=no --prefix=${BINARY_DIR}/thirdparty/libxml2-install Review comment: `CONFIGURE_COMMAND` in a CMake ExternalProject would be the CMake command itself, with `./configure` projects we use the `PATCH_COMMAND` - not sure why, this is inherited practice from well before the third party refactor, but it seems to work fine. If we want to change it we would to review and test is extensively and change it everywhere - but I see no reason to do so right now. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r415128483 ## File path: extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp ## @@ -0,0 +1,918 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SourceInitiatedSubscriptionListener.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +extern "C" { +#include "wsman-api.h" +#include "wsman-xml-api.h" +#include "wsman-xml-serialize.h" +#include "wsman-xml-serializer.h" +#include "wsman-soap.h" +#include "wsman-soap-envelope.h" +} + +#include "utils/ByteArrayCallback.h" +#include "core/FlowFile.h" +#include "core/logging/Logger.h" +#include "core/ProcessContext.h" +#include "core/Relationship.h" +#include "io/DataStream.h" +#include "io/StreamFactory.h" +#include "ResourceClaim.h" +#include "utils/StringUtils.h" +#include "utils/ScopeGuard.h" +#include "utils/file/FileUtils.h" + +#define XML_NS_CUSTOM_SUBSCRIPTION "http://schemas.microsoft.com/wbem/wsman/1/subscription; +#define XML_NS_CUSTOM_AUTHENTICATION "http://schemas.microsoft.com/wbem/wsman/1/authentication; +#define XML_NS_CUSTOM_POLICY "http://schemas.xmlsoap.org/ws/2002/12/policy; +#define XML_NS_CUSTOM_MACHINEID "http://schemas.microsoft.com/wbem/wsman/1/machineid; +#define WSMAN_CUSTOM_ACTION_ACK "http://schemas.dmtf.org/wbem/wsman/1/wsman/Ack; +#define WSMAN_CUSTOM_ACTION_HEARTBEAT "http://schemas.dmtf.org/wbem/wsman/1/wsman/Heartbeat; +#define WSMAN_CUSTOM_ACTION_EVENTS "http://schemas.dmtf.org/wbem/wsman/1/wsman/Events; + +namespace org { +namespace apache { +namespace nifi { +namespace minifi { +namespace processors { +core::Property SourceInitiatedSubscriptionListener::ListenHostname( +core::PropertyBuilder::createProperty("Listen Hostname")->withDescription("The hostname or IP of this machine that will be advertised to event sources to connect to. " + "It must be contained as a Subject Alternative Name in the server certificate, " + "otherwise source machines will refuse to connect.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::ListenPort( +core::PropertyBuilder::createProperty("Listen Port")->withDescription("The port to listen on.") +->isRequired(true)->withDefaultValue(5986, core::StandardValidators::LISTEN_PORT_VALIDATOR())->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionManagerPath( +core::PropertyBuilder::createProperty("Subscription Manager Path")->withDescription("The URI path that will be used for the WEC Subscription Manager endpoint.") + ->isRequired(true)->withDefaultValue("/wsman/SubscriptionManager/WEC")->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionsBasePath( +core::PropertyBuilder::createProperty("Subscriptions Base Path")->withDescription("The URI path that will be used as the base for endpoints serving individual subscriptions.") +->isRequired(true)->withDefaultValue("/wsman/subscriptions")->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificate( +core::PropertyBuilder::createProperty("SSL Certificate")->withDescription("File containing PEM-formatted file including TLS/SSL certificate and key. " + "The root CA of the certificate must be the CA set in SSL Certificate Authority.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificateAuthority( +core::PropertyBuilder::createProperty("SSL Certificate Authority")->withDescription("File containing the PEM-formatted CA that is the root CA for both this server's certificate " + "and the event source clients' certificates.") +->isRequired(true)->build()); +core::Property
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r412963415 ## File path: extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp ## @@ -0,0 +1,918 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SourceInitiatedSubscriptionListener.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +extern "C" { +#include "wsman-api.h" +#include "wsman-xml-api.h" +#include "wsman-xml-serialize.h" +#include "wsman-xml-serializer.h" +#include "wsman-soap.h" +#include "wsman-soap-envelope.h" +} + +#include "utils/ByteArrayCallback.h" +#include "core/FlowFile.h" +#include "core/logging/Logger.h" +#include "core/ProcessContext.h" +#include "core/Relationship.h" +#include "io/DataStream.h" +#include "io/StreamFactory.h" +#include "ResourceClaim.h" +#include "utils/StringUtils.h" +#include "utils/ScopeGuard.h" +#include "utils/file/FileUtils.h" + +#define XML_NS_CUSTOM_SUBSCRIPTION "http://schemas.microsoft.com/wbem/wsman/1/subscription; +#define XML_NS_CUSTOM_AUTHENTICATION "http://schemas.microsoft.com/wbem/wsman/1/authentication; +#define XML_NS_CUSTOM_POLICY "http://schemas.xmlsoap.org/ws/2002/12/policy; +#define XML_NS_CUSTOM_MACHINEID "http://schemas.microsoft.com/wbem/wsman/1/machineid; +#define WSMAN_CUSTOM_ACTION_ACK "http://schemas.dmtf.org/wbem/wsman/1/wsman/Ack; +#define WSMAN_CUSTOM_ACTION_HEARTBEAT "http://schemas.dmtf.org/wbem/wsman/1/wsman/Heartbeat; +#define WSMAN_CUSTOM_ACTION_EVENTS "http://schemas.dmtf.org/wbem/wsman/1/wsman/Events; + +namespace org { +namespace apache { +namespace nifi { +namespace minifi { +namespace processors { +core::Property SourceInitiatedSubscriptionListener::ListenHostname( +core::PropertyBuilder::createProperty("Listen Hostname")->withDescription("The hostname or IP of this machine that will be advertised to event sources to connect to. " + "It must be contained as a Subject Alternative Name in the server certificate, " + "otherwise source machines will refuse to connect.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::ListenPort( +core::PropertyBuilder::createProperty("Listen Port")->withDescription("The port to listen on.") +->isRequired(true)->withDefaultValue(5986, core::StandardValidators::LISTEN_PORT_VALIDATOR())->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionManagerPath( +core::PropertyBuilder::createProperty("Subscription Manager Path")->withDescription("The URI path that will be used for the WEC Subscription Manager endpoint.") + ->isRequired(true)->withDefaultValue("/wsman/SubscriptionManager/WEC")->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionsBasePath( +core::PropertyBuilder::createProperty("Subscriptions Base Path")->withDescription("The URI path that will be used as the base for endpoints serving individual subscriptions.") +->isRequired(true)->withDefaultValue("/wsman/subscriptions")->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificate( +core::PropertyBuilder::createProperty("SSL Certificate")->withDescription("File containing PEM-formatted file including TLS/SSL certificate and key. " + "The root CA of the certificate must be the CA set in SSL Certificate Authority.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificateAuthority( +core::PropertyBuilder::createProperty("SSL Certificate Authority")->withDescription("File containing the PEM-formatted CA that is the root CA for both this server's certificate " + "and the event source clients' certificates.") +->isRequired(true)->build()); +core::Property
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r412955894 ## File path: extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp ## @@ -0,0 +1,918 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SourceInitiatedSubscriptionListener.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +extern "C" { +#include "wsman-api.h" +#include "wsman-xml-api.h" +#include "wsman-xml-serialize.h" +#include "wsman-xml-serializer.h" +#include "wsman-soap.h" +#include "wsman-soap-envelope.h" +} + +#include "utils/ByteArrayCallback.h" +#include "core/FlowFile.h" +#include "core/logging/Logger.h" +#include "core/ProcessContext.h" +#include "core/Relationship.h" +#include "io/DataStream.h" +#include "io/StreamFactory.h" +#include "ResourceClaim.h" +#include "utils/StringUtils.h" +#include "utils/ScopeGuard.h" +#include "utils/file/FileUtils.h" + +#define XML_NS_CUSTOM_SUBSCRIPTION "http://schemas.microsoft.com/wbem/wsman/1/subscription; +#define XML_NS_CUSTOM_AUTHENTICATION "http://schemas.microsoft.com/wbem/wsman/1/authentication; +#define XML_NS_CUSTOM_POLICY "http://schemas.xmlsoap.org/ws/2002/12/policy; +#define XML_NS_CUSTOM_MACHINEID "http://schemas.microsoft.com/wbem/wsman/1/machineid; +#define WSMAN_CUSTOM_ACTION_ACK "http://schemas.dmtf.org/wbem/wsman/1/wsman/Ack; +#define WSMAN_CUSTOM_ACTION_HEARTBEAT "http://schemas.dmtf.org/wbem/wsman/1/wsman/Heartbeat; +#define WSMAN_CUSTOM_ACTION_EVENTS "http://schemas.dmtf.org/wbem/wsman/1/wsman/Events; + +namespace org { +namespace apache { +namespace nifi { +namespace minifi { +namespace processors { +core::Property SourceInitiatedSubscriptionListener::ListenHostname( +core::PropertyBuilder::createProperty("Listen Hostname")->withDescription("The hostname or IP of this machine that will be advertised to event sources to connect to. " + "It must be contained as a Subject Alternative Name in the server certificate, " + "otherwise source machines will refuse to connect.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::ListenPort( +core::PropertyBuilder::createProperty("Listen Port")->withDescription("The port to listen on.") +->isRequired(true)->withDefaultValue(5986, core::StandardValidators::LISTEN_PORT_VALIDATOR())->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionManagerPath( +core::PropertyBuilder::createProperty("Subscription Manager Path")->withDescription("The URI path that will be used for the WEC Subscription Manager endpoint.") + ->isRequired(true)->withDefaultValue("/wsman/SubscriptionManager/WEC")->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionsBasePath( +core::PropertyBuilder::createProperty("Subscriptions Base Path")->withDescription("The URI path that will be used as the base for endpoints serving individual subscriptions.") +->isRequired(true)->withDefaultValue("/wsman/subscriptions")->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificate( +core::PropertyBuilder::createProperty("SSL Certificate")->withDescription("File containing PEM-formatted file including TLS/SSL certificate and key. " + "The root CA of the certificate must be the CA set in SSL Certificate Authority.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificateAuthority( +core::PropertyBuilder::createProperty("SSL Certificate Authority")->withDescription("File containing the PEM-formatted CA that is the root CA for both this server's certificate " + "and the event source clients' certificates.") +->isRequired(true)->build()); +core::Property
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r412955894 ## File path: extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp ## @@ -0,0 +1,918 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SourceInitiatedSubscriptionListener.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +extern "C" { +#include "wsman-api.h" +#include "wsman-xml-api.h" +#include "wsman-xml-serialize.h" +#include "wsman-xml-serializer.h" +#include "wsman-soap.h" +#include "wsman-soap-envelope.h" +} + +#include "utils/ByteArrayCallback.h" +#include "core/FlowFile.h" +#include "core/logging/Logger.h" +#include "core/ProcessContext.h" +#include "core/Relationship.h" +#include "io/DataStream.h" +#include "io/StreamFactory.h" +#include "ResourceClaim.h" +#include "utils/StringUtils.h" +#include "utils/ScopeGuard.h" +#include "utils/file/FileUtils.h" + +#define XML_NS_CUSTOM_SUBSCRIPTION "http://schemas.microsoft.com/wbem/wsman/1/subscription; +#define XML_NS_CUSTOM_AUTHENTICATION "http://schemas.microsoft.com/wbem/wsman/1/authentication; +#define XML_NS_CUSTOM_POLICY "http://schemas.xmlsoap.org/ws/2002/12/policy; +#define XML_NS_CUSTOM_MACHINEID "http://schemas.microsoft.com/wbem/wsman/1/machineid; +#define WSMAN_CUSTOM_ACTION_ACK "http://schemas.dmtf.org/wbem/wsman/1/wsman/Ack; +#define WSMAN_CUSTOM_ACTION_HEARTBEAT "http://schemas.dmtf.org/wbem/wsman/1/wsman/Heartbeat; +#define WSMAN_CUSTOM_ACTION_EVENTS "http://schemas.dmtf.org/wbem/wsman/1/wsman/Events; + +namespace org { +namespace apache { +namespace nifi { +namespace minifi { +namespace processors { +core::Property SourceInitiatedSubscriptionListener::ListenHostname( +core::PropertyBuilder::createProperty("Listen Hostname")->withDescription("The hostname or IP of this machine that will be advertised to event sources to connect to. " + "It must be contained as a Subject Alternative Name in the server certificate, " + "otherwise source machines will refuse to connect.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::ListenPort( +core::PropertyBuilder::createProperty("Listen Port")->withDescription("The port to listen on.") +->isRequired(true)->withDefaultValue(5986, core::StandardValidators::LISTEN_PORT_VALIDATOR())->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionManagerPath( +core::PropertyBuilder::createProperty("Subscription Manager Path")->withDescription("The URI path that will be used for the WEC Subscription Manager endpoint.") + ->isRequired(true)->withDefaultValue("/wsman/SubscriptionManager/WEC")->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionsBasePath( +core::PropertyBuilder::createProperty("Subscriptions Base Path")->withDescription("The URI path that will be used as the base for endpoints serving individual subscriptions.") +->isRequired(true)->withDefaultValue("/wsman/subscriptions")->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificate( +core::PropertyBuilder::createProperty("SSL Certificate")->withDescription("File containing PEM-formatted file including TLS/SSL certificate and key. " + "The root CA of the certificate must be the CA set in SSL Certificate Authority.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificateAuthority( +core::PropertyBuilder::createProperty("SSL Certificate Authority")->withDescription("File containing the PEM-formatted CA that is the root CA for both this server's certificate " + "and the event source clients' certificates.") +->isRequired(true)->build()); +core::Property
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r412955894 ## File path: extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp ## @@ -0,0 +1,918 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "SourceInitiatedSubscriptionListener.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +extern "C" { +#include "wsman-api.h" +#include "wsman-xml-api.h" +#include "wsman-xml-serialize.h" +#include "wsman-xml-serializer.h" +#include "wsman-soap.h" +#include "wsman-soap-envelope.h" +} + +#include "utils/ByteArrayCallback.h" +#include "core/FlowFile.h" +#include "core/logging/Logger.h" +#include "core/ProcessContext.h" +#include "core/Relationship.h" +#include "io/DataStream.h" +#include "io/StreamFactory.h" +#include "ResourceClaim.h" +#include "utils/StringUtils.h" +#include "utils/ScopeGuard.h" +#include "utils/file/FileUtils.h" + +#define XML_NS_CUSTOM_SUBSCRIPTION "http://schemas.microsoft.com/wbem/wsman/1/subscription; +#define XML_NS_CUSTOM_AUTHENTICATION "http://schemas.microsoft.com/wbem/wsman/1/authentication; +#define XML_NS_CUSTOM_POLICY "http://schemas.xmlsoap.org/ws/2002/12/policy; +#define XML_NS_CUSTOM_MACHINEID "http://schemas.microsoft.com/wbem/wsman/1/machineid; +#define WSMAN_CUSTOM_ACTION_ACK "http://schemas.dmtf.org/wbem/wsman/1/wsman/Ack; +#define WSMAN_CUSTOM_ACTION_HEARTBEAT "http://schemas.dmtf.org/wbem/wsman/1/wsman/Heartbeat; +#define WSMAN_CUSTOM_ACTION_EVENTS "http://schemas.dmtf.org/wbem/wsman/1/wsman/Events; + +namespace org { +namespace apache { +namespace nifi { +namespace minifi { +namespace processors { +core::Property SourceInitiatedSubscriptionListener::ListenHostname( +core::PropertyBuilder::createProperty("Listen Hostname")->withDescription("The hostname or IP of this machine that will be advertised to event sources to connect to. " + "It must be contained as a Subject Alternative Name in the server certificate, " + "otherwise source machines will refuse to connect.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::ListenPort( +core::PropertyBuilder::createProperty("Listen Port")->withDescription("The port to listen on.") +->isRequired(true)->withDefaultValue(5986, core::StandardValidators::LISTEN_PORT_VALIDATOR())->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionManagerPath( +core::PropertyBuilder::createProperty("Subscription Manager Path")->withDescription("The URI path that will be used for the WEC Subscription Manager endpoint.") + ->isRequired(true)->withDefaultValue("/wsman/SubscriptionManager/WEC")->build()); +core::Property SourceInitiatedSubscriptionListener::SubscriptionsBasePath( +core::PropertyBuilder::createProperty("Subscriptions Base Path")->withDescription("The URI path that will be used as the base for endpoints serving individual subscriptions.") +->isRequired(true)->withDefaultValue("/wsman/subscriptions")->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificate( +core::PropertyBuilder::createProperty("SSL Certificate")->withDescription("File containing PEM-formatted file including TLS/SSL certificate and key. " + "The root CA of the certificate must be the CA set in SSL Certificate Authority.") +->isRequired(true)->build()); +core::Property SourceInitiatedSubscriptionListener::SSLCertificateAuthority( +core::PropertyBuilder::createProperty("SSL Certificate Authority")->withDescription("File containing the PEM-formatted CA that is the root CA for both this server's certificate " + "and the event source clients' certificates.") +->isRequired(true)->build()); +core::Property
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r411648034 ## File path: centos.sh ## @@ -155,6 +155,8 @@ build_deps(){ INSTALLED+=("bzip2-devel") elif [ "$FOUND_VALUE" = "libssh2" ]; then INSTALLED+=("libssh2-devel") +elif [ "$FOUND_VALUE" = "libxml2" ]; then Review comment: libxml2 is bundled in the new version. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r314719220 ## File path: centos.sh ## @@ -155,6 +155,8 @@ build_deps(){ INSTALLED+=("bzip2-devel") elif [ "$FOUND_VALUE" = "libssh2" ]; then INSTALLED+=("libssh2-devel") +elif [ "$FOUND_VALUE" = "libxml2" ]; then Review comment: We can also bundle libxml2, but it is a pretty common library, so I left it an external dependency for the time being. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor
bakaid commented on a change in pull request #629: MINIFICPP-1002 - Add SourceInitiatedSubscriptionListener processor URL: https://github.com/apache/nifi-minifi-cpp/pull/629#discussion_r314718886 ## File path: thirdparty/openwsman/openwsman.patch ## @@ -0,0 +1,102 @@ +diff -rupN openwsman-2.6.9/CMakeLists.txt openwsman-2.6.9-patched/CMakeLists.txt +--- openwsman-2.6.9/CMakeLists.txt 2018-11-20 09:09:43.0 +0100 openwsman-2.6.9-patched/CMakeLists.txt 2019-08-01 15:48:44.0 +0200 +@@ -22,7 +22,7 @@ if(COMMAND cmake_policy) + cmake_policy(SET CMP0046 OLD) + endif ( POLICY CMP0046 ) + endif(COMMAND cmake_policy) +- ++ + # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked + SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) + +@@ -84,7 +84,7 @@ MACRO(NO_HEADERS_WARNING_EXPL optionName +MESSAGE(STATUS "") +SET(HAVE_WARNINGS YES) + ENDMACRO(NO_HEADERS_WARNING_EXPL) +- ++ + # Macro for error message when header files not present, but build option + # not explicitly declared + MACRO(NO_HEADERS_WARNING optionName pkgName) +@@ -170,6 +170,12 @@ INCLUDE(FindOpenSSL) + IF(OPENSSL_FOUND) + SET(HAVE_SSL 1) + SET(USE_OPENSSL 1) ++ INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) ++ message(OpenSSL found) ++ message(OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}) ++ message(OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES}) ++ELSE(OPENSSL_FOUND) ++ SET(HAVE_SSL 0) + ENDIF(OPENSSL_FOUND) + + IF( BUILD_RUBY ) +@@ -260,7 +266,7 @@ ELSE ( NOT CURL_FOUND) + STRING(COMPARE LESS ${CURL_VERSION_STRING} "7.12.0" result) + IF(result LESS 0) + MESSAGE( FATAL_ERROR " curl version ${CURL_VERSION_STRING} is too low, need 7.12.0 or greater" ) +-ENDIF(result LESS 0) ++ENDIF(result LESS 0) + ENDIF(CURL_VERSION_STRING) + ENDIF( NOT CURL_FOUND) + +@@ -439,7 +445,7 @@ IF(HAVE_SA_LEN) + ELSE(HAVE_SA_LEN) + SET(HAVE_SA_LEN 0) + ENDIF(HAVE_SA_LEN) +- ++ + IF (ENABLE_IPV6) + # Check if struct sockaddr_in6 contains sin6 + CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_addr netinet/in.h HAVE_IPV6) +@@ -592,7 +598,7 @@ IF(HAVE_WARNINGS) + MESSAGE(STATUS " NOTE: ") + MESSAGE(STATUS " Warnings occurred during cmake configuration... Please see output") + MESSAGE(STATUS " ***") +-ENDIF(HAVE_WARNINGS) ++ENDIF(HAVE_WARNINGS) + + + # RPM SPEC # +diff -rupN openwsman-2.6.9/src/lib/wsman-soap.c openwsman-2.6.9-patched/src/lib/wsman-soap.c +--- openwsman-2.6.9/src/lib/wsman-soap.c 2018-11-20 09:09:43.0 +0100 openwsman-2.6.9-patched/src/lib/wsman-soap.c 2019-08-01 15:28:56.0 +0200 +@@ -935,16 +935,18 @@ unsigned long get_total_enum_context(WsC + * to libwsman.la. So when a call is made to the following methods + * from the openwsmand binary, they should be present. + * +- * However, if they are dlopened from somewhere other than ++ * However, if they are dlopened from somewhere other than + * openwsmand library or linked to some other + * binary or shared object, then these methods may or may not be + * preset, hence marking them as weak symbols and testing to see + * if they are resolved before using them. + */ ++#if 0 Review comment: Unfortunately exporting all symbols with whole-archive methods don't work well with the weak symbol approach this library tries to take, so I had to disable these symbols entirely. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services