Skip to content

Commit

Permalink
Ajout du site vitrine dans les autorisations CORS pour que le menu pu…
Browse files Browse the repository at this point in the history
…isse être récupéré en javascript.

cf. https://trello.com/c/Al8NdDub/355-unifier-les-boutons-du-menu

L'autorisation est limitée au site vitrine plutôt que `*`.
Il sera toujours possible d'élargir plus tard si on a une API par exemple.
  • Loading branch information
sblondon committed Feb 4, 2025
1 parent 76ddfbb commit 571c58d
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 85 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ django-hosts = "~=6.0"
django-csp= "~=4.0b1"
sib-api-v3-sdk = "~=7.6.0"
openpyxl = "~=3.1.5"
django-cors-headers = "~=4.6.0"

[dev-packages]
pytest-django = "*"
Expand Down
178 changes: 93 additions & 85 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions impact/impact/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
"django.contrib.postgres",
"django_vite",
"anymail",
"corsheaders",
"django_hosts",
]
MIDDLEWARE = [
"corsheaders.middleware.CorsMiddleware",
"django_hosts.middleware.HostsRequestMiddleware",
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
Expand Down Expand Up @@ -349,3 +351,7 @@
SITES_FACILES_BASE_URL = os.getenv(
"SITES_FACILES_BASE_URL", "https://portail-rse.beta.gouv.fr"
)

# Élargissement autorisation CORS pour sites-faciles
# sert pour le menu qui est téléchargé depuis le site de gestion
CORS_ALLOWED_ORIGINS = [SITES_FACILES_BASE_URL]

0 comments on commit 571c58d

Please sign in to comment.