Mobility-Data-Space / mobility-data-space

Mobility Data Space ist the data sharing community for all actors who would like to design the mobility of tomorrow.
https://mobility-dataspace.eu
8 stars 1 forks source link

Double encoding of datasource url query parameters #30

Open IanPUiUk opened 11 months ago

IanPUiUk commented 11 months ago

Issue

Datasource URL parameters on an asset appear to be url-encoded twice, resulting in invalid queries at the datasource.

Steps:

  1. I have a datasource that accepts a date query parameter in the format 2023-10-13T00:00:00.000Z
  2. Using the mds ui dashboard I added an asset that had a query parameter name: since, value: 2023-10-13T00:00:00.000Z
  3. Set up a contract for the asset using the open policy
  4. Negotiated and attempted a transfer using a different broker

The transfer failed, with the datasource reporting bad-request. The query received by the datasource was https://...?since=2023-10-13T00%3A00%3A00.000Z

which appeared to be the datasource not decoding the url. However, the ingress logs showed the inbound request as

https://...?since=2023-10-13T00%253A00%253A00.000Z

indicating that the '%' char has been url encoded. Looking at the EDC database table edc_assets_dataaddress the query parameter is stored in it's url encoded form as 2023-10-13T00%3A00%3A00.000Z

So it appears that the url is being encoded twice: once when being stored in the edc database, then again when being sent to the datasource.

Expected Result

The datasource ingress receives https://...?since=2023-10-13T00%3A00%3A00.000Z, which can be correctly decoded to https://...?since=2023-10-13T00:00:00.000Z

ip312 commented 11 months ago

copypaste to https://github.com/sovity/edc-extensions/issues/582

ip312 commented 10 months ago

@IanPUiUk please double-check the summary