Skip to content

Commit b29596e

Browse files
authored
Merge pull request #272 from satra/add-medit-cors-origin
Add medit.dandiarchive.org to CORS allowed origins
2 parents 5a512d7 + 3166c4e commit b29596e

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

terraform/api.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module "api_heroku" {
2424
AWS_ACCESS_KEY_ID = aws_iam_access_key.api_heroku_user.id
2525
AWS_DEFAULT_REGION = data.aws_region.current.region
2626
DJANGO_ALLOWED_HOSTS = "api.dandiarchive.org"
27-
DJANGO_CORS_ALLOWED_ORIGINS = join(",", ["https://dandiarchive.org", "https://neurosift.app"])
27+
DJANGO_CORS_ALLOWED_ORIGINS = join(",", concat(["https://dandiarchive.org"], local.allowed_external_services))
2828
DJANGO_CORS_ALLOWED_ORIGIN_REGEXES = join(",", ["^https:\\/\\/[0-9a-z\\-]+--gui-dandiarchive-org\\.netlify\\.app$"])
2929
DJANGO_DEFAULT_FROM_EMAIL = "info@dandiarchive.org"
3030
DJANGO_SETTINGS_MODULE = "dandiapi.settings.heroku_production"

terraform/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,10 @@ data "aws_region" "current" {}
5959
data "heroku_team" "dandi" {
6060
name = "dandi"
6161
}
62+
63+
locals {
64+
allowed_external_services = [
65+
"https://medit.dandiarchive.org",
66+
"https://neurosift.app",
67+
]
68+
}

terraform/staging.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module "api_sandbox_heroku" {
2424
AWS_ACCESS_KEY_ID = aws_iam_access_key.api_sandbox_heroku_user.id
2525
AWS_DEFAULT_REGION = data.aws_region.current.region
2626
DJANGO_ALLOWED_HOSTS = join(",", ["api.sandbox.dandiarchive.org"])
27-
DJANGO_CORS_ALLOWED_ORIGINS = join(",", ["https://sandbox.dandiarchive.org", "https://neurosift.app"])
27+
DJANGO_CORS_ALLOWED_ORIGINS = join(",", concat(["https://sandbox.dandiarchive.org"], local.allowed_external_services))
2828
DJANGO_CORS_ALLOWED_ORIGIN_REGEXES = join(",", ["^https:\\/\\/[0-9a-z\\-]+--sandbox-dandiarchive-org\\.netlify\\.app$"])
2929
DJANGO_DEFAULT_FROM_EMAIL = "info@sandbox.dandiarchive.org"
3030
DJANGO_SETTINGS_MODULE = "dandiapi.settings.heroku_production"

0 commit comments

Comments
 (0)