geobeyond / Arpav-PPCV-backend

Backend di Piattaforma Proiezioni Climatiche per il Nord-Est.
Creative Commons Attribution 4.0 International
0 stars 1 forks source link

Added CORS middleware to API v2 app #105

Closed ricardogsilva closed 2 months ago

ricardogsilva commented 2 months ago

This PR enables the CORS middleware on the V2 API application. It follows the docs on the relevant FastAPI section.

CORS origins, methods and auth are hooked up to our settings and can be configured by means of env variables. For security purposes, the default settings disallow all origins, disallow all methods and disable CORS auth.

The dev compose file enables all origins and all methods.

NOTE

The staging environment needs to be updated to also enable the relevant settings in order to this to work as expected on staging.