Skip to content

Commit

Permalink
Merge pull request #10277 from flexion/10007-DOD-remove-triggers
Browse files Browse the repository at this point in the history
10007 DOD: Remove cognito triggers
  • Loading branch information
rachelschneiderman authored Mar 4, 2024
2 parents 16d9ea3 + 18427e0 commit b5bdaf5
Show file tree
Hide file tree
Showing 62 changed files with 237 additions and 1,607 deletions.
183 changes: 64 additions & 119 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,43 +143,43 @@ jobs:
name: Setup Elasticsearch Index Settings
command: |
./web-api/setup-elasticsearch-index.sh $ENV
# - run: TODO 10007 Cleanup: Put this step back after 10007 has been deployed
# name: Admin User Setup
# command: |
# if [ "${CIRCLE_BRANCH}" != "prod" ] && [ "$DEPLOY_EMPTY_PERSISTENCE" != "true" ]; then
# npx ts-node --transpile-only shared/admin-tools/user/setup-admin.ts
# else
# echo "skipping…"
# fi
# - run:
# name: Test Users Setup
# command: |
# if [ "${CIRCLE_BRANCH}" != "prod" ] && [ "$DEPLOY_EMPTY_PERSISTENCE" != "true" ]; then
# ./shared/admin-tools/user/setup-test-users.sh $ENV
# else
# echo "skipping…"
# fi
# - run:
# name: Judge Users Setup
# environment:
# FILE_NAME: ./scripts/circleci/judge/judge_users.csv
# command: |
# if [ "${CIRCLE_BRANCH}" == "prod" ] || [ "$DEPLOY_EMPTY_PERSISTENCE" == "true" ]; then
# echo "skipping…"
# exit 0
# fi
# if [ "${CIRCLE_BRANCH}" == "test" ]; then
# SOURCE_DOMAIN=$(./scripts/elasticsearch/get-source-elasticsearch.sh "${ENV}")
# ELASTICSEARCH_ENDPOINT=$(aws es describe-elasticsearch-domain \
# --domain-name "${SOURCE_DOMAIN}" \
# --region "us-east-1" \
# --query 'DomainStatus.Endpoint' \
# --output text)
# export ELASTICSEARCH_ENDPOINT="$ELASTICSEARCH_ENDPOINT"
# npx ts-node --transpile-only ./shared/admin-tools/user/setup-glued-judges.ts
# else
# ./scripts/circleci/judge/bulk-import-judge-users.sh
# fi
- run:
name: Admin User Setup
command: |
if [ "${CIRCLE_BRANCH}" != "prod" ] && [ "$DEPLOY_EMPTY_PERSISTENCE" != "true" ]; then
npx ts-node --transpile-only shared/admin-tools/user/setup-admin.ts
else
echo "skipping…"
fi
- run:
name: Test Users Setup
command: |
if [ "${CIRCLE_BRANCH}" != "prod" ] && [ "$DEPLOY_EMPTY_PERSISTENCE" != "true" ]; then
./shared/admin-tools/user/setup-test-users.sh $ENV
else
echo "skipping…"
fi
- run:
name: Judge Users Setup
environment:
FILE_NAME: ./scripts/circleci/judge/judge_users.csv
command: |
if [ "${CIRCLE_BRANCH}" == "prod" ] || [ "$DEPLOY_EMPTY_PERSISTENCE" == "true" ]; then
echo "skipping…"
exit 0
fi
if [ "${CIRCLE_BRANCH}" == "test" ]; then
SOURCE_DOMAIN=$(./scripts/elasticsearch/get-source-elasticsearch.sh "${ENV}")
ELASTICSEARCH_ENDPOINT=$(aws es describe-elasticsearch-domain \
--domain-name "${SOURCE_DOMAIN}" \
--region "us-east-1" \
--query 'DomainStatus.Endpoint' \
--output text)
export ELASTICSEARCH_ENDPOINT="$ELASTICSEARCH_ENDPOINT"
npx ts-node --transpile-only ./shared/admin-tools/user/setup-glued-judges.ts
else
./scripts/circleci/judge/bulk-import-judge-users.sh
fi
- run:
name: 'Deploy - Web Client - S3'
command: |
Expand All @@ -200,10 +200,6 @@ jobs:
name: 'Deploy - Verify Private Elasticsearch'
command: |
npm run verify-private-elasticsearch -- $ENV
- run:
name: 'Deploy - Verify Cognito Lambda Triggers'
command: |
npm run verify-cognito-lambda-triggers -- $ENV
- run:
name: 'Deploy - Verify USTC Admin User Disabled'
command: |
Expand Down Expand Up @@ -354,9 +350,9 @@ jobs:
name: Setup Env
command: |
./scripts/env/env-for-circle.sh
# - run: TODO 10007 Cleanup: Put this step back after 10007 has been deployed
# name: 'Disable Maintenance Mode'
# command: npm run maintenance:disengage $ENV
- run:
name: 'Disable Maintenance Mode'
command: npm run maintenance:disengage $ENV
- run:
name: 'Cypress Smoke Tests'
command: npm run cypress:smoketests
Expand Down Expand Up @@ -861,42 +857,6 @@ jobs:
command: |
npm run destroy:glue-cron -- $ENV
engage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/prod
docker:
- image: *efcms-docker-image
aws_auth:
aws_access_key_id: $AWS_ACCESS_KEY_ID
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY
resource_class: medium
steps:
- git-shallow-clone/checkout
- npm-install
- run:
name: Setup Env
command: |
./scripts/env/env-for-circle.sh
- run:
name: 'Engage Maintenance Mode'
command: npm run maintenance:engage $ENV

disengage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/prod
docker:
- image: *efcms-docker-image
aws_auth:
aws_access_key_id: $AWS_ACCESS_KEY_ID
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY
resource_class: medium
steps:
- git-shallow-clone/checkout
- npm-install
- run:
name: Setup Env
command: |
./scripts/env/env-for-circle.sh
- run:
name: 'Disengage Maintenance Mode'
command: npm run maintenance:disengage $ENV

only-prod: &only-prod
context: efcms-<< pipeline.git.branch >>
filters:
Expand Down Expand Up @@ -931,12 +891,8 @@ workflows:
build-and-deploy:
when: << pipeline.parameters.run_build_and_deploy >>
jobs:
- engage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/dev
<<: *only-deployed-lower-environments
- deploy:
<<: *only-deployed-lower-environments
requires:
- engage-maintenance-mode
- migrate:
<<: *only-deployed-lower-environments
requires:
Expand All @@ -959,22 +915,24 @@ workflows:
<<: *only-deployed-lower-environments
requires:
- wait-for-reindex
# - smoketests: # TODO 10007 Cleanup: Add back running readonly smoketests after 10007 has been deployed
# <<: *only-deployed-lower-environments
# requires:
# - disable-reindex-cron
# - loadtests:
# <<: *only-deployed-lower-environments
# requires:
# - disable-reindex-cron
# - smoketests-readonly: # TODO 10007 Cleanup: Add back running readonly smoketests after 10007 has been deployed to ustc/prod
# <<: *only-deployed-lower-environments
# requires:
# - loadtests
- switch-colors:
- smoketests:
<<: *only-deployed-lower-environments
requires:
- disable-reindex-cron
- loadtests:
<<: *only-deployed-lower-environments
requires:
- disable-reindex-cron
- smoketests-readonly:
<<: *only-deployed-lower-environments
requires:
- disable-reindex-cron
- switch-colors:
<<: *only-deployed-lower-environments
requires:
- smoketests
- loadtests
- smoketests-readonly
- delete-api-mappings:
<<: *only-deployed-lower-environments
requires:
Expand All @@ -983,21 +941,12 @@ workflows:
<<: *only-deployed-lower-environments
requires:
- switch-colors
- disengage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/dev
<<: *only-deployed-lower-environments
requires:
- cleanup
- delete-api-mappings

build-and-deploy-with-context:
when: << pipeline.parameters.run_build_and_deploy_with_context >>
jobs:
- engage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/prod
<<: *only-prod
- deploy:
<<: *only-prod
requires:
- engage-maintenance-mode
- migrate:
<<: *only-prod
requires:
Expand All @@ -1020,18 +969,18 @@ workflows:
<<: *only-prod
requires:
- wait-for-reindex
# - loadtests: # TODO 10007 Cleanup: Add back running loadtests after 10007 has been deployed to ustc/prod
# <<: *only-prod
# requires:
# - disable-reindex-cron
# - smoketests-readonly: # TODO 10007 Cleanup: Add back running readonly smoketests after 10007 has been deployed to ustc/prod
# <<: *only-prod
# requires:
# - loadtests
- deploy-switch-colors-cron:
- loadtests:
<<: *only-prod
requires:
- disable-reindex-cron
- smoketests-readonly:
<<: *only-prod
requires:
- loadtests
- deploy-switch-colors-cron:
<<: *only-prod
requires:
- smoketests-readonly
- wait-for-switch:
<<: *only-prod
type: approval
Expand All @@ -1058,10 +1007,6 @@ workflows:
requires:
- backup-source-dynamo-table
- delete-api-mappings
- disengage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/prod
<<: *only-prod
requires:
- cleanup

build-and-deploy-empty:
when: << pipeline.parameters.run_build_and_deploy_empty >>
Expand Down
6 changes: 0 additions & 6 deletions .cognito/seedCognitoLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ type CognitoLocalJSON = {
LambdaConfig: {
endpoint: string;
};
TriggerFunctions: {
PostAuthentication: string;
};
SchemaAttributes: Array<{
Name: string;
AttributeDataType: string;
Expand Down Expand Up @@ -85,9 +82,6 @@ const cognitoLocalJSON: CognitoLocalJSON = {
LambdaConfig: {
endpoint: 'http://localhost:9991',
},
TriggerFunctions: {
PostAuthentication: 'PostAuthentication_Authentication',
},
SchemaAttributes: [
{
Name: 'sub',
Expand Down
2 changes: 0 additions & 2 deletions docs/additional-resources/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ This includes both successful and unsuccessful attempts of a user elevating thei
- AWS: User and processes assuming roles (and role assumption failures) — [CloudTrail][cloudtrail] with event source: `iam.amazonaws.com`
- Application
- AWS: Cognito user login (and login failure) — ❌
- [Logs are not available when using Cognito Hosted UI](https://docs.aws.amazon.com/cognito/latest/developerguide/logging-using-cloudtrail.html)
- AWS: IAM policy granted to user from Cognito authorizer — [Kibana][kibana] with message: `Request authorized`
- EF-CMS: Exchanging authorization codes for tokens (and failed exchanges) — ❌
- [Logs are not available when using Cognito Hosted UI](https://docs.aws.amazon.com/cognito/latest/developerguide/logging-using-cloudtrail.html)

### All administrator activity

Expand Down
7 changes: 0 additions & 7 deletions docs/additional-resources/old-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ Other start commands:

- `npm run start:client`

#### Login and test users

There are two login mechanisms available — the legacy mock login system, and a new one that emulates AWS Cognito.

##### Mock login

You can log in using the following accounts.
Expand Down Expand Up @@ -203,9 +199,6 @@ [email protected]

No password is required.

##### AWS Cognito

To use Cognito, start the web client with `npm run dev:cognito` (instead of `npm start`) You can then log in with the following accounts.

###### External Users

Expand Down
6 changes: 0 additions & 6 deletions docs/additional-resources/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ The above tests run before code is introduced into the production environment to

At the end of a sprint PR, we'd like to run manual smoke tests over our system in an attempt to reduce bugs sent to the court's system. The following manual tests can be ran by following the steps provided:

#### Verify Cognito Registration
- go to the cognito UI
- create a new user with your email, i.e. [email protected]
- verify you received a verify email
- login to your petitioner account

#### Verify Email Notifications
- If you already have a petitioner account, login and create a case
- keep track of that docket number
Expand Down
2 changes: 0 additions & 2 deletions docs/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Before diving into the technical aspects of the backend, it might be useful just

```
.
├── cognito // custom styling for the cognito ui
├── elasticsearch // scripts for setting up the elasticsearch cluster
│ ├── elasticsearch-indexes.js // all of the indices on the cluster
│ ├── elasticsearch-settings.js // the main settings
Expand Down Expand Up @@ -92,7 +91,6 @@ Before diving into the technical aspects of the backend, it might be useful just
│ │ │ ├── lambdas // the lambda containing the node logic
│ │ │ ├── main.tf // the main terraform entrypoint
├── swagger.json // the swagger .json we update when api endpoints are changed or added
├── switch-cognito-triggers-color.js // used to switch the color of the cognito triggers
├── track-successful-migrations.js // tracks which migration scripts have run after doing a migration
├── verify-ses-email.sh // used to verify SES
```
Expand Down
1 change: 0 additions & 1 deletion docs/dependency-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ At the moment, the only task we rotate is updating dependencies. As an open-sour

note: we have 3 package.json files, be sure to update them all
- ./package.json
- ./cognito-triggers-sls/package.json
- ./web-api/runtimes/puppeteer/package.json

1. `npm outdated`: Informs us of minor and major version updates that we need to update manually. For major updates, there are often breaking API changes that require refactoring.
Expand Down
20 changes: 0 additions & 20 deletions docs/flows/admissions-clerk-sets-party-email.md

This file was deleted.

Binary file removed docs/flows/admissions-clerk-sets-party-email.png
Binary file not shown.
28 changes: 0 additions & 28 deletions docs/flows/auth.md

This file was deleted.

Binary file removed docs/flows/cookie_auth_flow.png
Binary file not shown.
Loading

0 comments on commit b5bdaf5

Please sign in to comment.