lordgamez commented on code in PR #2059:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2059#discussion_r2533891753
##########
behave_framework/src/minifi_test_framework/containers/minifi_container.py:
##########
@@ -15,34 +15,44 @@
# limitations under the License.
#
-from docker.models.networks import Network
+import logging
+from OpenSSL import crypto
+from minifi_test_framework.core.minifi_test_context import MinifiTestContext
from minifi_test_framework.containers.file import File
from minifi_test_framework.minifi.flow_definition import FlowDefinition
+from minifi_test_framework.core.ssl_utils import
make_cert_without_extended_usage
from .container import Container
class MinifiContainer(Container):
- def __init__(self, image_name: str, container_name: str, scenario_id: str,
network: Network):
- super().__init__(image_name, f"{container_name}-{scenario_id}",
network)
+ def __init__(self, container_name: str, test_context: MinifiTestContext):
+ super().__init__(test_context.minifi_container_image,
f"{container_name}-{test_context.scenario_id}", test_context.network)
self.flow_config_str: str = ""
self.flow_definition = FlowDefinition()
self.properties: dict[str, str] = {}
self.log_properties: dict[str, str] = {}
- self.is_fhs = 'MINIFI_INSTALLATION_TYPE=FHS' in
str(self.client.images.get(image_name).history())
+ minifi_client_cert, minifi_client_key =
make_cert_without_extended_usage(common_name=self.container_name,
ca_cert=test_context.root_ca_cert, ca_key=test_context.root_ca_key)
+ self.files.append(File("/tmp/resources/root_ca.crt",
crypto.dump_certificate(type=crypto.FILETYPE_PEM,
cert=test_context.root_ca_cert)))
+ self.files.append(File("/tmp/resources/minifi_client.crt",
crypto.dump_certificate(type=crypto.FILETYPE_PEM, cert=minifi_client_cert)))
+ self.files.append(File("/tmp/resources/minifi_client.key",
crypto.dump_privatekey(type=crypto.FILETYPE_PEM, pkey=minifi_client_key)))
Review Comment:
We don't need to specify it at all times, we can have the default
permissions if not specified.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]