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

Have CORS_ALLOWED_ORIGINS change based on environment #444

Open
2 tasks done
TangoYankee opened this issue Apr 2, 2022 · 0 comments
Open
2 tasks done

Have CORS_ALLOWED_ORIGINS change based on environment #444

TangoYankee opened this issue Apr 2, 2022 · 0 comments
Labels
component: backend maintenance Describes maintenance oriented items and tasks risk: medium status: ready to work on Prioritized and ready for a contributor to move to "In Progress"

Comments

@TangoYankee
Copy link
Member

Is your feature request related to a problem? Please describe.
Allowed origins should be based on the environment where the application is running

Describe the solution you'd like
Based on an environment variable, change the allowed origins to match the environment.

  • Develop Env: ["http://localhost:3000", "http://127.0.0.1:3000", "http://lvh.me"]
  • Prod Env: ["https://woaq.org"]

Describe alternatives you've considered
Leaving the settings hard-coded and all origins available in all environments

Additional context
Hard coding the options is a quick and dirty way to get the initial feature working. However, this means that the production api can be accessed from local instances of the application. The production api should only be available to the production site.

Labels

  • Add a status label
    • needs definition
    • needs help
    • ready to work on
    • in progress
    • backlog
  • Add additional labels as needed

For Developers

Affected Components
CORS_ALLOWED_ORIGINS list

Technical Resources
Python Django Environment Variables

Testing Outline
Manual testing prod and develop envs

@TangoYankee TangoYankee added status: ready to work on Prioritized and ready for a contributor to move to "In Progress" component: backend maintenance Describes maintenance oriented items and tasks risk: medium labels Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: backend maintenance Describes maintenance oriented items and tasks risk: medium status: ready to work on Prioritized and ready for a contributor to move to "In Progress"
Projects
None yet
Development

No branches or pull requests

1 participant