Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add custom domains to CORS allowlist #2666

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Jan 16, 2024

What does this PR do?

How is this resolved?

  • Adding a new env var CORS_ALLOWLIST
  • This is only populated on production where the API needs to be accessed from both editor.planx.uk and planningservices.COUNCIL.gov.uk
  • Rather than adding a new place to update the custom domains list I'm reading from the existing variable in the infrastructure project
  • In non-prod environments, we can just call back to the current value which is the EDITOR_URL_EXT env var

To test

  • I can log in / log out locally ✅
  • I can make a non-auth API request locally (e.g upload file) ✅
  • I can log in / log out on Pizza ✅
  • I can make a non-auth API request on Pizza (e.g upload file) ✅
  • I can log in / log out on Staging ✅
  • I can make a non-auth API request on Staging (e.g upload file) ✅
  • I can log in / log out on Prod ✅
  • I can make a non-auth API request on Prod (e.g upload file) ✅
  • I can log in / log out on a custom domain ✅
  • I can make a non-auth API request on a custom domain (e.g upload file) ✅

@DafyddLlyr DafyddLlyr force-pushed the dp/custom-subdomain-cors branch 4 times, most recently from 71a6409 to 33a60f4 Compare January 16, 2024 11:02
Copy link

github-actions bot commented Jan 16, 2024

Removed vultr server and associated DNS entries

@DafyddLlyr DafyddLlyr force-pushed the dp/custom-subdomain-cors branch 3 times, most recently from 6b323c1 to b11c160 Compare January 16, 2024 11:14
@@ -141,6 +141,7 @@ services:
SLACK_WEBHOOK_URL: ${SLACK_WEBHOOK_URL}
ORDNANCE_SURVEY_API_KEY: ${ORDNANCE_SURVEY_API_KEY}
MINIO_PORT: ${MINIO_PORT}
CORS_ALLOWLIST: ${EDITOR_URL_EXT}
Copy link
Contributor Author

@DafyddLlyr DafyddLlyr Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is just a "derived" env var, we actually don't need to add it to the .env files and we can just populate it here.

If this is unclear / unhelpful I can add it to the .env and .env.example files.

@DafyddLlyr DafyddLlyr force-pushed the dp/custom-subdomain-cors branch from 0abc5a9 to 8a6b2a2 Compare January 16, 2024 15:10
@DafyddLlyr DafyddLlyr force-pushed the dp/custom-subdomain-cors branch from 8a6b2a2 to 183eb8a Compare January 16, 2024 15:20
@DafyddLlyr DafyddLlyr marked this pull request as ready for review January 16, 2024 15:26
@DafyddLlyr DafyddLlyr mentioned this pull request Jan 16, 2024
Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pizza working as expected for me, thanks for getting to the bottom of this one!

@DafyddLlyr DafyddLlyr merged commit 2709f25 into main Jan 16, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/custom-subdomain-cors branch January 16, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants