Skip to content

Commit

Permalink
refactor: separate cors origin for staging
Browse files Browse the repository at this point in the history
  • Loading branch information
chesedo committed May 14, 2024
1 parent 44519c3 commit 8d91ff3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ jobs:
gateway-admin-key:
description: "Admin API key that authorizes gateway requests to auth service, for key to jwt conversion."
type: string
cors-origin:
description: "Where CORS requests are allowed from"
type: string
permit-api-key:
description: "Permit.io API key for the Permit environment that matches the current ${SHUTTLE_ENV}."
type: string
Expand Down Expand Up @@ -386,6 +389,7 @@ jobs:
AUTH_JWTSIGNING_PRIVATE_KEY=${<< parameters.jwt-signing-private-key >>} \
CONTROL_DB_POSTGRES_URI=${<< parameters.control-db-postgres-uri >>} \
GATEWAY_ADMIN_KEY=${<< parameters.gateway-admin-key >>} \
CORS_ORIGIN=${<< parameters.cors-origin >>} \
PERMIT_API_KEY=${<< parameters.permit-api-key >>} \
make deploy
- when:
Expand Down Expand Up @@ -753,6 +757,7 @@ workflows:
jwt-signing-private-key: DEV_AUTH_JWTSIGNING_PRIVATE_KEY
control-db-postgres-uri: DEV_CONTROL_DB_POSTGRES_URI
gateway-admin-key: DEV_GATEWAY_ADMIN_KEY
cors_origin: getsynth.vercel.app
permit-api-key: STAGING_PERMIT_API_KEY
requires:
- build-and-push-unstable
Expand Down Expand Up @@ -838,6 +843,7 @@ workflows:
jwt-signing-private-key: PROD_AUTH_JWTSIGNING_PRIVATE_KEY
control-db-postgres-uri: PROD_CONTROL_DB_POSTGRES_URI
gateway-admin-key: PROD_GATEWAY_ADMIN_KEY
cors_origin: console.shuttle.rs
permit-api-key: PROD_PERMIT_API_KEY
ssh-fingerprint: 6a:c5:33:fe:5b:c9:06:df:99:64:ca:17:0d:32:18:2e
ssh-config-script: production-ssh-config.sh
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ DEV_SUFFIX=-dev
DEPLOYS_API_KEY?=gateway4deployes
GATEWAY_ADMIN_KEY?=dh9z58jttoes3qvt

CORS_ORIGIN?=localhost:3001

# this should use the same version as our prod RDS database
CONTROL_DB_POSTGRES_TAG?=15
CONTROL_DB_POSTGRES_PASSWORD?=postgres
Expand Down Expand Up @@ -126,6 +128,7 @@ DOCKER_COMPOSE_ENV=\
STRIPE_SECRET_KEY=$(STRIPE_SECRET_KEY)\
AUTH_JWTSIGNING_PRIVATE_KEY=$(AUTH_JWTSIGNING_PRIVATE_KEY)\
GATEWAY_ADMIN_KEY=$(GATEWAY_ADMIN_KEY)\
CORS_ORIGIN=$(CORS_ORIGIN)\
DD_ENV=$(DD_ENV)\
USE_TLS=$(USE_TLS)\
COMPOSE_PROFILES=$(COMPOSE_PROFILES)\
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ services:
- "--provisioner-uri=http://provisioner:8000"
- "--proxy-fqdn=${APPS_FQDN}"
- "--use-tls=${USE_TLS}"
- "--cors-origin=getsynth.vercel.app"
- "--cors-origin=${CORS_ORIGIN}"
- "--admin-key=${GATEWAY_ADMIN_KEY}"
- "--permit-api-uri=https://api.eu-central-1.permit.io"
- "--permit-pdp-uri=http://permit-pdp:7000"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ services:
- "--provisioner-uri=http://provisioner:8000"
- "--proxy-fqdn=${APPS_FQDN}"
- "--use-tls=${USE_TLS}"
- "--cors-origin=https://console.shuttle.rs"
- "--cors-origin=${CORS_ORIGIN}"
- "--admin-key=${GATEWAY_ADMIN_KEY}"
- "--permit-api-uri=https://api.eu-central-1.permit.io"
- "--permit-pdp-uri=http://permit-pdp:7000"
Expand Down

0 comments on commit 8d91ff3

Please sign in to comment.