Skip to content

Support client/response filters for HTTP clients#837

Merged
vladokrsymphony merged 1 commit intofinos:mainfrom
symphony-enrico:main
Oct 14, 2025
Merged

Support client/response filters for HTTP clients#837
vladokrsymphony merged 1 commit intofinos:mainfrom
symphony-enrico:main

Conversation

@symphony-enrico
Copy link
Copy Markdown
Contributor

NOTE: This PR reinstates the changes from #542, which were later reverted in this commit. The original PR was reverted because its main purpose — the Agentless project — was canceled. However, I’m now reviving it, and moreover the ability to add filters could be valuable for various current and future use cases.

The HTTP clients implementations supported by the BDK both support registering custom filters to intercept requests and responses. This can be useful to add custom logic, trace requests, provide metrics or support use cases such as Agentless.

Using the SymphonyBdkBuilder it is now possible to register such filters.

For instance:

final SymphonyBdk bdk = new SymphonyBdkBuilder()
        .apiClientFactory(new ApiClientFactory(config){
          @OverRide
          protected ApiClientBuilder getApiClientBuilder(String basePath, BdkClientConfig clientConfig) {
            ApiClientBuilder apiClientBuilder = super.getApiClientBuilder(basePath, clientConfig);
            apiClientBuilder.addFilter(new JerseyCryptoFilter(config));
            return apiClientBuilder;
          }
        })
        .config(config)
        .build();

The concrete implementation is specifc to each HTTP client, this is why the API takes a generic object.

The HTTP clients implementations supported by the BDK both support
registering custom filters to intercept requests and responses. This can
be useful to add custom logic, trace requests, provide metrics or
support use cases such as Agentless.

Using the SymphonyBdkBuilder it is now possible to register such
filters.

For instance:

final SymphonyBdk bdk = new SymphonyBdkBuilder()
        .apiClientFactory(new ApiClientFactory(config){
          @OverRide
          protected ApiClientBuilder getApiClientBuilder(String basePath, BdkClientConfig clientConfig) {
            ApiClientBuilder apiClientBuilder = super.getApiClientBuilder(basePath, clientConfig);
            apiClientBuilder.addFilter(new JerseyCryptoFilter(config));
            return apiClientBuilder;
          }
        })
        .config(config)
        .build();

The concrete implementation is specifc to each HTTP client, this is why
the API takes a generic object.
Copy link
Copy Markdown
Member

@thibauult thibauult left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@vladokrsymphony vladokrsymphony merged commit 6fe3325 into finos:main Oct 14, 2025
3 of 4 checks passed
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.

3 participants