-
Notifications
You must be signed in to change notification settings - Fork 198
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 cors stategy for Java/NodeJs/Python #2001
Conversation
...do/api/java/src/main/java/com/microsoft/azure/simpletodo/configuration/WebConfiguration.java
Outdated
Show resolved
Hide resolved
...do/api/java/src/main/java/com/microsoft/azure/simpletodo/configuration/WebConfiguration.java
Outdated
Show resolved
Hide resolved
Repoman Generation ResultsRepoman pushed changes to remotes for the following projects: Project: todo-csharp-cosmos-sqlRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/2001 View Changes | Compare Changes Project: todo-csharp-sql-swa-funcRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-csharp-sql-swa-func -b pr/2001 View Changes | Compare Changes Project: todo-csharp-sqlRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-csharp-sql -b pr/2001 View Changes | Compare Changes Project: todo-java-mongo-acaRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-java-mongo-aca -b pr/2001 View Changes | Compare Changes Project: todo-java-mongoRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-java-mongo -b pr/2001 View Changes | Compare Changes Project: todo-nodejs-mongo-acaRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/2001 View Changes | Compare Changes Project: todo-nodejs-mongo-aksRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-aks -b pr/2001 View Changes | Compare Changes Project: todo-nodejs-mongo-swa-funcRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/2001 View Changes | Compare Changes Project: todo-nodejs-mongoRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo -b pr/2001 View Changes | Compare Changes Project: todo-nodejs-mongo-terraformRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-nodejs-mongo-terraform -b pr/2001 View Changes | Compare Changes Project: todo-python-mongo-acaRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-aca -b pr/2001 View Changes | Compare Changes Project: todo-python-mongo-swa-funcRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/2001 View Changes | Compare Changes Project: todo-python-mongoRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo -b pr/2001 View Changes | Compare Changes Project: todo-python-mongo-terraformRemote: azure-samples-stagingBranch: pr/2001You can initialize this project with: azd init -t Azure-Samples/todo-python-mongo-terraform -b pr/2001 View Changes | Compare Changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the great work and the fix! I just have a few comments.
fix: #1057
This PR re-designs the CORS strategy for the
api
service.There are 2 layers where CORS (allowed-orings) can be configured:
Not every Azure service supports the CORS configuration on
infra
layer. For example, Azure Container Apps does not support the CORS configuration on infra layer.Old stategy
runtime server
runtime server
when it is not supported oninfra layer
, like Azure container apps.REACT_APP_WEB_BASE_URL
which is used by the api server as a valid origin.Old strategy issues
New Strategy
API_ENVIRONMENT=develop
makes application to allow all origins onruntime server
layer.tasks.json
andlauch.json
to set this env var when lauching the app locally, so CORS is disabled.API_ALLOW_ORIGINS
as a way for customers to define a list of allowed origins for theruntime service
layer.Notes
infra layer
runtime server
configured and serving the api backend.