PharmaLedger-IMI / acdc-components

UC4 Anti-Counterfeiting Data Collaboration
MIT License
3 stars 4 forks source link

Reporting service appears to be using hardcoded path acdc/scan instead of product-configured URL #23

Closed joaoluis-pdm closed 2 years ago

joaoluis-pdm commented 2 years ago

Pre-condition: https://github.com/PharmaLedger-IMI/acdc-components/issues/24 must be solved before this one.

In the reporting service

epi-workspace version 0619f33d8b1dc0e8620132612196d34ecb940b93

https://github.com/PharmaLedger-IMI/epi-workspace/blob/b6d45f67b6ab2f404a0925f3c92cea7b5c89c970/reporting-service/middleware/acdc-middleware.js#L38

acdc-components 01fe38e045c5792fba476ed4dcff323addefc84f

https://github.com/PharmaLedger-IMI/acdc-components/blob/24262b047e432ae5509b22742aadc0f4d9413b4c/reporting-service/middleware/acdc-middleware.js#L38

it seems that the URL configured at the product DSU is being ignored and the path "acdc/scan" hard-coded: image

And as such, the reports are being sent to a non-existent URL.

(This bug probably exists before epi-workspace integration).

joaoluis-pdm commented 2 years ago

Workaround using haporxy set-path ? (http://docs.haproxy.org/2.0/configuration.html#4.2-http-request%20set-path)

joaoluis-pdm commented 2 years ago

/acdc/scan should work in the acdv-dev. and acdc-tst.pharmaledger.pdmfc.com environment, a workaround was added to /etc/haproxy/haproxy.cfg

        acl acdc-rest-scan path_beg /acdc/scan
        http-request set-path /borest/scan if acdc-rest-scan

Verified on the acdc-dev environment.

joaoluis-pdm commented 2 years ago

Seems fixed since https://github.com/PharmaLedger-IMI/epi-workspace/commit/aaa748c2090a6ee696adb82fcedc020c9ffdf1aa#diff-8f25c3de5ad366ec7fca987dcc4ae687843915c43d82ce9a58d9eae3af70c4caR279