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

Headers are not sent to Datasource endpoint #596

Closed
epanagou-ubitech opened this issue Nov 7, 2023 · 4 comments
Closed

Headers are not sent to Datasource endpoint #596

epanagou-ubitech opened this issue Nov 7, 2023 · 4 comments
Assignees
Labels
clean-backlog requires backlog cleaning kind/bug Something isn't working

Comments

@epanagou-ubitech
Copy link

epanagou-ubitech commented Nov 7, 2023

Bug Report

May be related to (consider solving all related items in one instance):

Description

When creating an asset it is possible to add additional headers to be passed to the Datasource endpoint.
For this purpose, in the create asset request, we added an x-api-key header and set its value to peanutbutter so that the https://w3id.org/edc/v0.0.1/ns/dataAddress field looks like this:

"https://w3id.org/edc/v0.0.1/ns/dataAddress": {
    "https://w3id.org/edc/v0.0.1/ns/type": "HttpData",
    "https://w3id.org/edc/v0.0.1/ns/baseUrl": "{{PROVIDER_EDC_SOURCE_URL}}",
    "https://w3id.org/edc/v0.0.1/ns/method": "GET",
    "https://w3id.org/edc/v0.0.1/ns/header:x-api-key": "peanutbutter"
}

Using this created asset, and following the rest of the steps in the postman collection, we managed to start the data push.
Our Datasource endpoint was hit correctly, however, the x-api-key header was not received.

Expected Behavior

Upon transfer, we expect the additional headers to arrive to the Datasource endpoint.

Observed Behavior

Upon transfer, no additional headers arrived to the Datasource endpoint.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Import the postman collection in Postman
  2. In Variables, set PROVIDER_EDC_SOURCE_URL to a simple server that prints the headers of all requests it receives. We used this gist.
  3. Go to request 1 Create Asset, then Body and add the following inside the https://w3id.org/edc/v0.0.1/ns/dataAddress field:
"https://w3id.org/edc/v0.0.1/ns/method": "GET",
"https://w3id.org/edc/v0.0.1/ns/header:x-api-key": "peanutbutter"
  1. Send the rest of the requests in order: 2 Create Simple Policy, 3 Create ContractDefinition, 5 Start Negotiation, 6 Request Contract Agreements
  2. Get the contract agreement @id from the response of 6 Request Contract Agreements and paste it in the Body of 7 Start Data Push replacing the value of https://w3id.org/edc/v0.0.1/ns/contractId.
  3. Send the 7 Start Data Push request
  4. Check your Datasource server logs, where the x-api-key header is missing from the received request.

Context Information

  • Used version

    • edc: ghcr.io/sovity/edc-dev:5.0.0
    • edc-ui: ghcr.io/sovity/edc-ui:2.0.0
  • OS: Linux

Possible Implementation and Work Breakdown

This is possibly a regression since it was working with the following versions:

  • edc: ghcr.io/sovity/edc-ce-mds:4.1.0
  • edc-ui: v0.0.1-milestone-8-sovity12
@epanagou-ubitech epanagou-ubitech added the kind/bug Something isn't working label Nov 7, 2023
@epanagou-ubitech
Copy link
Author

The issue persists with the following environment:

  • ghcr.io/sovity/edc-dev:7.0.0
  • ghcr.io/sovity/edc-ui:2.2.0

@tmberthold
Copy link
Member

Hello and thank you for reporting - we'll take a look at it.

@AbdullahMuk AbdullahMuk assigned richardtreier and unassigned efiege Jan 22, 2024
@bearn01d
Copy link

bearn01d commented Feb 7, 2024

Probably related: sovity/edc-ui#702

@AbdullahMuk AbdullahMuk added the clean-backlog requires backlog cleaning label May 2, 2024
@tmberthold
Copy link
Member

Should work by now, if not please let us know again. However, the properties should be as follows in the dataAddress:

authKey -> optional authentication header, e.g. "X-Api-Key"
authCode -> optional authentication value, such as the actual API-key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean-backlog requires backlog cleaning kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants