Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDC 0.5.1 HttpProxy is not being handled correctly #3954

Closed
ricardas-buc opened this issue Mar 4, 2024 · 1 comment · Fixed by #3956
Closed

EDC 0.5.1 HttpProxy is not being handled correctly #3954

ricardas-buc opened this issue Mar 4, 2024 · 1 comment · Fixed by #3956
Assignees
Labels
bug_report Suspected bugs, awaiting triage triage all new issues awaiting classification

Comments

@ricardas-buc
Copy link

Bug Report

Describe the Bug

HTTP requests are not being correctly proxied over data plane api. HTTP method is defaulting to GET, even though proxyMethod is enabled

Expected Behavior

Method should be proxied as per asset configuration.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Configure asset:
assetApi.createAsset(createObjectBuilder()
                    .add(CONTEXT, createObjectBuilder().add(VOCAB, EDC_NAMESPACE))
                    .add(TYPE, EDC_ASSET_TYPE)
                    .add(ID, assetId)
                    .add(EDC_ASSET_PROPERTIES, createObjectBuilder()
                            .add(PROPERTY_NAME, "Asset for service %s".formatted(assetId))
                            .add(PROPERTY_CONTENT_TYPE, MediaType.APPLICATION_JSON)
                            .build())
                    .add(EDC_ASSET_DATA_ADDRESS, createObjectBuilder()
                            .add("type", "HttpData")
                            .add("proxyPath", Boolean.TRUE.toString())
                            .add("proxyMethod", Boolean.TRUE.toString())
                            .add("proxyBody", Boolean.TRUE.toString())
                            .add("proxyQueryParams", Boolean.TRUE.toString())
                            .add("baseUrl", serviceBaseUrl)
                            //pass custom parameters
                            .add("assetId", assetId)
                            .build())
                    .build());
  1. Initiate transfer with destination set as HttpProxy
  2. Execute POST request against the endpoint.

Context Information

  • Used version EDC 0.5.

Possible cause

When data is proxied destination type is set to AsyncStreaming:

But when BaseSourceHttpParamsDecorator tries to extract HTTP method it fails as it tries to compare HttpProxy against AsyncStreaming:

if (Boolean.parseBoolean(address.getProxyMethod()) && "HttpProxy".equals(request.getDestinationDataAddress().getType())) {

Ofcourse I might be misconfiguring the asset, but as per samples it expects HttpProxy and not AsyncStreaming.

Copy link

github-actions bot commented Mar 4, 2024

Thanks for your contribution 🔥 We will take a look asap 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug_report Suspected bugs, awaiting triage triage all new issues awaiting classification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants