Skip to content

Commit

Permalink
fix(SILVA-546): fixing amplify authentication (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj authored and jazzgrewal committed Nov 4, 2024
1 parent edb7eed commit 9dc788a
Show file tree
Hide file tree
Showing 39 changed files with 1,286 additions and 1,230 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: bcgov-nr/[email protected]
env:
VITE_ZONE: test
VITE_USER_POOLS_ID: ca-central-1_abc123
VITE_USER_POOLS_WEB_CLIENT_ID: abc123
VITE_BACKEND_URL: http://localhost:8080
with:
commands: |
npm ci
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
-p POSTGRES_DB_PASSWORD='${{ secrets.POSTGRES_DB_PASSWORD }}'
-p FORESTCLIENTAPI_KEY='${{ secrets.FORESTCLIENTAPI_KEY }}'
-p VITE_USER_POOLS_WEB_CLIENT_ID=${{ vars.VITE_USER_POOLS_WEB_CLIENT_ID }}
-p VITE_USER_POOLS_ID=${{ vars.VITE_USER_POOLS_ID }}
-p ZONE=test

deploys-test:
Expand Down Expand Up @@ -106,6 +107,7 @@ jobs:
-p POSTGRES_DB_PASSWORD='${{ secrets.POSTGRES_DB_PASSWORD }}'
-p FORESTCLIENTAPI_KEY='${{ secrets.FORESTCLIENTAPI_KEY }}'
-p VITE_USER_POOLS_WEB_CLIENT_ID=${{ vars.VITE_USER_POOLS_WEB_CLIENT_ID }}
-p VITE_USER_POOLS_ID=${{ vars.VITE_USER_POOLS_ID }}
-p ZONE=prod

image-promotions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
-p POSTGRES_DB_PASSWORD='${{ secrets.POSTGRES_DB_PASSWORD }}'
-p FORESTCLIENTAPI_KEY='${{ secrets.FORESTCLIENTAPI_KEY }}'
-p VITE_USER_POOLS_WEB_CLIENT_ID=${{ vars.VITE_USER_POOLS_WEB_CLIENT_ID }}
-p VITE_USER_POOLS_ID=${{ vars.VITE_USER_POOLS_ID }}
triggers: ('common/' 'backend/' 'frontend/')

builds:
Expand Down
4 changes: 4 additions & 0 deletions common/openshift.init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ parameters:
- name: VITE_USER_POOLS_WEB_CLIENT_ID
description: Cognito user pools web client ID
required: true
- name: VITE_USER_POOLS_ID
description: Cognito user pools ID
required: true
objects:
- apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -95,6 +98,7 @@ objects:
app: ${NAME}-${ZONE}
stringData:
vite-user-pools-web-client-id: ${VITE_USER_POOLS_WEB_CLIENT_ID}
vite-user-pools-id: ${VITE_USER_POOLS_ID}
- apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand Down
2 changes: 1 addition & 1 deletion frontend/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
handle /env.js {
header Content-Type "text/javascript"
respond `window.config = {"VITE_USER_POOLS_WEB_CLIENT_ID":"{$VITE_USER_POOLS_WEB_CLIENT_ID}","VITE_ZONE":"{$VITE_ZONE}","VITE_BACKEND_URL":"{$VITE_BACKEND_URL}"};`
respond `window.config = {"VITE_USER_POOLS_ID":"{$VITE_USER_POOLS_ID}","VITE_USER_POOLS_WEB_CLIENT_ID":"{$VITE_USER_POOLS_WEB_CLIENT_ID}","VITE_ZONE":"{$VITE_ZONE}","VITE_BACKEND_URL":"{$VITE_BACKEND_URL}"};`
}

handle_path /* {
Expand Down
5 changes: 5 additions & 0 deletions frontend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ objects:
secretKeyRef:
name: ${NAME}-${ZONE}-frontend
key: vite-user-pools-web-client-id
- name: VITE_USER_POOLS_ID
valueFrom:
secretKeyRef:
name: ${NAME}-${ZONE}-frontend
key: vite-user-pools-id
ports:
- containerPort: 3000
protocol: TCP
Expand Down
Loading

0 comments on commit 9dc788a

Please sign in to comment.