Open tfjanjua opened 1 month ago
@ntruchsess / @Phil91 / @evegufy as i remember we discussed on this topic in the open meeting. from my perspective it is fine to route the traffic from frontend -> backend -> to bpdm but i would like to hear your oppinion.
@tfjanjua we are currently focusing on stabilizing the 24.12 release it may take a bit until we focus on new features
We could extend the helm chart adding a reverse proxy entry to the backend ingress controller forwarding path /pool/v6
to the BPDM backend: https://github.com/eclipse-tractusx/portal/blob/main/charts/portal/values.yaml#L231-L260
This way we could access the api through portal-backend URL and on frontend side simply change the BPDM_POOL_API_URL from https://business-partners.example.org/pool/v6 to https://portal-backend.example.org/pool/v6 https://github.com/eclipse-tractusx/portal-frontend/blob/main/index.html#L39
Note 1: technically it should also be possible adding the path to the frontend ingress controller, but that seems not the right location.
Note 2: thinking the idea further we could add all backend api paths to one combined ingress controller / reverse proxy to access ALL urls through the main portal host url like (examples): https://portal.example.org/ https://portal.example.org/api/administration https://portal.example.org/pool/v6/ Getting rid of different hostnames would not only reduce the config values on frontend side but we would also get rid of the CORS issues because all would be same origin from browser perspective
Description
We need to develop an API in portal-backend to get data from partner-network-pool instead of calling business-partner-pool service directly from the portal-frontend. This approach will make it consistent and secure, as we are already been calling business-partner-pool service from portal-backed to get legal-entity data by BPN.
API: https://business-partners-pool.example.com/v6/members/legal-entities/search?page=0&size=10
Acceptance Criteria
Additional Information
There is a BpnAccess.cs file already exists in backend repo which is already been calling one of the business-partner-pool service's APIs to fetch the legal entity by BPN so, we can use same file and add another method to fetch partner-network-pool data.
Portal-Frontend is already been checking
view_partner_network
role to show partner-network table on UI so, same role (view_partner_network) can be used for this new API of portal-backend and get data from business-partner-pool service.Currently portal-frontend is been directly calling business-partner-pool API: url: https://business-partners-pool.example.com/v6/members/legal-entities/search?page=0&size=10 request data:
{ "bpnLs": [""], "legalName": "" }
OR request data:{ "bpnLs": ["BPNL000000000065"], "legalName": "" }
Expected Result / Test Cases
Functionality and Test Cases should work as they are working right now because with this change, portal-frontend would be getting partner-network data from portal-backend instead of getting data directly from business-partner-pool and portal-backend would be calling business-partner-pool service internally and responding data to frontend.
Corresponding Configuration Ticket
https://github.com/eclipse-tractusx/portal/issues/457