From 74c1b7b3cd7751a7537902a6a9b74059df49dfb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Baudchon?= Date: Fri, 26 Jun 2026 15:22:53 +0200 Subject: [PATCH] fix(module-federation): update WillPayment URLs from /order/payment/ to /payment/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In PCI module: merge prod and labeu env branches into a single relative-path branch, remove obsolete VITE_WP_LABEU_ENTRY_POINT env var, and add CDN cache-busting (?v=ISO-minute) duplicating Manager/billing pattern. Refs: MANAGER-21788 Signed-off-by: Michaƫl Baudchon --- .../src/utils/module-federation-runtime.ts | 15 ++++++++------- .../src/common/module-federation-helper.js | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/manager/apps/pci-project/src/utils/module-federation-runtime.ts b/packages/manager/apps/pci-project/src/utils/module-federation-runtime.ts index 2029fa184180..e5f8b9426b83 100644 --- a/packages/manager/apps/pci-project/src/utils/module-federation-runtime.ts +++ b/packages/manager/apps/pci-project/src/utils/module-federation-runtime.ts @@ -5,15 +5,16 @@ import { isLabeuEnvironment, isProdEnvironment } from './environment'; export { isProdEnvironment }; const getWillPaymentUrl = (): string => { - /** In preprod and prod environments, use a relative path to mitigate potential DDOS attacks */ - if (isProdEnvironment()) { - return '/order/payment/assets/remoteEntry.js'; + // ISO date prefix truncated to the minute: "2026-06-26T14:30" + // Used as CDN cache-busting query parameter (duplicated from Manager/billing pattern) + const minute = new Date().toISOString().slice(0, 16); + + /** In known OVHcloud environments (production and labeu), use a relative path to mitigate potential DDOS attacks */ + if (isProdEnvironment() || isLabeuEnvironment()) { + return `/payment/assets/remoteEntry.js?v=${minute}`; } - return ( - (isLabeuEnvironment() && import.meta.env.VITE_WP_LABEU_ENTRY_POINT) || - 'https://www.ovhcloud.com/order/payment/assets/remoteEntry.js' - ); + return `https://www.ovhcloud.com/payment/assets/remoteEntry.js?v=${minute}`; }; /** diff --git a/packages/manager/modules/billing/src/common/module-federation-helper.js b/packages/manager/modules/billing/src/common/module-federation-helper.js index 09ebfdefcd6e..5fc3915b3fd7 100644 --- a/packages/manager/modules/billing/src/common/module-federation-helper.js +++ b/packages/manager/modules/billing/src/common/module-federation-helper.js @@ -18,11 +18,11 @@ const getWillPaymentUrl = () => { if (isLabeuEnvironment()) { return ( getLabeuEntryPoint() || - 'https://www.ovhcloud.com/order/payment/assets/remoteEntry.js' + 'https://www.ovhcloud.com/payment/assets/remoteEntry.js' ); } - return 'https://www.ovhcloud.com/order/payment/assets/remoteEntry.js'; + return 'https://www.ovhcloud.com/payment/assets/remoteEntry.js'; }; exports.isLabeuEnvironment = isLabeuEnvironment;