Skip to content

MINIFICPP-2644 Add proxy controller service support for AWS and Azure processors#2045

Open
lordgamez wants to merge 8 commits intoapache:mainfrom
lordgamez:MINIFICPP-2644_aws_azure
Open

MINIFICPP-2644 Add proxy controller service support for AWS and Azure processors#2045
lordgamez wants to merge 8 commits intoapache:mainfrom
lordgamez:MINIFICPP-2644_aws_azure

Conversation

@lordgamez
Copy link
Contributor

https://issues.apache.org/jira/browse/MINIFICPP-2644


Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.

@lordgamez lordgamez force-pushed the MINIFICPP-2644_aws_azure branch from 93b6f3b to a1a832e Compare October 9, 2025 12:35
@lordgamez
Copy link
Contributor Author

The clang tidy errors are already fixed in #2040

@lordgamez lordgamez requested a review from Copilot October 9, 2025 12:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds proxy controller service support for AWS and Azure processors, allowing centralized proxy configuration management through a new ProxyConfigurationService controller service instead of requiring individual proxy properties on each processor.

  • Introduces a new ProxyConfigurationService controller service for centralized proxy configuration management
  • Updates AWS and Azure processors to support using the proxy configuration service as an alternative to individual proxy properties
  • Adds comprehensive test coverage for the new proxy configuration service functionality

Reviewed Changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
minifi-api/include/minifi-cpp/controllers/ProxyConfigurationServiceInterface.h Interface definition for proxy configuration service
libminifi/include/controllers/ProxyConfigurationService.h Implementation header for proxy configuration service
libminifi/src/controllers/ProxyConfigurationService.cpp Core implementation of proxy configuration service
libminifi/test/unit/ProxyConfigurationServiceTests.cpp Unit tests for proxy configuration service
extensions/azure/processors/* Azure processor base classes updated to support proxy service
extensions/azure/storage/* Azure storage clients updated to handle proxy configuration
extensions/azure/tests/* Test files updated to include proxy service test cases
extensions/aws/processors/AwsProcessor.* AWS processor updated to support proxy configuration service
extensions/aws/tests/* AWS test files updated to test both proxy service and direct properties
docker/test/integration/* Integration test support for proxy configuration service
PROCESSORS.md Documentation updated to reflect new proxy configuration service property
CONTROLLERS.md Documentation for the new ProxyConfigurationService controller

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lordgamez
Copy link
Contributor Author

lordgamez commented Oct 13, 2025

The issues listed in the clang tidy checks are fixed in the following PR: #2040

@lordgamez lordgamez marked this pull request as ready for review October 13, 2025 07:15
@lordgamez lordgamez force-pushed the MINIFICPP-2644_aws_azure branch from a1a832e to cd31ed2 Compare October 18, 2025 12:50
Comment on lines +24 to +29
struct ProxyConfiguration {
std::string proxy_host;
std::optional<uint16_t> proxy_port;
std::optional<std::string> proxy_user;
std::optional<std::string> proxy_password;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

details like this should not be on the API. username/password can be optional and replaced by other auth methods in some other proxy protocols. Possibly even hostname and port can vary.

Copy link
Contributor Author

@lordgamez lordgamez Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we only support HTTP proxies for now only these parameters are used, they can be extended or refactored when other protocols are introduced.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add this type definition to the API, we can't change it later without breaking API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what would be the best way to define this to adjust it to the future C API. In the current form I think it will only be extended, so non of the current field will be changed in the future. We should discuss this how these cases should be handled in the future, because I think additional fields being added to a struct on the API can be common. We can either define some additional reserved fields on the C API for future extensions, we can define some accessors on the C API so the struct itself will not be published to the API, or we can just break it when needed if we can predict that it will not be changed for a long time. I think we still have some time for think about this as controller services will not be supported on the C API for a while. What do you suggest in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could change this to have separate getter function for each field like we do on the SSLContextServiceInterface, in that way that can be extended when new properties are introduced, what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a getter-only interface could work. I would also add a proxy type getter, even if the type enum only has one possible value today, so older processors can detect future versions of the service that are incompatible.

I think we could also do a flat struct with the first field being a type enum field, if the interface always returns a heap allocated object: that way future versions can grow the struct without breaking its layout. I'd prefer this approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the interface to use a getter-only interface to be consistent with the SSLContextServiceInterface, I also added a type enum in 12e4262

@lordgamez lordgamez force-pushed the MINIFICPP-2644_aws_azure branch 2 times, most recently from 12e4262 to ee61c70 Compare January 10, 2026 08:56
@lordgamez lordgamez marked this pull request as draft January 14, 2026 16:31
@lordgamez lordgamez force-pushed the MINIFICPP-2644_aws_azure branch from b361c6f to ee61c70 Compare January 14, 2026 16:32
@lordgamez lordgamez force-pushed the MINIFICPP-2644_aws_azure branch 2 times, most recently from 530067c to fa7ded8 Compare February 18, 2026 16:19
@lordgamez lordgamez marked this pull request as ready for review February 18, 2026 16:20
Comment on lines +135 to +139
EXTENSIONAPI static constexpr auto ProxyType = core::PropertyDefinitionBuilder<magic_enum::enum_count<minifi::controllers::ProxyType>()>::createProperty("Proxy Type")
.withDescription("Proxy type")
.withDefaultValue(magic_enum::enum_name(minifi::controllers::ProxyType::HTTP))
.withAllowedValues(magic_enum::enum_names<minifi::controllers::ProxyType>())
.build();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this belongs in the ProxyConfigurationService, not in the processors. In NiFi the same controller service specifies all proxy details, including the type/protocol.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is also present in the controller service, but the proxy properties were already present in the AWS processors before introducing the proxy controller service, so this needs to be added here too. Maybe we can deprecate it in the future and remove them to only use the proxy controller service. In NiFi 2.0 they also removed the proxy properties leaving the proxy configuration service property. I would not suggest using the existing proxy properties for host, port, username, password, but require adding a controller service just for the proxy type.

std::string file_system_name;
std::string directory_name;
std::optional<uint64_t> number_of_retries;
std::optional<minifi::controllers::ProxyConfiguration> proxy_configuration;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of an optional member, it could default to type==DIRECT, which means no proxy. That would make one more impossible state unrepresentable, which is considered a best practice nowadays.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm convinced about this. What do you mean by "one more impossible state unrepresentable"? It seem a bit unintuitive to me. When the user adds a proxy controller service their intention is to use a proxy, if they do not want to use a proxy they should not add a service at all. What would be the benefit of adding a proxy service and configure it to not to use a proxy?

proxy.proxy_user = proxy_controller_service->getUsername().value_or("");
proxy.proxy_password = proxy_controller_service->getPassword().value_or("");
} else {
proxy.proxy_type = minifi::utils::parseOptionalEnumProperty<minifi::controllers::ProxyType>(context, ProxyType).value_or(minifi::controllers::ProxyType::HTTP);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a DIRECT option and make it the default.

HTTPS
};

class ProxyConfigurationServiceInterface : public virtual core::controller::ControllerService {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep the naming consistent with NiFi and call this ProxyConfigurationService


namespace org::apache::nifi::minifi::controllers {

class ProxyConfigurationService : public core::controller::ControllerServiceImpl, public ProxyConfigurationServiceInterface {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep the naming consistent with NiFi and call this StandardProxyConfigurationService

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's a good idea, I think we should be consistent with our own naming conventions. For example we have AzureStorageCredentialsService and SSLContextService, while these are named StandardAzureCredentialsControllerService and StandardSSLContextService in NiFi. I also think adding the "Standard" prefix just adds confusion for the user when there are no other proxy services so there is no need for the additional adjective.

REQUIRE(failed_flowfiles[0] == TEST_DATA);
}

TEST_CASE_METHOD(DeleteAzureBlobStorageTestsFixture, "Test Azure blob delete using proxy", "[azureBlobStorageDelete]") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this logic is in shared code, I'd only add one unit test, not one for each processor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the tests for the Put and List processors as the List processors are a bit different and removed the others in f70ac21

@lordgamez lordgamez force-pushed the MINIFICPP-2644_aws_azure branch from fa7ded8 to f70ac21 Compare March 5, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants