Context
The plugins (plugin-auth, plugin-identity) have already migrated from Fiber's cors.New() to lib-commons v4's chttp.WithCORS(). Midaz components still use cors.New() directly.
Problem
- Inconsistent CORS behavior between Midaz and plugins
- No security warnings when CORS wildcard (
*) is used in production
- No integration with the security tier configuration
- Each component configures CORS independently with potentially different settings
Proposed Change
Replace cors.New() with chttp.WithCORS() from lib-commons v4 in all Midaz components:
ledger
transaction
plugin-crm
onboarding
What chttp.WithCORS() provides
- Configurable via environment variables (consistent across services)
- Security warnings when wildcard origins are used
- Integration with the security tier model
- Same behavior already running in plugins
Acceptance Criteria
Context
The plugins (plugin-auth, plugin-identity) have already migrated from Fiber's
cors.New()to lib-commons v4'schttp.WithCORS(). Midaz components still usecors.New()directly.Problem
*) is used in productionProposed Change
Replace
cors.New()withchttp.WithCORS()from lib-commons v4 in all Midaz components:ledgertransactionplugin-crmonboardingWhat
chttp.WithCORS()providesAcceptance Criteria
chttp.WithCORS()instead ofcors.New()