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

config: allow multiple cors origins #1572

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

taonic
Copy link
Contributor

@taonic taonic commented Aug 23, 2023

Description & motivation 💭

This config template change allows multiple CORS origins to be supplied via an comma separated env var.

Requested from: https://temporalio.slack.com/archives/CTTJCPZQE/p1692349771226649

Testing 🧪

Tested manually through:

dockerize -template ./config-template.yaml:./config/docker.yaml

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

This config template change allows multiple CORS origins to be supplied
via an comma separated env var.
@taonic taonic requested a review from a team as a code owner August 23, 2023 11:45
@taonic taonic requested review from GiantRobots and removed request for a team August 23, 2023 11:45
@vercel
Copy link

vercel bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
holocene ⬜️ Ignored (Inspect) Aug 23, 2023 11:45am

@rossedfort
Copy link
Contributor

@taonic did you test specifying a single and multiple origins for this change?

@rossedfort rossedfort merged commit 90de0ff into main Aug 23, 2023
10 checks passed
@rossedfort rossedfort deleted the taonic/allow_comma_separate_cors_origins branch August 23, 2023 16:14
@taonic
Copy link
Contributor Author

taonic commented Aug 24, 2023

@taonic did you test specifying a single and multiple origins for this change?

@rossedfort Yes, I should've added the test results. Better late than never.

Single:

✗ export TEMPORAL_CORS_ORIGINS=test.com
✗ dockerize -template config-template.yaml:docker.yaml
✗ grep -C 4 allowOrigins docker.yaml
batchActionsDisabled: false
hideWorkflowQueryErrors: false
cors:
  cookieInsecure: false
  allowOrigins:
    # override framework's default that allows all origins "*"
    - test.com
tls:
  caFile:

Multiple:

✗ export TEMPORAL_CORS_ORIGINS=test.com,test2.com
✗ dockerize -template config-template.yaml:docker.yaml
✗ grep -C 4 allowOrigins docker.yaml
batchActionsDisabled: false
hideWorkflowQueryErrors: false
cors:
  cookieInsecure: false
  allowOrigins:
    # override framework's default that allows all origins "*"
    - test.com
    - test2.com
tls:

Default:

✗ unset TEMPORAL_CORS_ORIGINS
✗ dockerize -template config-template.yaml:docker.yaml
✗ grep -C 4 allowOrigins docker.yaml
batchActionsDisabled: false
hideWorkflowQueryErrors: false
cors:
  cookieInsecure: false
  allowOrigins:
    # override framework's default that allows all origins "*"
    - "http://localhost:8080"
tls:
  caFile:

@karelbilek
Copy link

Also related:

temporalio/helm-charts#402

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.

5 participants