Skip to content

Commit

Permalink
Adding cola middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
mel-am committed Jul 4, 2024
1 parent 6ccf821 commit 063149a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 41 deletions.
70 changes: 35 additions & 35 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
AUTH_SIGN_IN_URL="https://cola.service.cabinetoffice.gov.uk/v2/<TEST>/login"
AWS_ACCESS_KEY_ID="DUMMYIDEXAMPLE"
AWS_SECRET_ACCESS_KEY="DUMMYEXAMPLEKEY"
BASE_URL="http://localhost:3000"
CDN_HOST="test"
COOKIE_ID_NAME="github-requests"
COOKIE_PARSER_SECRET="test"
COOKIE_SESSION_SECRET="test"
AUTH_SIGN_IN_URL=https://cola.service.cabinetoffice.gov.uk/v2/<TEST>/login
AWS_ACCESS_KEY_ID=DUMMYIDEXAMPLE
AWS_SECRET_ACCESS_KEY=DUMMYEXAMPLEKEY
BASE_URL=http://localhost:3000
CDN_HOST=test
COOKIE_ID_NAME=github-requests
COOKIE_PARSER_SECRET=test
COOKIE_SESSION_SECRET=test
DEPARTMENT_NAME="Cabinet Office"
DYNAMO_ADMIN_PORT=8001
DYNAMO_PORT=8000
DYNAMO_ENDPOINT="http://dynamodb-local:${DYNAMO_PORT}"
DYNAMO_TABLE_NAME="github-requests-submissions"
DEPARTMENT_NAME="Cabinet Office"
FEATURE_FLAG_ENABLE_AUTH="true"
FEATURE_FLAG_ENABLE_DYNAMO="true"
FEATURE_FLAG_ENABLE_NOTIFY="true"
GITHUB_KEY="test"
GITHUB_ORG_NAME="cabinetoffice"
GITHUB_OWNER="test"
GITHUB_REPO_ISSUE_ASSIGNEE="test"
GITHUB_REPO_ISSUE_LABEL="test"
GITHUB_TERRAFORM_REPO="test"
HUMAN="true"
LOG_LEVEL="info"
NODE_ENV="production"
NOTIFY_API_KEY="test"
NOTIFY_EMAIL_TEMPLATE="test"
NOTIFY_USER_EMAIL="test"
NOTIFY_TEAM_EMAIL="test"
NODE_SSL_ENABLED="false"
PATH_SSL_CERTIFICATE="./infrastructure/host/test.key"
PATH_SSL_PRIVATE_KEY="./infrastructure/host/test.cert"
DYNAMO_ENDPOINT=http://dynamodb-local:${DYNAMO_PORT}
DYNAMO_TABLE_NAME=github-requests-submissions
FEATURE_FLAG_ENABLE_AUTH=true
FEATURE_FLAG_ENABLE_DYNAMO=true
FEATURE_FLAG_ENABLE_NOTIFY=true
GITHUB_KEY=test
GITHUB_ORG_NAME="Cabinet Office"
GITHUB_OWNER=test
GITHUB_REPO_ISSUE_ASSIGNEE=test
GITHUB_REPO_ISSUE_LABEL=test
GITHUB_TERRAFORM_REPO=test
HUMAN=true
LOG_LEVEL=info
NODE_ENV=production
NOTIFY_API_KEY=test
NOTIFY_EMAIL_TEMPLATE=test
NOTIFY_USER_EMAIL=test
NOTIFY_TEAM_EMAIL=test
NODE_SSL_ENABLED=false
PATH_SSL_CERTIFICATE=./infrastructure/host/test.key
PATH_SSL_PRIVATE_KEY=./infrastructure/host/test.cert
PORT=3000
REGION="eu-west-1"
SESSION_APP_KEY="git"
SESSION_ID_NAME="connect.sid"
USER_POOL_CLIENT_ID="test"
USER_POOL_ID="test"
REGION=eu-west-1
SESSION_APP_KEY=git
SESSION_ID_NAME=connect.sid
USER_POOL_CLIENT_ID=test
USER_POOL_ID=test
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,46 @@ The issue is then reviewed by the team, and further comments may be requested if
### Config variables

| Key | Description | Example Value |
|-----------------------------|---------------------------------------------------------------------|---------------------------------------------------------- |
|-----------------------------|---------------------------------------------------------------------|--------------------------------------------------------------------|
| AUTH_SIGN_IN_URL | Authentication sign in URL | `https://cola.service.cabinetoffice.gov.uk/v2/<YOUR_SERVICE>/login`|
| AWS_ACCESS_KEY_ID | AWS access key ID | `[aws key ID]` |
| AWS_SECRET_ACCESS_KEY | AWS secret key ID | `secret` |
| BASE_URL | Base application URL | `http://localhost:3000` (dev mode) |
| CDN_HOST | CDN host | `cdn_domain` |
| COOKIE_ID_NAME | The name of the cookie | `github-requests` |
| COOKIE_PARSER_SECRET | Secret used in validating/calculating the cookie signature | `secret` |
| COOKIE_SESSION_SECRET | Secret key for signing the session cookie | `secret` |
| DEPARTMENT_NAME | Name of government department | `Cabinet Office` |
| DYNAMO_ADMIN_PORT | Port for local containerised DynamoDB admin page | `8001` (dev mode) |
| DYNAMO_PORT | Port for local containerised DynamoDB database | `8000` (dev mode) |
| DYNAMO_ENDPOINT | URL used to access the DynamoDB service in a specific AWS region | `http://dynamodb-local:${DYNAMO_PORT}` (dev mode) |
| DYNAMO_TABLE_NAME | Name of DynamoDB table | `test-github-requests-submissions` (dev mode) |
| FEATURE_FLAG_ENABLE_AUTH | Enable authentication feature flag | `true` or `false` |
| FEATURE_FLAG_ENABLE_DYNAMO | Enable DynamoDB feature flag | `true` or `false` |
| FEATURE_FLAG_ENABLE_NOTIFY | Enable Notify feature flag | `true` or `false` |
| GITHUB_KEY | GitHub key | `[github key]` |
| GITHUB_OWNER | GitHub organisation name | `cabinetoffice` |
| GITHUB_ORG_NAME | GitHub organisation name | `Cabinet Office` |
| GITHUB_OWNER | GitHub owner | `cabinetoffice` |
| GITHUB_REPO_ISSUE_ASSIGNEE | GitHub team responsible to solve issues and update configs files | `IDP_TEAM` |
| GITHUB_REPO_ISSUE_LABEL | GitHub label to categorize the related issues | `github-requests-app` |
| GITHUB_TERRAFORM_REPO | GitHub private repo with terraform configurations with members, repos and teams files | `github-requests-terraform` |
| HUMAN | Formatting messages form (default JSON) | `true` (Enable human formatting for log messages) |
| LOG_LEVEL | Logging levels | `info` |
| NODE_ENV | Node environment | `development` or `production` |
| NODE_SSL_ENABLED | Whether SSL is enabled for Node | `true` or `false` |
| NODE_SSL_ENABLED | Node SSL | `true` or `false` |
| NOTIFY_API_KEY | API Key for Notify service | `[notify api key]` |
| NOTIFY_EMAIL_TEMPLATE | Email template for Notify service | `Template name` |
| NOTIFY_USER_EMAIL | Email to contact from Notify service | `[email protected]` |
| NOTIFY_TEAM_EMAIL | Team email to contact from Notify service | `[email protected]` |
| PATH_SSL_CERTIFICATE | Path to SSL certificate | `./infrastructure/host/test.cert` |
| PATH_SSL_PRIVATE_KEY | Path to SSL private key | `./infrastructure/host/test.key` |
| PORT | Server port number | `3000` |
| REGION | AWS Region | `eu-west-1` |
| SESSION_APP_KEY | Session application key | `git` |
| SESSION_ID_NAME | Session ID name | `connect.sid` |
| USER_POOL_CLIENT_ID | Client ID of an app registered with the user pool in Amazon Cognito | `secret` |
| USER_POOL_ID | ID of the user pool in Amazon Cognito | `secret` |


## Launching the web-app

### Prerequisites
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ services:
- COOKIE_ID_NAME=${COOKIE_ID_NAME}
- COOKIE_PARSER_SECRET=${COOKIE_PARSER_SECRET}
- COOKIE_SESSION_SECRET=${COOKIE_SESSION_SECRET}
- DEPARTMENT_NAME=${DEPARTMENT_NAME}
- DYNAMO_ENDPOINT=${DYNAMO_ENDPOINT}
- DYNAMO_TABLE_NAME=${DYNAMO_TABLE_NAME}
- FEATURE_FLAG_ENABLE_AUTH=${FEATURE_FLAG_ENABLE_AUTH}
- FEATURE_FLAG_ENABLE_DYNAMO=${FEATURE_FLAG_ENABLE_DYNAMO}
- FEATURE_FLAG_ENABLE_NOTIFY=${FEATURE_FLAG_ENABLE_NOTIFY}
- GITHUB_KEY=${GITHUB_KEY}
- GITHUB_ORG_NAME=${GITHUB_ORG_NAME}
- GITHUB_OWNER=${GITHUB_OWNER}
- GITHUB_REPO_ISSUE_ASSIGNEE=${GITHUB_REPO_ISSUE_ASSIGNEE}
- GITHUB_REPO_ISSUE_LABEL=${GITHUB_REPO_ISSUE_LABEL}
- GITHUB_TERRAFORM_REPO=${GITHUB_TERRAFORM_REPO}
- DEPARTMENT_NAME=${DEPARTMENT_NAME}
- GITHUB_ORG_NAME=${GITHUB_ORG_NAME}
- HUMAN=${HUMAN}
- LOG_LEVEL=${LOG_LEVEL}
- NODE_ENV=${NODE_ENV}
Expand Down

0 comments on commit 063149a

Please sign in to comment.