├── .nvmrc
├── source
├── .czrc
├── .licenseignorefile
├── dea-ui
│ ├── infrastructure
│ │ ├── src
│ │ │ ├── test
│ │ │ │ ├── sri
│ │ │ │ │ ├── donthashme.nothtml
│ │ │ │ │ ├── testcontents
│ │ │ │ │ ├── sritest.html
│ │ │ │ │ └── add-subresource-integrity.unit.test.ts
│ │ │ │ └── infra
│ │ │ │ │ └── validate-dea-ui-construct.ts
│ │ │ └── index.ts
│ │ ├── .eslintignore
│ │ ├── tsconfig.json
│ │ ├── config
│ │ │ └── jest.config.json
│ │ ├── license-add-config.json
│ │ └── cdk.json
│ └── ui
│ │ ├── .eslintignore
│ │ ├── src
│ │ ├── styles
│ │ │ ├── CaseListBody.module.scss
│ │ │ ├── ManageAccessListItem.module.scss
│ │ │ ├── BaseLayout.module.scss
│ │ │ ├── globals.scss
│ │ │ ├── Header.module.scss
│ │ │ ├── Breadcrumb.module.scss
│ │ │ └── FileUpload.module.scss
│ │ ├── pages
│ │ │ ├── auth-test
│ │ │ │ └── index.tsx
│ │ │ └── _document.tsx
│ │ ├── models
│ │ │ ├── AppHelp.ts
│ │ │ ├── User.ts
│ │ │ ├── CaseUser.ts
│ │ │ ├── AppNotification.ts
│ │ │ ├── DataSyncTask.ts
│ │ │ ├── Cases.ts
│ │ │ ├── AppSettings.ts
│ │ │ └── CaseFiles.ts
│ │ ├── common
│ │ │ └── utility.ts
│ │ ├── api
│ │ │ └── models
│ │ │ │ ├── api-results.ts
│ │ │ │ └── case.tsx
│ │ ├── components
│ │ │ ├── common-components
│ │ │ │ ├── ActionContainer.tsx
│ │ │ │ └── Notifications.tsx
│ │ │ ├── data-vaults-table
│ │ │ │ └── dataVaultListDefinitions.tsx
│ │ │ ├── create-case
│ │ │ │ └── CreateCaseBody.tsx
│ │ │ ├── create-data-vault
│ │ │ │ └── CreateDataVaultBody.tsx
│ │ │ ├── upload-files
│ │ │ │ └── UploadFilesBody.tsx
│ │ │ └── case-list-table
│ │ │ │ └── caseListDefinitions.tsx
│ │ └── context
│ │ │ └── SettingsContext.tsx
│ │ ├── next-env.d.ts
│ │ ├── next-i18next.config.js
│ │ ├── babel.config.js
│ │ ├── jest.setup.ts
│ │ ├── __tests__
│ │ ├── context
│ │ │ ├── settings-context.unit.test.tsx
│ │ │ └── notifications-context.unit.test.tsx
│ │ ├── pages
│ │ │ ├── auth-test.unit.test.tsx
│ │ │ ├── login.unit.test.tsx
│ │ │ └── data-vault-association-details.unit.test.tsx
│ │ ├── common
│ │ │ └── labels.unit.test.ts
│ │ ├── helpers
│ │ │ └── date-helper.unit.test.ts
│ │ └── components
│ │ │ ├── header.unit.test.tsx
│ │ │ ├── common-components
│ │ │ ├── action-container.unit.test.tsx
│ │ │ ├── table-header.unit.test.tsx
│ │ │ ├── formfield.unit.test.tsx
│ │ │ └── notifications.unit.test.tsx
│ │ │ └── navigation.unit.test.tsx
│ │ ├── cypress
│ │ ├── tsconfig.json
│ │ ├── e2e
│ │ │ └── pages
│ │ │ │ └── dashboard.cy.tsx
│ │ └── support
│ │ │ ├── component-index.html
│ │ │ └── e2e.ts
│ │ ├── cypress.config.ts
│ │ ├── component-mock.js
│ │ ├── setNextEnv.sh
│ │ ├── .depcheckrc
│ │ ├── public
│ │ ├── logo.svg
│ │ ├── locales
│ │ │ ├── es
│ │ │ │ └── common.json
│ │ │ └── en
│ │ │ │ └── common.json
│ │ └── vercel.svg
│ │ ├── next.config.js
│ │ ├── license-add-config.json
│ │ └── tsconfig.json
├── dea-app
│ ├── .eslintignore
│ ├── src
│ │ ├── app
│ │ │ ├── migrations
│ │ │ │ ├── examples
│ │ │ │ │ └── ExampleCsv.csv
│ │ │ │ └── audit-redrive-command.ts
│ │ │ ├── resources
│ │ │ │ ├── get-next-token.ts
│ │ │ │ ├── get-available-endpoints.ts
│ │ │ │ ├── delete-cases.ts
│ │ │ │ ├── revoke-token.ts
│ │ │ │ ├── delete-case-membership.ts
│ │ │ │ ├── get-data-vault-details.ts
│ │ │ │ ├── create-data-vault.ts
│ │ │ │ ├── get-login-url.ts
│ │ │ │ ├── get-logout-url.ts
│ │ │ │ ├── get-all-cases.ts
│ │ │ │ ├── get-case-details.ts
│ │ │ │ ├── get-data-vaults.ts
│ │ │ │ ├── get-my-cases.ts
│ │ │ │ ├── get-case-actions.ts
│ │ │ │ └── get-scoped-case-information.ts
│ │ │ ├── error-prefixes.ts
│ │ │ ├── exceptions
│ │ │ │ ├── throttling-exception.ts
│ │ │ │ ├── forbidden-exception.ts
│ │ │ │ ├── not-found-exception.ts
│ │ │ │ ├── validation-exception.ts
│ │ │ │ └── reauthentication-exception.ts
│ │ │ ├── services
│ │ │ │ └── service-helpers.ts
│ │ │ └── audit
│ │ │ │ └── dea-audit-plugin.ts
│ │ ├── models
│ │ │ ├── case-status.ts
│ │ │ ├── object-checksum-job.ts
│ │ │ ├── case-file-status.ts
│ │ │ ├── validation
│ │ │ │ ├── audit.ts
│ │ │ │ ├── json-parse-with-dates.ts
│ │ │ │ ├── user.ts
│ │ │ │ ├── session.ts
│ │ │ │ ├── auth.ts
│ │ │ │ └── case-user.ts
│ │ │ ├── audit.ts
│ │ │ ├── job.ts
│ │ │ ├── data-vault-execution.ts
│ │ │ ├── dtos
│ │ │ │ └── case-user-dto.ts
│ │ │ ├── session.ts
│ │ │ ├── data-sync-task.ts
│ │ │ ├── case-user.ts
│ │ │ ├── user.ts
│ │ │ ├── case-action.ts
│ │ │ ├── auth.ts
│ │ │ ├── data-vault.ts
│ │ │ ├── data-vault-task.ts
│ │ │ └── case.ts
│ │ ├── persistence
│ │ │ ├── persistence-helpers.ts
│ │ │ └── schema
│ │ │ │ └── dea-table.ts
│ │ ├── test
│ │ │ ├── local-dynamo
│ │ │ │ └── teardown.ts
│ │ │ ├── custom-types
│ │ │ │ └── dynamo-db-local.d.ts
│ │ │ ├── app
│ │ │ │ ├── transform
│ │ │ │ │ └── firehoseEventExample
│ │ │ │ ├── resources
│ │ │ │ │ └── data-sync-tasks-integration-test-helper.ts
│ │ │ │ ├── audit-test-support.ts
│ │ │ │ └── exceptions
│ │ │ │ │ └── dea-exceptions.unit.test.ts
│ │ │ ├── logger.unit.test.ts
│ │ │ ├── local-dev-support
│ │ │ │ ├── delete-user.ts
│ │ │ │ └── get-user-creds.ts
│ │ │ └── services
│ │ │ │ └── service-helpers.unit.test.ts
│ │ ├── test-e2e
│ │ │ └── acls
│ │ │ │ ├── get-case-details.e2e.acl.test.ts
│ │ │ │ ├── case-audit-query.e2e.acl.test.ts
│ │ │ │ ├── list-case-files.e2e.acl.test.ts
│ │ │ │ ├── get-case-collabs.e2e.acl.test.ts
│ │ │ │ ├── delete-membership.e2e.acl.test.ts
│ │ │ │ ├── get-case-file-details.e2e.acl.test.ts
│ │ │ │ ├── case-audit.e2e.acl.test.ts
│ │ │ │ ├── restore-case-file.e2e.acl.test.ts
│ │ │ │ ├── invite-to-case.e2e.acl.test.ts
│ │ │ │ ├── put-case-details.e2e.acl.test.ts
│ │ │ │ ├── put-case-user.e2e.acl.test.ts
│ │ │ │ ├── download-case-file.e2e.acl.test.ts
│ │ │ │ ├── complete-case-file-upload.e2e.acl.test.ts
│ │ │ │ └── initiate-upload-case-file.e2e.acl.test.ts
│ │ ├── storage
│ │ │ └── restrict-account-statement.ts
│ │ └── logger.ts
│ ├── tsconfig.json
│ ├── .depcheckrc
│ ├── config
│ │ ├── jest.config.json
│ │ └── rig.json
│ ├── license-add-config.json
│ ├── .npmignore
│ └── README.md
├── common
│ ├── config
│ │ ├── invalid1.json
│ │ ├── rush
│ │ │ ├── repo-state.json
│ │ │ ├── nonbrowser-approved-packages.json
│ │ │ └── rush-plugins.json
│ │ └── invalid2.json
│ ├── git-hooks
│ │ ├── prepare-commit-msg
│ │ └── pre-commit
│ ├── license.txt
│ ├── changes
│ │ └── @aws
│ │ │ ├── swb-app
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-add-csrf-protection_2022-08-19-16-14.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ ├── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ ├── feat-authn-dynamic-website-url_2022-08-16-20-18.json
│ │ │ └── fix-re-enable-cookie-based-authentication_2022-08-15-17-33.json
│ │ │ ├── workbench-core-audit
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ └── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ ├── workbench-core-base
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ └── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ ├── workbench-core-logging
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ └── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ ├── workbench-core-datasets
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ └── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ ├── workbench-core-environments
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ ├── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ └── fix-re-enable-cookie-based-authentication_2022-08-15-17-33.json
│ │ │ ├── workbench-core-authorization
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ └── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ ├── workbench-core-authentication
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ ├── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ ├── feat-add-csrf-protection_2022-08-19-16-14.json
│ │ │ ├── feat-authn-dynamic-website-url_2022-08-16-20-18.json
│ │ │ ├── fix-authn-verify-token-fix_2022-08-16-19-54.json
│ │ │ └── fix-re-enable-cookie-based-authentication_2022-08-15-17-33.json
│ │ │ ├── workbench-core-datasets-ui
│ │ │ ├── docs-integration-testing-readme_2022-09-07-16-15.json
│ │ │ ├── feat-datasets-list-ui_2022-09-01-06-04.json
│ │ │ └── fix-datasets-ui_2022-09-02-17-29.json
│ │ │ ├── workbench-core-infrastructure
│ │ │ ├── feat-updatePRprocess_2022-08-12-02-01.json
│ │ │ ├── feat-addApacheHeader_2022-08-23-06-35.json
│ │ │ ├── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ │ │ ├── doc-workbench-cognito-cdk-construct_2022-08-19-18-47.json
│ │ │ ├── feat-Environments-MultiStep-Test_2022-08-18-15-37.json
│ │ │ ├── chore-extend-access-token_2022-08-17-14-09.json
│ │ │ ├── fix-re-enable-cookie-based-authentication_2022-08-15-17-33.json
│ │ │ └── feat-authn-dynamic-website-url_2022-08-16-20-18.json
│ │ │ └── workbench-core-swb-common-ui
│ │ │ ├── feat-datasets-list-ui_2022-09-01-06-04.json
│ │ │ ├── feat-refresh-access-token_2022-09-02-15-27.json
│ │ │ └── fix-chore-separate-UI-common-packages_2022-08-31-15-00.json
│ ├── autoinstallers
│ │ ├── rush-prettier
│ │ │ └── package.json
│ │ ├── istanbul
│ │ │ └── package.json
│ │ └── commitlint
│ │ │ └── package.json
│ └── scripts
│ │ ├── preDeploy.sh
│ │ ├── add-license.sh
│ │ └── setEnvDummy.sh
├── commitlint.config.js
├── dea-main
│ ├── .eslintignore
│ ├── tsconfig.json
│ ├── .depcheckrc
│ ├── config
│ │ ├── jest.config.json
│ │ └── rig.json
│ ├── cdk.json
│ ├── license-add-config.json
│ └── src
│ │ └── index.ts
├── dea-backend
│ ├── .eslintignore
│ ├── src
│ │ ├── handlers
│ │ │ ├── datasync-execution-event-handler.ts
│ │ │ ├── s3-batch-delete-case-file-handler.ts
│ │ │ ├── add-groups-claim-to-token-handler.ts
│ │ │ ├── audit-logs-transform-handler.ts
│ │ │ ├── s3-batch-job-status-change-handler.ts
│ │ │ ├── calculate-incremental-checksum-handler.ts
│ │ │ ├── get-users-handler.ts
│ │ │ ├── put-legal-hold-for-created-s3-object-handler.ts
│ │ │ ├── create-cases-handler.ts
│ │ │ ├── delete-case-handler.ts
│ │ │ ├── get-my-cases-handler.ts
│ │ │ ├── get-all-cases-handler.ts
│ │ │ ├── get-data-vaults-handler.ts
│ │ │ ├── get-case-actions-handler.ts
│ │ │ ├── get-user-audit-handler.ts
│ │ │ ├── create-case-owner-handler.ts
│ │ │ ├── create-data-vault-handler.ts
│ │ │ ├── get-system-audit-handler.ts
│ │ │ ├── update-data-vault-handler.ts
│ │ │ ├── get-data-sync-tasks-handler.ts
│ │ │ ├── get-data-vault-details-handler.ts
│ │ │ ├── request-user-audit-handler.ts
│ │ │ ├── request-system-audit-handler.ts
│ │ │ ├── get-datavault-audit-handler.ts
│ │ │ ├── list-data-vault-files-handler.ts
│ │ │ ├── create-data-vault-task-handler.ts
│ │ │ ├── create-case-association-handler.ts
│ │ │ ├── delete-case-association-handler.ts
│ │ │ ├── request-datavault-audit-handler.ts
│ │ │ ├── get-datavault-file-audit-handler.ts
│ │ │ ├── get-scoped-case-info-handler.ts
│ │ │ ├── get-data-vault-file-detail-handler.ts
│ │ │ ├── create-data-vault-execution-handler.ts
│ │ │ ├── get-available-endpoints-handler.ts
│ │ │ ├── request-datavault-file-audit-handler.ts
│ │ │ ├── get-token-handler.ts
│ │ │ ├── get-case-detail-handler.ts
│ │ │ ├── list-case-files-handler.ts
│ │ │ ├── update-cases-handler.ts
│ │ │ ├── get-case-audit-handler.ts
│ │ │ ├── revoke-token-handler.ts
│ │ │ ├── download-case-file-handler.ts
│ │ │ ├── get-login-url-handler.ts
│ │ │ ├── get-logout-url-handler.ts
│ │ │ ├── refresh-token-handler.ts
│ │ │ ├── get-case-membership-handler.ts
│ │ │ ├── request-case-audit-handler.ts
│ │ │ ├── restore-case-file-handler.ts
│ │ │ ├── create-case-user-handler.ts
│ │ │ ├── delete-case-user-handler.ts
│ │ │ ├── get-case-file-audit-handler.ts
│ │ │ ├── update-case-status-handler.ts
│ │ │ ├── update-case-user-handler.ts
│ │ │ ├── get-case-file-detail-handler.ts
│ │ │ ├── request-case-file-audit-handler.ts
│ │ │ ├── complete-case-file-upload-handler.ts
│ │ │ └── initiate-case-file-upload-handler.ts
│ │ ├── types
│ │ │ └── DEACognitoProps.ts
│ │ ├── constructs
│ │ │ ├── cloudtrail-filters.ts
│ │ │ └── construct-support.ts
│ │ ├── test
│ │ │ ├── infra
│ │ │ │ ├── validate-auth-construct.ts
│ │ │ │ └── validate-app-registry-construct.ts
│ │ │ ├── logger.unit.test.ts
│ │ │ └── deployment-config-helpers.unit.test.ts
│ │ ├── oas-2.0
│ │ │ └── openapi-availableEndpoints.yml
│ │ ├── oas-3.0
│ │ │ └── openapi-availableEndpoints.yml
│ │ ├── deployment-helpers
│ │ │ └── generate-config-command.ts
│ │ ├── logger.ts
│ │ └── resources
│ │ │ └── api-gateway-route-config.ts
│ ├── tsconfig.json
│ ├── .depcheckrc
│ ├── cdk.json
│ ├── config
│ │ ├── jest.config.json
│ │ └── rig.json
│ └── license-add-config.json
├── apache-license-header.txt
├── release.config.js
└── .prettierrc.js
├── .gitallowed
├── .semgrepignore
├── deployment
├── package-lock.json
├── solution_config
├── cdk-solution-helper
│ ├── package.json
│ └── package-lock.json
└── run-unit-tests.sh
├── .github
├── workflows
│ ├── scripts
│ │ └── commitizen.sh
│ ├── pipeline-workflow.yml
│ └── main-merge-workflow.yml
├── PULL_REQUEST_TEMPLATE.md
└── ISSUE_TEMPLATE
│ ├── documentation-improvements.md
│ └── feature_request.md
├── docs
└── KNOWN_ISSUES.md
├── CODE_OF_CONDUCT.md
├── .npmpackagejsonlintrc.json
├── solution-manifest.yaml
├── .viperlightignore
├── Config
└── .gitattributes
/.nvmrc:
--------------------------------------------------------------------------------
1 | lts/hydrogen
2 |
--------------------------------------------------------------------------------
/source/.czrc:
--------------------------------------------------------------------------------
1 | {
2 | "path": "cz-conventional-changelog"
3 | }
--------------------------------------------------------------------------------
/source/.licenseignorefile:
--------------------------------------------------------------------------------
1 | *
2 |
3 | !/src/**/*.ts
4 | !/src/**/*.tsx
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/src/test/sri/donthashme.nothtml:
--------------------------------------------------------------------------------
1 | abc123
--------------------------------------------------------------------------------
/.gitallowed:
--------------------------------------------------------------------------------
1 | account: '123456789012'
2 | accountId: '123456789012'
3 |
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/src/test/sri/testcontents:
--------------------------------------------------------------------------------
1 | lorem ipsum etc
--------------------------------------------------------------------------------
/.semgrepignore:
--------------------------------------------------------------------------------
1 | deployment/
2 | source/common/scripts/install-run.js
3 |
4 |
--------------------------------------------------------------------------------
/source/dea-app/.eslintignore:
--------------------------------------------------------------------------------
1 | .eslintrc.js
2 | node_modules
3 | lib
4 | temp
--------------------------------------------------------------------------------
/source/common/config/invalid1.json:
--------------------------------------------------------------------------------
1 | {
2 | "deaRoleTypes": "InvalidGroupConfig"
3 | }
4 |
--------------------------------------------------------------------------------
/source/commitlint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = { extends: ['@commitlint/config-conventional'] };
2 |
--------------------------------------------------------------------------------
/source/dea-main/.eslintignore:
--------------------------------------------------------------------------------
1 | .eslintrc.js
2 | node_modules
3 | lib
4 | temp
5 | cdk.out
6 | build
7 | buildLambda.js
--------------------------------------------------------------------------------
/source/dea-app/src/app/migrations/examples/ExampleCsv.csv:
--------------------------------------------------------------------------------
1 | /folder1/folder2/
2 | /folder1/folder3/
3 | /helloworld/folderx/folderabc/
--------------------------------------------------------------------------------
/source/dea-backend/.eslintignore:
--------------------------------------------------------------------------------
1 | .eslintrc.js
2 | node_modules
3 | lib
4 | temp
5 | cdk.out
6 | build
7 | buildLambda.js
8 | coverage
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/.eslintignore:
--------------------------------------------------------------------------------
1 | .eslintrc.js
2 | node_modules
3 | lib
4 | temp
5 | cdk.out
6 | build
7 | buildLambda.js
--------------------------------------------------------------------------------
/source/apache-license-header.txt:
--------------------------------------------------------------------------------
1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 | SPDX-License-Identifier: Apache-2.0
--------------------------------------------------------------------------------
/source/common/git-hooks/prepare-commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # cd source
3 | # node common/scripts/install-run-rush.js commitizen || echo $?
--------------------------------------------------------------------------------
/deployment/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "deployment",
3 | "lockfileVersion": 2,
4 | "requires": true,
5 | "packages": {}
6 | }
7 |
--------------------------------------------------------------------------------
/deployment/solution_config:
--------------------------------------------------------------------------------
1 | SOLUTION_ID='SO0224'
2 | SOLUTION_NAME='digital-evidence-on-aws'
3 | SOLUTION_TRADEMARKEDNAME='digital-evidence-archive'
4 |
--------------------------------------------------------------------------------
/.github/workflows/scripts/commitizen.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | exec < /dev/tty && pwd && common/autoinstallers/commitizen/node_modules/.bin/cz --hook || true
--------------------------------------------------------------------------------
/source/common/license.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/.eslintignore:
--------------------------------------------------------------------------------
1 | .eslintrc.js
2 | babel.config.js
3 | jest.config.js
4 | jest.setup.js
5 | next.config.js
6 | .next
7 | node_modules
8 | next-env.d.ts
9 | next-i18next.config.js
10 | temp
--------------------------------------------------------------------------------
/source/common/config/rush/repo-state.json:
--------------------------------------------------------------------------------
1 | // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
2 | {
3 | "preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f"
4 | }
5 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/styles/CaseListBody.module.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | .primaryButton {
7 | margin-top: 2em;
8 | }
9 |
--------------------------------------------------------------------------------
/source/common/config/invalid2.json:
--------------------------------------------------------------------------------
1 | {
2 | "deaRoleTypes": [
3 | {
4 | "name": "InvalidEndpointConfig",
5 | "description": "used for auth e2e testing",
6 | "endpoints": "InvalidEndpoints"
7 | }
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/styles/ManageAccessListItem.module.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | .button-container {
7 | padding-top: 25px;
8 | }
9 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/next-i18next.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // used in next-18next lib, NOT part of vanilla nextjs
3 | i18n: {
4 | locales: ['en-US', 'es'],
5 | defaultLocale: 'en-US',
6 | },
7 | react: { useSuspense: false },
8 | };
9 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/pages/auth-test/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export default function TestLoginPage() {
7 | return
;
8 | }
9 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/styles/BaseLayout.module.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | .baseLayout {
7 | display: block;
8 | overflow: auto;
9 | }
10 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/case-status.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export enum CaseStatus {
7 | ACTIVE = 'ACTIVE',
8 | INACTIVE = 'INACTIVE',
9 | }
10 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/swb-app/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/swb-app",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/swb-app"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/persistence/persistence-helpers.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export const isDefined = (item: T | undefined): item is T => {
7 | return !!item;
8 | };
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/models/AppHelp.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface IAppHelpState {
7 | toolsOpen: boolean;
8 | helpPanelTopic: string;
9 | }
10 |
--------------------------------------------------------------------------------
/source/common/config/rush/nonbrowser-approved-packages.json:
--------------------------------------------------------------------------------
1 | // DO NOT ADD COMMENTS IN THIS FILE. They will be lost when the Rush tool resaves it.
2 | {
3 | "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/approved-packages.schema.json",
4 | "packages": []
5 | }
6 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/swb-app/feat-add-csrf-protection_2022-08-19-16-14.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/swb-app",
5 | "comment": "Added CSRF protection",
6 | "type": "patch"
7 | }
8 | ],
9 | "packageName": "@aws/swb-app"
10 | }
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/src/test/sri/sritest.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/KNOWN_ISSUES.md:
--------------------------------------------------------------------------------
1 | # Known Issues
2 |
3 | - The ESR Release of Firefox (as of `115.3.1esr`) expresses an integrity hash discrepancy and will not load the DEA UI as configured by default.
4 | - Safari (as of `16.6`) will not load the DEA UI as configured by default with script-src integrity hashes.
--------------------------------------------------------------------------------
/source/common/changes/@aws/swb-app/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/swb-app",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/swb-app"
10 | }
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/styles/globals.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | @use '~@awsui/design-tokens/index.scss' as awsui;
7 |
8 | body {
9 | background: awsui.$color-background-layout-main;
10 | }
11 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/swb-app/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/swb-app",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/swb-app"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-audit/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-audit",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-audit"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-base/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-base",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-base"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/models/object-checksum-job.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface ObjectChecksumJob {
7 | parentUlid: string;
8 | fileUlid: string;
9 | serializedHasher: string;
10 | }
11 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/models/User.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface IUser {
7 | username: string;
8 | }
9 |
10 | export const unknownUser: IUser = {
11 | username: 'User Name',
12 | };
13 |
--------------------------------------------------------------------------------
/source/common/autoinstallers/rush-prettier/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rush-prettier",
3 | "license": "Apache-2.0",
4 | "description": "prettier autoinstaller",
5 | "version": "1.0.0",
6 | "private": true,
7 | "dependencies": {
8 | "prettier": "^2.5.1",
9 | "pretty-quick": "^3.1.3"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-logging/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-logging",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-logging"
10 | }
--------------------------------------------------------------------------------
/source/dea-ui/ui/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | 'next/babel',
4 | ['@babel/preset-react', { runtime: 'automatic' }],
5 | [
6 | '@babel/preset-env',
7 | {
8 | targets: {
9 | node: 'current',
10 | },
11 | },
12 | ],
13 | ],
14 | };
15 |
--------------------------------------------------------------------------------
/deployment/cdk-solution-helper/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cdk-solution-helper",
3 | "version": "0.1.0",
4 | "license": "Apache-2.0",
5 | "description": "CDK solution helper",
6 | "devDependencies": {
7 | "fs": "0.0.1-security"
8 | },
9 | "dependencies": {
10 | "fs": "0.0.1-security"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-datasets/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-datasets",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-datasets"
10 | }
--------------------------------------------------------------------------------
/source/release.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | branches: 'main',
3 | repositoryUrl: 'git@github.com:aws-solutions/digital-evidence-archive-on-aws.git',
4 | plugins: [
5 | '@semantic-release/commit-analyzer',
6 | '@semantic-release/release-notes-generator',
7 | '@semantic-release/github',
8 | ],
9 | };
10 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/jest.setup.ts:
--------------------------------------------------------------------------------
1 | // Optional: configure or set up a testing framework before each test.
2 | // If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js`
3 |
4 | // Used for __tests__/testing-library.js
5 | // Learn more: https://github.com/testing-library/jest-dom
6 | import '@testing-library/jest-dom';
7 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | ## Code of Conduct
2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4 | opensource-codeofconduct@amazon.com with any additional questions or comments.
5 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/swb-app/feat-authn-dynamic-website-url_2022-08-16-20-18.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/swb-app",
5 | "comment": "Removed `websiteUrl` parameter from `cognitoPluginOptions` object",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/swb-app"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-base/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-base",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-base"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-environments/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-environments",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-environments"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-audit/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-audit",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-audit"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authorization/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authorization",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authorization"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authentication/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authentication",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authentication"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-base/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-base",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-base"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-datasets-ui/docs-integration-testing-readme_2022-09-07-16-15.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-datasets-ui",
5 | "comment": "documentation update",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-datasets-ui"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-datasets/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-datasets",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-datasets"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-infrastructure/feat-updatePRprocess_2022-08-12-02-01.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-infrastructure",
5 | "comment": "add license-checker",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-infrastructure"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-logging/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-logging",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-logging"
10 | }
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/datasync-execution-event-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { dataSyncExecutionEvent } from '@aws/dea-app/lib/storage/datasync-event-handler';
7 |
8 | export const handler = dataSyncExecutionEvent;
9 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-audit/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-audit",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-audit"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-datasets-ui/feat-datasets-list-ui_2022-09-01-06-04.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-datasets-ui",
5 | "comment": "Additions to Dataset UI package",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-datasets-ui"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-datasets-ui/fix-datasets-ui_2022-09-02-17-29.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-datasets-ui",
5 | "comment": "remove unnecessary code from base DS list page",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-datasets-ui"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-logging/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-logging",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-logging"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-swb-common-ui/feat-datasets-list-ui_2022-09-01-06-04.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-swb-common-ui",
5 | "comment": "Additions to Dataset UI package",
6 | "type": "patch"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-swb-common-ui"
10 | }
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/s3-batch-delete-case-file-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { deleteCaseFileHandler } from '@aws/dea-app/lib/storage/s3-batch-delete-case-file-handler';
7 |
8 | export const handler = deleteCaseFileHandler;
9 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Description
2 |
3 | Describe your changes.
4 |
5 | ## Testing
6 |
7 | Describe how you tested your changes and/or give instructions to the reviewers on how they can verify them.
8 |
9 | ---
10 |
11 | By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
12 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authorization/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authorization",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authorization"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-datasets/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-datasets",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-datasets"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-environments/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-environments",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-environments"
10 | }
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/add-groups-claim-to-token-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { addGroupsClaimToToken } from '@aws/dea-app/lib/app/event-handlers/pretoken-generation-trigger';
7 |
8 | export const handler = addGroupsClaimToToken;
9 |
--------------------------------------------------------------------------------
/.npmpackagejsonlintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "npm-package-json-lint-config-default",
3 | "rules": {
4 | "require-repository": "error",
5 | "require-author": "error",
6 | "require-description": "error",
7 | "require-homepage": "error",
8 | "require-license": "error",
9 | "valid-values-license": ["error", ["Apache-2.0"]]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authentication/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authentication",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authentication"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-infrastructure/feat-addApacheHeader_2022-08-23-06-35.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-infrastructure",
5 | "comment": "add license-check-and-add to package.json",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-infrastructure"
10 | }
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/context/settings-context.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import { render } from "@testing-library/react";
2 | import { SettingsProvider } from "../../src/context/SettingsContext";
3 |
4 | describe('settings provider', () => {
5 | it('should render the settings provider', () => {
6 | render();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-environments/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-environments",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-environments"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-environments/fix-re-enable-cookie-based-authentication_2022-08-15-17-33.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-environments",
5 | "comment": "Replaced require with import",
6 | "type": "patch"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-environments"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/models/case-file-status.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export enum CaseFileStatus {
7 | ACTIVE = 'ACTIVE',
8 | DELETING = 'DELETING',
9 | DELETE_FAILED = 'DELETE_FAILED',
10 | DELETED = 'DELETED',
11 | PENDING = 'PENDING',
12 | }
13 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/audit-logs-transform-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { transformAuditEventForS3 } from '@aws/dea-app/lib/app/transform/audit-logs-to-s3-transformation-handler';
7 |
8 | export const handler = transformAuditEventForS3;
9 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/cypress/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2022",
4 | "lib": ["es2022", "dom"],
5 | "types": ["jest", "cypress", "node"],
6 | "isolatedModules": false
7 | },
8 | "include": ["**/*.ts", "e2e/pages/dashboard.cy.tsx"],
9 | "files": ["../cypress.config.ts"],
10 | "exclude": ["../cypress.config.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/solution-manifest.yaml:
--------------------------------------------------------------------------------
1 | id: SO0224 # Solution Id
2 | name: digital-evidence-archive-on-aws # trademarked name
3 | version: v1.0.6 # current version of the solution. Used to verify template headers
4 | cloudformation_templates: # This list should match with AWS CloudFormation templates section of IG
5 | - template: dea-one-click-DeaMainStack.template
6 | main_template: true
7 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authentication/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authentication",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authentication"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authorization/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authorization",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authorization"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-infrastructure/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-infrastructure",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-infrastructure"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-swb-common-ui/feat-refresh-access-token_2022-09-02-15-27.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-swb-common-ui",
5 | "comment": "use refresh token to refresh expired access token",
6 | "type": "patch"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-swb-common-ui"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-swb-common-ui/fix-chore-separate-UI-common-packages_2022-08-31-15-00.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-swb-common-ui",
5 | "comment": "Updates for separating UI packages",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-swb-common-ui"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/models/validation/audit.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import Joi from 'joi';
7 | import { unixTimestamp } from './joi-common';
8 |
9 | export const auditQuerySchema = Joi.object({
10 | from: unixTimestamp,
11 | to: unixTimestamp,
12 | });
13 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/s3-batch-job-status-change-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { s3BatchJobStatusChangeHandler } from '@aws/dea-app/lib/storage/s3-batch-job-status-change-handler';
7 |
8 | export const handler = s3BatchJobStatusChangeHandler;
9 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/cypress.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "cypress";
2 |
3 | export default defineConfig({
4 | e2e: {
5 | setupNodeEvents(on, config) {
6 | // implement node event listeners here
7 | },
8 | },
9 |
10 | component: {
11 | devServer: {
12 | framework: "next",
13 | bundler: "webpack",
14 | },
15 | },
16 | });
17 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/models/CaseUser.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
7 |
8 | export interface CaseUserForm {
9 | caseUlid: string;
10 | userUlid: string;
11 | actions: CaseAction[];
12 | }
13 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-infrastructure/doc-workbench-cognito-cdk-construct_2022-08-19-18-47.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-infrastructure",
5 | "comment": "Updated doc for WorkbenchCognito construct",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-infrastructure"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-infrastructure/feat-Environments-MultiStep-Test_2022-08-18-15-37.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-infrastructure",
5 | "comment": "Add Multi Step Environments Integration Test",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-infrastructure"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/models/audit.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface DEAAuditQuery {
7 | readonly from: number;
8 | readonly to: number;
9 | }
10 |
11 | export const defaultAuditQuery: DEAAuditQuery = {
12 | from: 0,
13 | to: Date.now(),
14 | };
15 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/calculate-incremental-checksum-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { calculateIncrementalChecksum } from '@aws/dea-app/lib/app/event-handlers/calculate-incremental-checksum';
7 |
8 | export const handler = calculateIncrementalChecksum;
9 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/component-mock.js:
--------------------------------------------------------------------------------
1 | import kebabCase from 'lodash.kebabcase';
2 |
3 | const Components = jest.requireActual('@cloudscape-design/components');
4 | for (const mockComponentName of Object.keys(Components)) {
5 | jest.mock(
6 | `@cloudscape-design/components/${kebabCase(mockComponentName).replace('s-3', 's3')}`,
7 | () => mockComponentName
8 | );
9 | }
10 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/cypress/e2e/pages/dashboard.cy.tsx:
--------------------------------------------------------------------------------
1 | describe('DEA Dashboard', () => {
2 | it('should have a header', () => {
3 | // Start from the index page
4 | cy.visit('/');
5 |
6 | // The new page should contain a header
7 | cy.get('Header').should('have.text', 'Digital Evidence Archive on AWSSherlock Holmes');
8 | });
9 | });
10 |
11 | export {};
12 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/context/notifications-context.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import { render } from '@testing-library/react';
2 | import { NotificationsProvider } from '../../src/context/NotificationsContext';
3 |
4 | describe('notifications provider', () => {
5 | it('should render the notifications provider', () => {
6 | render();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/models/AppNotification.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { FlashbarProps } from '@cloudscape-design/components';
7 |
8 | export interface IAppNotification {
9 | id: string;
10 | type: FlashbarProps.Type;
11 | content: React.ReactNode;
12 | }
13 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-infrastructure/chore-extend-access-token_2022-08-17-14-09.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-infrastructure",
5 | "comment": "Added optional parameter to override default access token expiration time",
6 | "type": "none"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-infrastructure"
10 | }
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-users-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getUsers } from '@aws/dea-app/lib/app/resources/get-users';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getUsers, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/put-legal-hold-for-created-s3-object-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { putLegalHoldForCreatedS3Object } from '@aws/dea-app/lib/app/event-handlers/put-legal-hold-for-created-s3-object';
7 |
8 | export const handler = putLegalHoldForCreatedS3Object;
9 |
--------------------------------------------------------------------------------
/source/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | bracketSpacing: true,
3 | htmlWhitespaceSensitivity: 'css',
4 | insertPragma: false,
5 | jsxSingleQuote: false,
6 | printWidth: 110,
7 | proseWrap: 'preserve',
8 | quoteProps: 'as-needed',
9 | requirePragma: false,
10 | semi: true,
11 | singleQuote: true,
12 | tabWidth: 2,
13 | trailingComma: 'es5',
14 | useTabs: false,
15 | };
16 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/swb-app/fix-re-enable-cookie-based-authentication_2022-08-15-17-33.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/swb-app",
5 | "comment": "Changed logout route to POST, removed unnecessary CORS allowed headers, added samesSite: 'none' cookie setting to authN routes",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/swb-app"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/test/local-dynamo/teardown.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 |
7 | const teardown = (): void => {
8 | if (process.env.DYNAMODB_PID) {
9 | const pid = parseInt(process.env.DYNAMODB_PID)
10 | process.kill(pid)
11 | }
12 | }
13 |
14 | export default teardown;
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/create-cases-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { createCases } from '@aws/dea-app/lib/app/resources/create-cases';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(createCases, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/delete-case-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { deleteCase } from '@aws/dea-app/lib/app/resources/delete-cases';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(deleteCase, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-my-cases-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getMyCases } from '@aws/dea-app/lib/app/resources/get-my-cases';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getMyCases, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authentication/feat-add-csrf-protection_2022-08-19-16-14.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authentication",
5 | "comment": "Added CSRF middleware, updated other middlware/route handlers to accept a csrf parameter",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authentication"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-next-token.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export const getNextToken = (nextToken: object | undefined): string | undefined => {
7 | if (nextToken) {
8 | return Buffer.from(JSON.stringify(nextToken)).toString('base64');
9 | }
10 | return undefined;
11 | };
12 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-all-cases-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getAllCases } from '@aws/dea-app/lib/app/resources/get-all-cases';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getAllCases, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/styles/Header.module.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | .header {
7 | display: block;
8 | position: fixed;
9 | top: 0;
10 | left: 0;
11 | right: 0;
12 | z-index: 1000;
13 | margin: 0;
14 | font-family: 'Amazon Ember', 'Helvetica Neue', Roboto, Arial, sans-serif;
15 | }
16 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-data-vaults-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getDataVaults } from '@aws/dea-app/lib/app/resources/get-data-vaults';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getDataVaults, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/pages/auth-test.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import '@testing-library/jest-dom';
2 | import { render } from '@testing-library/react';
3 | import TestLoginPage from '../../src/pages/auth-test';
4 |
5 | describe('LoginPage', () => {
6 | it('renders a login page when waiting to log in', async () => {
7 | const page = render();
8 | expect(page).toBeTruthy();
9 | });
10 | });
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-case-actions-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getCaseActions } from '@aws/dea-app/lib/app/resources/get-case-actions';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getCaseActions, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-user-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getUserAudit } from '@aws/dea-app/lib/app/resources/audit/get-user-audit';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getUserAudit, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/create-case-owner-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { createCaseOwner } from '@aws/dea-app/lib/app/resources/create-case-owner';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(createCaseOwner, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/create-data-vault-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { createDataVault } from '@aws/dea-app/lib/app/resources/create-data-vault';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(createDataVault, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-system-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getSystemAudit } from '@aws/dea-app/lib/app/resources/audit/get-system-audit';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getSystemAudit, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/update-data-vault-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { updateDataVault } from '@aws/dea-app/lib/app/resources/update-data-vault';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(updateDataVault, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authentication/feat-authn-dynamic-website-url_2022-08-16-20-18.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authentication",
5 | "comment": "Added `websiteUrl` param to AuthenticationService to allow for dynamic redirection after login/logout",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authentication"
10 | }
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-infrastructure/fix-re-enable-cookie-based-authentication_2022-08-15-17-33.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-infrastructure",
5 | "comment": "Added default token validity length (15 minutes for id and access, 30 days for refresh)",
6 | "type": "patch"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-infrastructure"
10 | }
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-data-sync-tasks-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getDataSyncTasks } from '@aws/dea-app/lib/app/resources/get-data-sync-tasks';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getDataSyncTasks, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-data-vault-details-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getDataVault } from '@aws/dea-app/lib/app/resources/get-data-vault-details';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getDataVault, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/request-user-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { startUserAudit } from '@aws/dea-app/lib/app/resources/audit/start-user-audit';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(startUserAudit, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/setNextEnv.sh:
--------------------------------------------------------------------------------
1 | # https://nextjs.org/docs/basic-features/environment-variables
2 | echo NEXT_PUBLIC_DEA_API_URL=$DEA_API_URL > .env.local
3 | echo NEXT_PUBLIC_STAGE=${STAGE:-devsample} >> .env.local
4 | echo NEXT_PUBLIC_IS_USING_CUSTOM_DOMAIN=${DEA_CUSTOM_DOMAIN} >> .env.local
5 | echo NEXT_PUBLIC_AWS_REGION=${AWS_REGION} >> .env.local
6 | echo NEXT_PUBLIC_AWS_USE_FIPS_ENDPOINT=${AWS_USE_FIPS_ENDPOINT:-false} >> .env.local
7 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/job.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface Job {
7 | readonly jobId: string;
8 | readonly caseUlid: string;
9 | readonly created?: Date;
10 | readonly updated?: Date;
11 | }
12 |
13 | export interface JobInput {
14 | readonly jobId: string;
15 | readonly caseUlid: string;
16 | }
17 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/request-system-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { startSystemAudit } from '@aws/dea-app/lib/app/resources/audit/start-system-audit';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(startSystemAudit, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/common/utility.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | // convert a string to a boolean
7 | export function strToBool(str: string | undefined): boolean {
8 | return str?.trim().toLowerCase() === 'true';
9 | }
10 |
11 | export const isUsingCustomDomain = strToBool(process.env.NEXT_PUBLIC_IS_USING_CUSTOM_DOMAIN);
12 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authentication/fix-authn-verify-token-fix_2022-08-16-19-54.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authentication",
5 | "comment": "Fixed bug in authenticationMiddleware where verifyToken used Authorization header instead of access_token cookie",
6 | "type": "patch"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authentication"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/app/error-prefixes.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | const MALFORMED_JSON_PREFIX = 'Malformed Event';
7 | const KINESIS_PUT_ERROR_PREFIX = 'Failed to put Kinesis records';
8 |
9 | const ErrorPrefixes = {
10 | MALFORMED_JSON_PREFIX,
11 | KINESIS_PUT_ERROR_PREFIX,
12 | };
13 |
14 | export default ErrorPrefixes;
15 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/custom-types/dynamo-db-local.d.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { ChildProcess } from "child_process";
7 |
8 | declare module 'dynamo-db-local';
9 |
10 | export declare class DbLocal {
11 | spawn({port: number}): ChildProcess;
12 | }
13 | export declare const dbLocal: DbLocal
14 | export default dbLocal
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-datavault-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getDataVaultAudit } from '@aws/dea-app/lib/app/resources/audit/get-datavault-audit';
7 | import { NO_ACL, createDeaHandler } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getDataVaultAudit, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/list-data-vault-files-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { listDataVaultFiles } from '@aws/dea-app/lib/app/resources/list-data-vault-files';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(listDataVaultFiles, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/.depcheckrc:
--------------------------------------------------------------------------------
1 | ignores: [
2 | '@aws/eslint-config-workbench-core-eslint-custom',
3 | 'eslint-plugin-import',
4 | 'eslint-plugin-security',
5 | 'npm-package-json-lint-config-default',
6 | '@types/node'
7 | ]
8 | ignore-patterns: [
9 | // files matching these patterns will be ignored
10 | '.next',
11 | '.rush',
12 | 'node_modules',
13 | 'public',
14 | 'temp',
15 | ]
16 | skip-missing: true
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/common/labels.unit.test.ts:
--------------------------------------------------------------------------------
1 | import { OWNER_ACTIONS } from '@aws/dea-app/lib/models/case-action';
2 | import { caseActionOptions } from '../../src/common/labels';
3 |
4 | describe('labels', () => {
5 | it('case action mappings', () => {
6 | const selectableOptions = caseActionOptions.selectableOptions();
7 | expect(OWNER_ACTIONS).toEqual(selectableOptions.map((option) => option.value));
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/create-data-vault-task-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { createDataVaultTask } from '@aws/dea-app/lib/app/resources/create-data-vault-task';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(createDataVaultTask, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/types/DEACognitoProps.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { SecretValue } from 'aws-cdk-lib';
7 |
8 | export interface DEACognitoProps {
9 | readonly cognitoDomain: string;
10 | readonly userPoolId: string;
11 | readonly userPoolClientId: string;
12 | readonly userPoolClientSecret: SecretValue;
13 | }
14 |
--------------------------------------------------------------------------------
/source/common/autoinstallers/istanbul/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "istanbul",
3 | "version": "1.0.0",
4 | "license": "Apache-2.0",
5 | "description": "istanbul autoinstaller",
6 | "private": true,
7 | "dependencies": {
8 | "istanbul-badges-readme": "1.8.1",
9 | "istanbul-combine": "0.3.0"
10 | },
11 | "pnpm": {
12 | "overrides": {
13 | "minimist": ">=1.2.6",
14 | "minimatch": ">=3.0.5"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/validation/json-parse-with-dates.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export const jsonParseWithDates = (payload: string): T => {
7 | return JSON.parse(payload, (key, value) => {
8 | if (['updated', 'created'].includes(key)) {
9 | return new Date(value);
10 | }
11 | return value;
12 | });
13 | };
14 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/create-case-association-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { createCaseAssociation } from '@aws/dea-app/lib/app/resources/create-case-association';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(createCaseAssociation, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/delete-case-association-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { deleteCaseAssociation } from '@aws/dea-app/lib/app/resources/delete-case-association';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(deleteCaseAssociation, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/request-datavault-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { startDataVaultAudit } from '@aws/dea-app/lib/app/resources/audit/start-datavault-audit';
7 | import { NO_ACL, createDeaHandler } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(startDataVaultAudit, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/src/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | /* eslint-disable no-new */
7 | import 'source-map-support/register';
8 | import { DeaUiConstruct } from './dea-ui-stack';
9 | import { validateDeaUiConstruct } from './test/infra/validate-dea-ui-construct';
10 |
11 | export { DeaUiConstruct, validateDeaUiConstruct };
12 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-infrastructure/feat-authn-dynamic-website-url_2022-08-16-20-18.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-infrastructure",
5 | "comment": "Renamed `websiteUrl` to `websiteUrls` and changed type to string array to allow one backend API to serve multiple UI clients",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-infrastructure"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/models/validation/user.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import Joi from 'joi';
7 | import { joiUlid, safeName } from './joi-common';
8 |
9 | export const userResponseSchema = Joi.object({
10 | ulid: joiUlid,
11 | firstName: safeName,
12 | lastName: safeName,
13 | created: Joi.date(),
14 | updated: Joi.date(),
15 | });
16 |
--------------------------------------------------------------------------------
/source/dea-backend/src/constructs/cloudtrail-filters.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { FilterPattern } from 'aws-cdk-lib/aws-logs';
7 |
8 | export const subscriptionFilter = FilterPattern.any(
9 | FilterPattern.exists('$.userIdentity.userName'),
10 | FilterPattern.exists('$.userIdentity.sessionContext.sessionIssuer.userName')
11 | );
12 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-datavault-file-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getDataVaultFileAudit } from '@aws/dea-app/lib/app/resources/audit/get-datavault-file-audit';
7 | import { NO_ACL, createDeaHandler } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getDataVaultFileAudit, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-scoped-case-info-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getScopedCaseInformation } from '@aws/dea-app/lib/app/resources/get-scoped-case-information';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getScopedCaseInformation, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "target": "ES2022",
3 | "$schema": "http://json.schemastore.org/tsconfig",
4 | "extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
5 | "compilerOptions": {
6 | "strict": true,
7 | "types": ["heft-jest", "node"],
8 | "lib": ["es2022", "dom"],
9 | "rootDir": "src"
10 | },
11 | "include": ["src/**/*.ts"],
12 | "exclude": ["node_modules", "lib"]
13 | }
14 |
--------------------------------------------------------------------------------
/.viperlightignore:
--------------------------------------------------------------------------------
1 |
2 | cdk.out
3 | node_modules
4 | source/dea-ui/ui/.next
5 | source/common/temp
6 | viperlight
7 | Config
8 | source/dea-backend/src/test/config.unit.test.ts
9 |
10 | # Line specific ignores
11 |
12 | source/dea-app/lib/test/integration-objects.js:79
13 | source/dea-app/src/storage/datasets.ts:182
14 | source/dea-app/src/storage/datasets.ts:183
15 |
16 | # Bogus email ignores
17 |
18 | source/release.config.js:3
19 | source/rush.json:17
20 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/data-vault-execution.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface DeaDataVaultExecution {
7 | readonly executionId: string;
8 | readonly taskId: string;
9 | readonly created?: Date;
10 | readonly createdBy: string;
11 | }
12 |
13 | export interface DataVaultExecutionDTO {
14 | readonly taskArn: string;
15 | }
16 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-data-vault-file-detail-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getDataVaultFileDetails } from '@aws/dea-app/lib/app/resources/get-data-vault-file-details';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getDataVaultFileDetails, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/test/infra/validate-auth-construct.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { Template } from 'aws-cdk-lib/assertions';
7 |
8 | export const validateAuthConstruct = (template: Template): void => {
9 | // Assert single cognito user pool domain resource
10 | template.resourceCountIs('AWS::Cognito::UserPoolDomain', 1);
11 | };
12 |
--------------------------------------------------------------------------------
/source/common/scripts/preDeploy.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | export ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
4 |
5 | read -p "Deploying to PROFILE/ACCOUNT: ${AWS_PROFILE}/${ACCOUNT_ID}, STAGE: ${STAGE}, PREFIX: ${DOMAIN_PREFIX}, AWS_USE_FIPS_ENDPOINT: ${AWS_USE_FIPS_ENDPOINT} (Proceed? [Y/n]) " -n 1 -r
6 | echo
7 | if [[ $REPLY =~ ^[Yy]$ ]]
8 | then
9 | echo "Deploying..."
10 | else
11 | echo "Aborting..."
12 | exit 1
13 | fi
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/create-data-vault-execution-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { createDataVaultExecution } from '@aws/dea-app/lib/app/resources/create-data-vault-execution';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(createDataVaultExecution, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-available-endpoints-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getAvailableEndpointsForUser } from '@aws/dea-app/lib/app/resources/get-available-endpoints';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(getAvailableEndpointsForUser, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/request-datavault-file-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { startDataVaultFileAudit } from '@aws/dea-app/lib/app/resources/audit/start-datavault-file-audit';
7 | import { NO_ACL, createDeaHandler } from './create-dea-handler';
8 |
9 | export const handler = createDeaHandler(startDataVaultFileAudit, NO_ACL);
10 |
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "target": "ES2022",
3 | "$schema": "http://json.schemastore.org/tsconfig",
4 | "extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
5 | "compilerOptions": {
6 | "strict": true,
7 | "types": ["heft-jest", "node"],
8 | "lib": ["es2022", "dom"],
9 | "rootDir": "src"
10 | },
11 | "include": ["src/**/*.ts"],
12 | "exclude": ["node_modules", "lib"]
13 | }
14 |
--------------------------------------------------------------------------------
/source/dea-main/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "target": "ES2022",
3 | "preserveSymlinks": true,
4 | "$schema": "http://json.schemastore.org/tsconfig",
5 | "extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
6 | "compilerOptions": {
7 | "strict": true,
8 | "types": ["heft-jest", "node"],
9 | "lib": ["es2022", "dom"],
10 | "rootDir": "src"
11 | },
12 | "include": ["src/**/*.ts"],
13 | "exclude": ["node_modules", "lib"]
14 | }
15 |
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/config/jest.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json",
3 | "collectCoverage": true,
4 | "coveragePathIgnorePatterns": ["/src/index.ts"],
5 | "coverageThreshold": {
6 | "global": {
7 | "branches": 60,
8 | "functions": 90,
9 | "lines": 90,
10 | "statements": 90
11 | }
12 | },
13 | "coverageReporters": ["json-summary", "json", "lcov", "text"]
14 | }
15 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/cypress/support/component-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Components App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/exceptions/throttling-exception.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export const THROTTLING_ERROR_NAME = 'ThrottlingException';
7 |
8 | // This will map to 429 in our ExceptionHandlers,
9 | export class ThrottlingException extends Error {
10 | constructor(message: string) {
11 | super(message);
12 | this.name = THROTTLING_ERROR_NAME;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/validation/session.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import Joi from 'joi';
7 | import { joiUlid, jti, ttlJoi } from './joi-common';
8 |
9 | export const sessionResponseSchema = Joi.object({
10 | userUlid: joiUlid,
11 | ttl: ttlJoi,
12 | isRevoked: Joi.boolean(),
13 | created: Joi.date(),
14 | updated: Joi.date(),
15 | tokenId: jti,
16 | });
17 |
--------------------------------------------------------------------------------
/source/dea-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "target": "ES2022",
3 | "$schema": "http://json.schemastore.org/tsconfig",
4 | "extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
5 | "compilerOptions": {
6 | "strict": true,
7 | "types": ["heft-jest", "node"],
8 | "lib": ["es2022", "dom"],
9 | "baseUrl": "./",
10 | "paths": {
11 | "*": ["src/test/custom-types/*"]
12 | }
13 | },
14 | "exclude": ["node_modules", "lib"]
15 | }
16 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-token-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getToken } from '@aws/dea-app/lib/app/resources/get-token';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | const noOpPreExecution = async () => {
10 | /* do nothing */
11 | };
12 | export const handler = createDeaHandler(getToken, NO_ACL, noOpPreExecution);
13 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-case-detail-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getCase } from '@aws/dea-app/lib/app/resources/get-case-details';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(getCase, [CaseAction.VIEW_CASE_DETAILS]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/list-case-files-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { listCaseFiles } from '@aws/dea-app/lib/app/resources/list-case-files';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(listCaseFiles, [CaseAction.VIEW_FILES]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/update-cases-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { updateCases } from '@aws/dea-app/lib/app/resources/update-cases';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(updateCases, [CaseAction.UPDATE_CASE_DETAILS]);
11 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/dtos/case-user-dto.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../case-action';
7 |
8 | export interface CaseUserDTO {
9 | readonly userUlid: string;
10 | readonly caseUlid: string;
11 | readonly actions: CaseAction[];
12 | }
13 |
14 | export interface CaseOwnerDTO {
15 | readonly userUlid: string;
16 | readonly caseUlid: string;
17 | }
18 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-case-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getCaseAudit } from '@aws/dea-app/lib/app/resources/audit/get-case-audit';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(getCaseAudit, [CaseAction.CASE_AUDIT]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/revoke-token-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { revokeToken } from '@aws/dea-app/lib/app/resources/revoke-token';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | const noOpPreExecution = async () => {
10 | /* do nothing */
11 | };
12 | export const handler = createDeaHandler(revokeToken, NO_ACL, noOpPreExecution);
13 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/download-case-file-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { downloadCaseFile } from '@aws/dea-app/lib/app/resources/download-case-file';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(downloadCaseFile, [CaseAction.DOWNLOAD]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-login-url-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getLoginUrl } from '@aws/dea-app/lib/app/resources/get-login-url';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | const noOpPreExecution = async () => {
10 | /* do nothing */
11 | };
12 | export const handler = createDeaHandler(getLoginUrl, NO_ACL, noOpPreExecution);
13 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-logout-url-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getLogoutUrl } from '@aws/dea-app/lib/app/resources/get-logout-url';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | const noOpPreExecution = async () => {
10 | /* do nothing */
11 | };
12 | export const handler = createDeaHandler(getLogoutUrl, NO_ACL, noOpPreExecution);
13 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/refresh-token-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { refreshToken } from '@aws/dea-app/lib/app/resources/refresh-token';
7 | import { createDeaHandler, NO_ACL } from './create-dea-handler';
8 |
9 | const noOpPreExecution = async () => {
10 | /* do nothing */
11 | };
12 | export const handler = createDeaHandler(refreshToken, NO_ACL, noOpPreExecution);
13 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-case-membership-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getCaseMembership } from '@aws/dea-app/lib/app/resources/get-case-membership';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(getCaseMembership, [CaseAction.INVITE]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/request-case-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { startCaseAudit } from '@aws/dea-app/lib/app/resources/audit/start-case-audit';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(startCaseAudit, [CaseAction.CASE_AUDIT]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/restore-case-file-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { restoreCaseFile } from '@aws/dea-app/lib/app/resources/restore-case-file';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(restoreCaseFile, [CaseAction.RESTORE_FILES]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/create-case-user-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { createCaseMembership } from '@aws/dea-app/lib/app/resources/create-case-membership';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(createCaseMembership, [CaseAction.INVITE]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/delete-case-user-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { deleteCaseMembership } from '@aws/dea-app/lib/app/resources/delete-case-membership';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(deleteCaseMembership, [CaseAction.INVITE]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-case-file-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getCaseFileAudit } from '@aws/dea-app/lib/app/resources/audit/get-case-file-audit';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(getCaseFileAudit, [CaseAction.CASE_AUDIT]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/update-case-status-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { updateCaseStatus } from '@aws/dea-app/lib/app/resources/update-case-status';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(updateCaseStatus, [CaseAction.UPDATE_CASE_STATUS]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/update-case-user-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { updateCaseMembership } from '@aws/dea-app/lib/app/resources/update-case-membership';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(updateCaseMembership, [CaseAction.INVITE]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/get-case-file-detail-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getCaseFileDetails } from '@aws/dea-app/lib/app/resources/get-case-file-details';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(getCaseFileDetails, [CaseAction.VIEW_FILES]);
11 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/models/DataSyncTask.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { DeaDataSyncTask } from '@aws/dea-app/lib/models/data-sync-task';
7 |
8 | export interface DeaDataSyncTaskDTO extends DeaDataSyncTask {
9 | dataVaultName?: string;
10 | }
11 | export enum TaskStatus {
12 | AVAILABLE = 'AVAILABLE',
13 | QUEUED = 'QUEUED',
14 | RUNNING = 'RUNNING',
15 | UNAVAILABLE = 'UNAVAILABLE',
16 | }
17 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/session.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface DeaSession {
7 | readonly userUlid: string;
8 | readonly tokenId: string;
9 | readonly ttl: number;
10 | readonly isRevoked: boolean;
11 | readonly created?: Date;
12 | readonly updated?: Date;
13 | }
14 |
15 | export interface DeaSessionInput {
16 | readonly userUlid: string;
17 | readonly tokenId: string;
18 | }
19 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/app/transform/firehoseEventExample:
--------------------------------------------------------------------------------
1 | {
2 | "messageType": "DATA_MESSAGE",
3 | "owner": "123456789012",
4 | "logGroup": "log_group_name",
5 | "logStream": "log_stream_name",
6 | "subscriptionFilters": [
7 | "subscription_filter_name"
8 | ],
9 | "logEvents": [
10 | {
11 | "id": "01234567890123456789012345678901234567890123456789012345",
12 | "timestamp": 1510109208016,
13 | "message": "{\"value\":\"something\"}\n{\"value\":\"something2\"}\n"
14 | }
15 | ]
16 | }
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/request-case-file-audit-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { startCaseFileAudit } from '@aws/dea-app/lib/app/resources/audit/start-case-file-audit';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(startCaseFileAudit, [CaseAction.CASE_AUDIT]);
11 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/data-sync-task.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface DeaDataSyncTask {
7 | readonly taskArn: string;
8 | readonly taskId: string;
9 | readonly sourceLocationArn?: string;
10 | readonly destinationLocationArn?: string;
11 | readonly dataVaultUlid?: string;
12 | readonly status?: string;
13 | readonly created?: Date;
14 | readonly lastExecutionCompleted?: Date;
15 | }
16 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/complete-case-file-upload-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { completeCaseFileUpload } from '@aws/dea-app/lib/app/resources/complete-case-file-upload';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(completeCaseFileUpload, [CaseAction.UPLOAD]);
11 |
--------------------------------------------------------------------------------
/source/dea-backend/src/handlers/initiate-case-file-upload-handler.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { initiateCaseFileUpload } from '@aws/dea-app/lib/app/resources/initiate-case-file-upload';
7 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
8 | import { createDeaHandler } from './create-dea-handler';
9 |
10 | export const handler = createDeaHandler(initiateCaseFileUpload, [CaseAction.UPLOAD]);
11 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/validation/auth.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import Joi from 'joi';
7 | import { idToken, refreshToken } from './joi-common';
8 |
9 | export const Oauth2TokenSchema = Joi.object({
10 | id_token: idToken.required(),
11 | refresh_token: refreshToken.required(),
12 | expires_in: Joi.number(),
13 | });
14 |
15 | export const ExchangeTokenSchema = Joi.object({
16 | codeVerifier: Joi.string(),
17 | });
18 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/public/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/source/common/autoinstallers/commitlint/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "commitlint",
3 | "version": "1.0.0",
4 | "license": "Apache-2.0",
5 | "description": "commitlint autoinstaller",
6 | "private": true,
7 | "dependencies": {
8 | "@commitlint/cli": "^18.6.0",
9 | "@commitlint/config-conventional": "^18.6.0"
10 | },
11 | "devDependencies": {
12 | "@types/node": "^18.15.7",
13 | "typescript": "^4.9.5"
14 | },
15 | "peerDependencies": {
16 | "@types/node": "^18.15.7",
17 | "typescript": "^4.9.5"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/case-user.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from "./case-action";
7 |
8 | export interface CaseUser {
9 | readonly caseUlid: string;
10 | readonly userUlid: string;
11 | readonly actions: CaseAction[];
12 | readonly caseName: string;
13 | readonly userFirstName: string;
14 | readonly userLastName: string;
15 | readonly created?: Date;
16 | readonly updated?: Date;
17 | }
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 | import { Html, Head, Main, NextScript } from 'next/document';
6 |
7 | // INFO: we can remove this file when doing localization
8 |
9 | const Document = () => {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Document;
22 |
--------------------------------------------------------------------------------
/source/dea-app/.depcheckrc:
--------------------------------------------------------------------------------
1 | ignores: [
2 | '@aws/eslint-config-workbench-core-eslint-custom',
3 | '@rushstack/heft-jest-plugin',
4 | '@rushstack/heft-node-rig',
5 | '@types/heft-jest',
6 | 'eslint-plugin-import',
7 | 'eslint-plugin-security',
8 | 'npm-package-json-lint-config-default',
9 | '@types/node'
10 | ]
11 | ignore-patterns: [
12 | // files matching these patterns will be ignored
13 | '.heft',
14 | '.rush',
15 | 'config',
16 | 'lib',
17 | 'node_modules',
18 | 'temp',
19 | ]
20 | skip-missing: true
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/helpers/date-helper.unit.test.ts:
--------------------------------------------------------------------------------
1 | import * as datehelper from '../../src/helpers/dateHelper';
2 |
3 | const date1 = new Date('05 October 2011 14:48 UTC');
4 |
5 | describe('date helper', () => {
6 | it('is not iso string', async () => {
7 | expect(datehelper.formatDate(undefined, 'en-us')).toEqual('-');
8 | expect(datehelper.formatDate(undefined)).toEqual('-');
9 | expect(datehelper.formatDateTime(undefined, 'en-us')).toEqual('-');
10 | expect(datehelper.formatDateTime(undefined)).toEqual('-');
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/source/dea-backend/src/oas-2.0/openapi-availableEndpoints.yml:
--------------------------------------------------------------------------------
1 | swagger: '2.0'
2 | info:
3 | version: 1.1.1
4 | title: DEA Available Endpoints API
5 | paths:
6 | /availableEndpoints:
7 | get:
8 | summary: Get available endpoints for a user
9 | tags:
10 | - cases
11 | responses:
12 | 200:
13 | description: Success Response
14 | schema:
15 | type: object
16 | properties:
17 | endpoints:
18 | type: array
19 | items:
20 | type: string
21 |
22 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation-improvements.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Documentation improvements
3 | about: Suggest a documentation update
4 | title: ""
5 | labels: documentation
6 | assignees: ""
7 | ---
8 |
9 | **What were you initially searching for in the docs?**
10 |
11 |
12 |
13 | **Is this related to an existing part of the documentation? Please share a link**
14 |
15 | **Describe how we could make it clearer**
16 |
17 | **If you have a proposed update, please share it here**
18 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/exceptions/forbidden-exception.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export const FORBIDDEN_ERROR_NAME = 'Forbidden';
7 |
8 | // This will map to 403 in our ExceptionHandlers,
9 | // throw it anywhere with a message indicating the data that was expected to have the lambda wrapper handle the return for you
10 | export class ForbiddenError extends Error {
11 | constructor(message: string) {
12 | super(message);
13 | this.name = FORBIDDEN_ERROR_NAME;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/exceptions/not-found-exception.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export const NOT_FOUND_ERROR_NAME = 'NotFoundError';
7 |
8 | // This will map to 404 in our ExceptionHandlers,
9 | // throw it anywhere with a message indicating the data that was expected to have the lambda wrapper handle the return for you
10 | export class NotFoundError extends Error {
11 | constructor(message: string) {
12 | super(message);
13 | this.name = NOT_FOUND_ERROR_NAME;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/src/test/sri/add-subresource-integrity.unit.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { generateSri } from '../../generate-subresource-integrity';
7 |
8 | describe('addsri', () => {
9 | it('calculate integrity hashes', () => {
10 | const sriArray = generateSri('./src/test/sri/', 'sha384');
11 |
12 | expect(sriArray.join('')).toEqual(
13 | 'sha384-qCm5kqE3cGJ/89mY9eVIhR052I7x4CsSarEUcoGhpz+Tn7jaS7nHoWxlqNGoKHBO'
14 | );
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/exceptions/validation-exception.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export const VALIDATION_ERROR_NAME = 'DEAValidationError';
7 |
8 | // This will map to 400 in our ExceptionHandlers,
9 | // throw it anywhere with a message indicating the failed validation to have the lambda wrapper handle the return for you
10 | export class ValidationError extends Error {
11 | constructor(message: string) {
12 | super(message);
13 | this.name = VALIDATION_ERROR_NAME;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/get-case-details.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 |
11 | const getCaseDetailsArgs: argsType = [
12 | 'getCaseDetailsACLs',
13 | [CaseAction.VIEW_CASE_DETAILS],
14 | `cases/${CASE_ID}/details`,
15 | 'GET',
16 | ];
17 |
18 | validateEndpointACLs(...getCaseDetailsArgs);
19 |
--------------------------------------------------------------------------------
/source/dea-main/.depcheckrc:
--------------------------------------------------------------------------------
1 | ignores: [
2 | '@aws/eslint-config-workbench-core-eslint-custom',
3 | '@rushstack/heft-jest-plugin',
4 | '@rushstack/heft-node-rig',
5 | '@types/heft-jest',
6 | 'eslint-plugin-import',
7 | 'eslint-plugin-security',
8 | 'npm-package-json-lint-config-default'
9 | ]
10 | ignore-patterns: [
11 | // files matching these patterns will be ignored
12 | '.heft',
13 | '.rush',
14 | 'build',
15 | 'config',
16 | 'cdk.out',
17 | 'lib',
18 | 'node_modules',
19 | 'src/__tests__/__snapshots__',
20 | 'temp',
21 | ]
22 | skip-missing: true
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/models/Cases.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseStatus } from '@aws/dea-app/lib/models/case-status';
7 |
8 | export interface CreateCaseForm {
9 | name: string;
10 | description?: string;
11 | }
12 |
13 | export interface UpdateCaseStatusForm {
14 | name: string;
15 | caseId: string;
16 | status: CaseStatus;
17 | deleteFiles: boolean;
18 | }
19 |
20 | export interface EditCaseForm {
21 | ulid: string;
22 | name: string;
23 | description?: string;
24 | }
25 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/user.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface DeaUser {
7 | readonly ulid: string;
8 | readonly tokenId: string;
9 | readonly idPoolId?: string;
10 | readonly firstName: string;
11 | readonly lastName: string;
12 | readonly created?: Date;
13 | readonly updated?: Date;
14 | }
15 |
16 | export interface DeaUserInput {
17 | readonly tokenId: string;
18 | readonly idPoolId?: string;
19 | readonly firstName: string;
20 | readonly lastName: string;
21 | }
22 |
--------------------------------------------------------------------------------
/source/dea-backend/.depcheckrc:
--------------------------------------------------------------------------------
1 | ignores: [
2 | '@aws/eslint-config-workbench-core-eslint-custom',
3 | '@rushstack/heft-jest-plugin',
4 | '@rushstack/heft-node-rig',
5 | '@types/heft-jest',
6 | 'eslint-plugin-import',
7 | 'eslint-plugin-security',
8 | 'npm-package-json-lint-config-default'
9 | ]
10 | ignore-patterns: [
11 | // files matching these patterns will be ignored
12 | '.heft',
13 | '.rush',
14 | 'build',
15 | 'config',
16 | 'cdk.out',
17 | 'lib',
18 | 'node_modules',
19 | 'src/__tests__/__snapshots__',
20 | 'temp',
21 | ]
22 | skip-missing: true
--------------------------------------------------------------------------------
/source/dea-app/src/models/case-action.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export enum CaseAction {
7 | VIEW_CASE_DETAILS = 'VIEW_CASE_DETAILS',
8 | UPDATE_CASE_DETAILS = 'UPDATE_CASE_DETAILS',
9 | UPDATE_CASE_STATUS = 'UPDATE_CASE_STATUS',
10 | UPLOAD = 'UPLOAD',
11 | DOWNLOAD = 'DOWNLOAD',
12 | VIEW_FILES = 'VIEW_FILES',
13 | CASE_AUDIT = 'CASE_AUDIT',
14 | INVITE = 'INVITE',
15 | RESTORE_FILES = 'RESTORE_FILES',
16 | }
17 |
18 | export const OWNER_ACTIONS: CaseAction[] = Object.values(CaseAction);
19 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/case-audit-query.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 |
11 | const caseAuditQueryArgs: argsType = [
12 | 'startCaseAuditQuery',
13 | [CaseAction.CASE_AUDIT],
14 | `cases/${CASE_ID}/audit`,
15 | 'POST',
16 | undefined,
17 | ];
18 |
19 | validateEndpointACLs(...caseAuditQueryArgs);
20 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/list-case-files.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 |
11 | const listCaseFilesArgs: argsType = [
12 | 'listCaseFiles',
13 | [CaseAction.VIEW_FILES],
14 | `cases/${CASE_ID}/files`,
15 | 'GET',
16 | undefined,
17 | false,
18 | ];
19 |
20 | validateEndpointACLs(...listCaseFilesArgs);
21 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/services/service-helpers.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export async function retry(fn: () => Promise, retries = 5, intervalInMs = 300) {
7 | for (let i = 0; i < retries; i++) {
8 | try {
9 | return await fn();
10 | } catch (e) {
11 | if (i < retries - 1) {
12 | await sleep(intervalInMs);
13 | } else {
14 | throw e;
15 | }
16 | }
17 | }
18 | }
19 |
20 | const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
21 |
--------------------------------------------------------------------------------
/source/dea-main/config/jest.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json",
3 | "collectCoverage": true,
4 | "collectCoverageFrom": ["src/**"],
5 | "coveragePathIgnorePatterns": ["/src/index.ts", "/src/test/"],
6 | "coverageThreshold": {
7 | "global": {
8 | "branches": 75,
9 | "functions": 75,
10 | "lines": 75,
11 | "statements": 75
12 | }
13 | },
14 | "coverageReporters": ["json-summary", "json", "lcov", "text"],
15 | "moduleNameMapper": {
16 | "#node-web-compat": "./node-web-compat-node.js"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this solution
4 | title: ""
5 | labels: feature-request, enhancement
6 | assignees: ""
7 | ---
8 |
9 | **Is your feature request related to a problem? Please describe.**
10 |
11 |
12 |
13 | **Describe the feature you'd like**
14 |
15 |
16 |
17 | **Additional context**
18 |
19 |
20 |
--------------------------------------------------------------------------------
/source/dea-backend/cdk.json:
--------------------------------------------------------------------------------
1 | {
2 | "app": "lib/index.js",
3 | "watch": {
4 | "include": ["**"],
5 | "exclude": [
6 | "README.md",
7 | "cdk*.json",
8 | "**/*.d.ts",
9 | "**/*.js",
10 | "tsconfig.json",
11 | "package*.json",
12 | "yarn.lock",
13 | "node_modules",
14 | "test"
15 | ]
16 | },
17 | "context": {
18 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
19 | "@aws-cdk/core:stackRelativeExports": true,
20 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
21 | "@aws-cdk/aws-lambda:recognizeVersionProps": true
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/source/dea-backend/config/jest.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json",
3 | "collectCoverage": true,
4 | "collectCoverageFrom": ["src/**"],
5 | "coveragePathIgnorePatterns": ["/src/test/", "/src/index.ts"],
6 | "coverageThreshold": {
7 | "global": {
8 | "branches": 70,
9 | "functions": 75,
10 | "lines": 75,
11 | "statements": 75
12 | }
13 | },
14 | "coverageReporters": ["json-summary", "json", "lcov", "text"],
15 | "moduleNameMapper": {
16 | "#node-web-compat": "./node-web-compat-node.js"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/api/models/api-results.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface DeaListResult {
7 | data: T[];
8 | isLoading: boolean;
9 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
10 | mutate?: any;
11 | }
12 |
13 | export interface DeaSingleResult {
14 | data: T;
15 | isLoading: boolean;
16 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
17 | mutate?: any;
18 | }
19 |
20 | export interface DeaFilesResponse {
21 | files: T[];
22 | next: string;
23 | }
24 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/logger.unit.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { logLevel } from "../logger"
7 |
8 | describe('logger', () => {
9 | afterAll(() => {
10 | delete process.env.LOG_LEVEL;
11 | })
12 | it('uses a default level', () => {
13 | process.env.LOG_LEVEL = undefined;
14 | expect(logLevel()).toEqual('debug');
15 | });
16 |
17 | it('uses a specified level', () => {
18 | process.env.LOG_LEVEL = 'silly';
19 | expect(logLevel()).toEqual('silly');
20 | });
21 | });
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/components/common-components/ActionContainer.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 | export interface ActionsProps {
6 | required: string;
7 | actions: string[];
8 | children?: React.ReactNode;
9 | }
10 |
11 | export default function ActionContainer({ required, actions, children }: ActionsProps) {
12 | const isAllowedTo = (action: string): boolean => {
13 | return actions.includes(action);
14 | };
15 |
16 | if (isAllowedTo(required)) {
17 | return <>{children}>;
18 | }
19 |
20 | return <>>;
21 | }
22 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/auth.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface Oauth2Token {
7 | readonly id_token: string;
8 | readonly refresh_token: string;
9 | readonly expires_in: number;
10 | }
11 |
12 | export interface RefreshToken {
13 | readonly refreshToken: string;
14 | }
15 |
16 | export interface RevokeToken {
17 | readonly refreshToken: string;
18 | }
19 |
20 | export interface IdToken {
21 | readonly idToken: string;
22 | }
23 |
24 | export interface ExchangeToken {
25 | readonly codeVerifier: string;
26 | }
27 |
--------------------------------------------------------------------------------
/source/dea-backend/src/test/logger.unit.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { logLevel } from "../logger"
7 |
8 | describe('logger', () => {
9 | afterAll(() => {
10 | delete process.env.LOG_LEVEL;
11 | })
12 | it('uses a default level', () => {
13 | process.env.LOG_LEVEL = undefined;
14 | expect(logLevel()).toEqual('debug');
15 | });
16 |
17 | it('uses a specified level', () => {
18 | process.env.LOG_LEVEL = 'silly';
19 | expect(logLevel()).toEqual('silly');
20 | });
21 | });
--------------------------------------------------------------------------------
/source/dea-ui/ui/next.config.js:
--------------------------------------------------------------------------------
1 | const STAGE = process.env.NEXT_PUBLIC_STAGE ?? 'devsample';
2 | const USING_CUSTOM_DOMAIN = process.env.NEXT_PUBLIC_IS_USING_CUSTOM_DOMAIN?.trim().toLowerCase() === 'true';
3 |
4 | const basePath = USING_CUSTOM_DOMAIN ? `/ui` : `/${STAGE}/ui`;
5 |
6 | module.exports = {
7 | // Transpiling is natively integrated with Next.js since 13.1: https://github.com/martpie/next-transpile-modules/releases/tag/the-end
8 | transpilePackages: ['@cloudscape-design/components', '@cloudscape-design/component-toolkit'],
9 | output: 'export',
10 | reactStrictMode: true,
11 | images: { unoptimized: true },
12 | basePath,
13 | };
14 |
--------------------------------------------------------------------------------
/source/dea-main/cdk.json:
--------------------------------------------------------------------------------
1 | {
2 | "requireApproval": "never",
3 | "app": "lib/index.js",
4 | "watch": {
5 | "include": ["**"],
6 | "exclude": [
7 | "README.md",
8 | "cdk*.json",
9 | "**/*.d.ts",
10 | "**/*.js",
11 | "tsconfig.json",
12 | "package*.json",
13 | "yarn.lock",
14 | "node_modules",
15 | "test"
16 | ]
17 | },
18 | "context": {
19 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
20 | "@aws-cdk/core:stackRelativeExports": true,
21 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
22 | "@aws-cdk/aws-lambda:recognizeVersionProps": true
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/styles/Breadcrumb.module.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | @use '@cloudscape-design/design-tokens/index' as awsui;
7 |
8 | .breadcrumb-dropdown {
9 | max-width: 40vw;
10 | }
11 |
12 | .breadcrumb-disabled {
13 | color: awsui.$color-text-breadcrumb-current;
14 | }
15 |
16 | // targets mobile devices only: https://www.icwebdesign.co.uk/common-viewport-sizes
17 | @media only screen and (max-width: 481px) {
18 | .breadcrumb-dropdown {
19 | min-width: 79vw;
20 | max-width: 320px;
21 | padding-top: 4px;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Config:
--------------------------------------------------------------------------------
1 | package.Digital-evidence-archive = {
2 | interfaces = (1.0);
3 |
4 | # Use NoOpBuild.
5 | build-system = no-op;
6 | build-tools = {
7 | 1.0 = {
8 | NoOpBuild = 1.0;
9 | };
10 | };
11 |
12 | # Use runtime-dependencies for when you want to bring in additional
13 | # packages when deploying.
14 | # Use dependencies instead if you intend for these dependencies to
15 | # be exported to other packages that build against you.
16 | dependencies = {
17 | 1.0 = {
18 | };
19 | };
20 |
21 | runtime-dependencies = {
22 | 1.0 = {
23 | };
24 | };
25 |
26 | };
27 |
28 |
--------------------------------------------------------------------------------
/source/common/changes/@aws/workbench-core-authentication/fix-re-enable-cookie-based-authentication_2022-08-15-17-33.json:
--------------------------------------------------------------------------------
1 | {
2 | "changes": [
3 | {
4 | "packageName": "@aws/workbench-core-authentication",
5 | "comment": "Added option to middleware to set the sameSite cookie option if 'strict' is too restrictive, removed Authorization header based authentication, now using maxAge instead of expires for auth cookies, changed getTimeInSeconds to getTimeInMS, cognitoAuthenticationPlugin now uses ms internally, validateToken now only validates access tokens",
6 | "type": "minor"
7 | }
8 | ],
9 | "packageName": "@aws/workbench-core-authentication"
10 | }
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/get-case-collabs.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 |
11 | const getCaseCollabsArgs: argsType = [
12 | 'getCaseCollaborators',
13 | [CaseAction.INVITE],
14 | `cases/${CASE_ID}/userMemberships`,
15 | 'GET',
16 | undefined,
17 | false,
18 | false,
19 | false,
20 | true,
21 | ];
22 |
23 | validateEndpointACLs(...getCaseCollabsArgs);
24 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/delete-membership.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const COMPANION_ID = '{companion}';
10 | const CASE_ID = '{caseId}';
11 |
12 | const deleteMembershipArgs: argsType = [
13 | 'removeFromCaseACLs',
14 | [CaseAction.INVITE],
15 | `cases/${CASE_ID}/users/${COMPANION_ID}/memberships`,
16 | 'DELETE',
17 | undefined,
18 | true,
19 | ];
20 |
21 | validateEndpointACLs(...deleteMembershipArgs);
22 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/get-case-file-details.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 | const FILE_ID = '{fileId}';
11 |
12 | const getCaseFileDetailsArgs: argsType = [
13 | 'getCaseFileDetails',
14 | [CaseAction.VIEW_FILES],
15 | `cases/${CASE_ID}/files/${FILE_ID}/info`,
16 | 'GET',
17 | undefined,
18 | false,
19 | true,
20 | ];
21 |
22 | validateEndpointACLs(...getCaseFileDetailsArgs);
23 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/case-audit.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 | const AUDIT_ID = '{auditId}';
11 |
12 | const caseAuditArgs: argsType = [
13 | 'getCaseAudit',
14 | [CaseAction.CASE_AUDIT],
15 | `cases/${CASE_ID}/audit/${AUDIT_ID}/csv`,
16 | 'GET',
17 | undefined,
18 | false,
19 | false,
20 | false,
21 | false,
22 | true,
23 | ];
24 |
25 | validateEndpointACLs(...caseAuditArgs);
26 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/restore-case-file.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 | const FILE_ID = '{fileId}';
11 |
12 | const restoreCaseFileArgs: argsType = [
13 | 'restoreCaseFile',
14 | [CaseAction.RESTORE_FILES],
15 | `cases/${CASE_ID}/files/${FILE_ID}/restore`,
16 | 'PUT',
17 | undefined,
18 | false,
19 | true,
20 | false,
21 | true,
22 | ];
23 |
24 | validateEndpointACLs(...restoreCaseFileArgs);
25 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/data-vault.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface DeaDataVault {
7 | readonly ulid: string;
8 | readonly name: string;
9 | readonly description?: string;
10 | readonly objectCount: number;
11 | readonly totalSizeBytes: number;
12 | readonly created?: Date;
13 | readonly updated?: Date;
14 | }
15 |
16 | export interface DeaDataVaultInput {
17 | readonly name: string;
18 | readonly description?: string;
19 | }
20 |
21 | export interface DeaDataVaultUpdateInput {
22 | readonly ulid: string;
23 | readonly name: string;
24 | readonly description?: string;
25 | }
26 |
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/src/test/infra/validate-dea-ui-construct.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { Template } from 'aws-cdk-lib/assertions';
7 |
8 | export const validateDeaUiConstruct = (template: Template): void => {
9 | template.hasResourceProperties('AWS::ApiGateway::RestApi', {
10 | Description: 'Backend API',
11 | });
12 |
13 | template.hasResourceProperties('AWS::S3::Bucket', {
14 | PublicAccessBlockConfiguration: {
15 | BlockPublicAcls: true,
16 | BlockPublicPolicy: true,
17 | IgnorePublicAcls: true,
18 | RestrictPublicBuckets: true,
19 | },
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/invite-to-case.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const COMPANION_ID = '{companion}';
10 | const CASE_ID = '{caseId}';
11 |
12 | const inviteToCasesArgs: argsType = [
13 | 'inviteToCaseACLs',
14 | [CaseAction.INVITE],
15 | `cases/${CASE_ID}/userMemberships`,
16 | 'POST',
17 | JSON.stringify({
18 | userUlid: COMPANION_ID,
19 | caseUlid: CASE_ID,
20 | actions: [],
21 | }),
22 | ];
23 |
24 | validateEndpointACLs(...inviteToCasesArgs);
25 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/put-case-details.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 | const RANDOM_STRING = '{rand}';
11 |
12 | const putCaseDetailsArgs: argsType = [
13 | 'putCaseDetailsACLs',
14 | [CaseAction.UPDATE_CASE_DETAILS],
15 | `cases/${CASE_ID}/details`,
16 | 'PUT',
17 | JSON.stringify({
18 | ulid: CASE_ID,
19 | name: RANDOM_STRING,
20 | description: RANDOM_STRING,
21 | }),
22 | ];
23 |
24 | validateEndpointACLs(...putCaseDetailsArgs);
25 |
--------------------------------------------------------------------------------
/source/dea-backend/src/constructs/construct-support.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CfnOutput, CfnOutputProps } from 'aws-cdk-lib';
7 | import { Construct } from 'constructs';
8 | import { deaConfig } from '../config';
9 |
10 | // methods created to avoid linting/sonarqube errors related to unused objects (eslint no-new)
11 | export const createCfnOutput = (scope: Construct, id: string, props: CfnOutputProps): CfnOutput => {
12 | return new CfnOutput(
13 | scope,
14 | id,
15 | Object.assign(
16 | {},
17 | {
18 | ...props,
19 | exportName: `${deaConfig.stage()}-${id}`
20 | }
21 | )
22 | );
23 | };
24 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/cypress/support/e2e.ts:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/e2e.ts is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands'
18 |
19 | // Alternatively you can use CommonJS syntax:
20 | // require('./commands')
--------------------------------------------------------------------------------
/source/dea-app/src/app/exceptions/reauthentication-exception.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export const REAUTHENTICATION_ERROR_NAME = 'Reauthentication';
7 |
8 | // This will map to 412 in our ExceptionHandlers,
9 | // Used for CJIS Session Management Requirement Failures
10 | // E.g. no Concurrent User Sessions and Session Lock after 30 minutes of inactivity
11 | // throw it anywhere with a message indicating the data that was expected to have the lambda wrapper handle the return for you
12 | export class ReauthenticationError extends Error {
13 | constructor(message: string) {
14 | super(message);
15 | this.name = REAUTHENTICATION_ERROR_NAME;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Don't allow people to merge changes to these generated files, because the result
2 | # may be invalid. You need to run "rush update" again.
3 | pnpm-lock.yaml merge=text
4 | shrinkwrap.yaml merge=binary
5 | npm-shrinkwrap.json merge=binary
6 | yarn.lock merge=binary
7 |
8 | # Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic
9 | # syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor
10 | # may also require a special configuration to allow comments in JSON.
11 | #
12 | # For more information, see this issue: https://github.com/microsoft/rushstack/issues/1088
13 | #
14 | *.json linguist-language=JSON-with-Comments
15 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/put-case-user.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const COMPANION_ID = '{companion}';
10 | const CASE_ID = '{caseId}';
11 |
12 | const putCaseUserArgs: argsType = [
13 | 'putCaseUserACLs',
14 | [CaseAction.INVITE],
15 | `cases/${CASE_ID}/users/${COMPANION_ID}/memberships`,
16 | 'PUT',
17 | JSON.stringify({
18 | userUlid: COMPANION_ID,
19 | caseUlid: CASE_ID,
20 | actions: [CaseAction.DOWNLOAD],
21 | }),
22 | true,
23 | ];
24 |
25 | validateEndpointACLs(...putCaseUserArgs);
26 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/migrations/audit-redrive-command.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import minimist from 'minimist';
7 | import { auditRedrive } from './audit-redrive';
8 |
9 | const args = minimist(process.argv.slice(2));
10 |
11 | const verifyRequiredParam = (name: string) => {
12 | if (args[name] === undefined) {
13 | console.error(`required parameter '--${name}' is unspecified`);
14 | process.exit(1);
15 | }
16 | };
17 |
18 | verifyRequiredParam('startTimeMilliseconds');
19 | verifyRequiredParam('endTimeMilliseconds');
20 | const dryRun = args['dryRun'] !== 'false';
21 |
22 | void auditRedrive(Number(args.startTimeMilliseconds), Number(args.endTimeMilliseconds), dryRun);
23 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/local-dev-support/delete-user.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import minimist from 'minimist';
7 | import CognitoHelper from '../../test-e2e/helpers/cognito-helper';
8 |
9 | const args = minimist(process.argv.slice(2));
10 |
11 | const deleteUser = async (userName: string) => {
12 | await cognitoHelper.deleteUser(userName);
13 | };
14 |
15 | const verifyRequiredParam = (name: string) => {
16 | if (!args[name]) {
17 | console.error(`required parameter '--${name}' is unspecified`);
18 | process.exit(1);
19 | }
20 | };
21 |
22 | verifyRequiredParam('username');
23 |
24 | const cognitoHelper = new CognitoHelper();
25 |
26 | void deleteUser(args.username);
27 |
--------------------------------------------------------------------------------
/source/common/config/rush/rush-plugins.json:
--------------------------------------------------------------------------------
1 | /**
2 | * This configuration file manages Rush's plugin feature.
3 | */
4 | {
5 | "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-plugins.schema.json",
6 | "plugins": [
7 | /**
8 | * Each item defines a plugin configuration used by Rush.
9 | */
10 | // {
11 | // /**
12 | // * The name of the rush plugin package.
13 | // */
14 | // "packageName": "@scope/my-rush-plugin",
15 | // /**
16 | // * The name of the plugin provided by rush plugin package
17 | // */
18 | // "pluginName": "my-plugin-name",
19 | // /**
20 | // * Autoinstaller name used to install the plugin.
21 | // */
22 | // "autoinstallerName": "plugins"
23 | // }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/components/header.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import { fireEvent, render, screen } from "@testing-library/react";
2 | import Header from "../../src/components/Header"
3 |
4 | describe('header', () => {
5 | it('renders top navigation with sign out', async () => {
6 | render();
7 | const nav = screen.getByTestId('header-top-navigation');
8 |
9 | expect(nav).toBeTruthy();
10 |
11 | //click the user button to reveal the signout button
12 | const userBtn = await screen.findByRole('button');
13 | expect(userBtn).toBeTruthy();
14 | fireEvent.click(userBtn);
15 |
16 | const signOutBtn = await screen.findByText('Sign out');
17 | expect(signOutBtn).toBeTruthy();
18 | fireEvent.click(signOutBtn);
19 | });
20 | });
--------------------------------------------------------------------------------
/source/dea-app/config/jest.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json",
3 | "collectCoverage": true,
4 | "coverageThreshold": {
5 | "global": {
6 | "branches": 70,
7 | "functions": 90,
8 | "lines": 90,
9 | "statements": 90
10 | }
11 | },
12 | "coverageReporters": ["json-summary", "json", "lcov", "text"],
13 | "collectCoverageFrom": ["src/**"],
14 | "coveragePathIgnorePatterns": ["/src/test-e2e/", "/src/test/", "/src/index.ts"],
15 | "globalSetup": "/src/test/local-dynamo/setup.ts",
16 | "globalTeardown": "/src/test/local-dynamo/teardown.ts",
17 | "moduleNameMapper": {
18 | "#node-web-compat": "./node-web-compat-node.js"
19 | },
20 | "testTimeout": 10000
21 | }
22 |
--------------------------------------------------------------------------------
/source/dea-app/license-add-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "license": "../apache-license-header.txt",
3 | "ignoreFile": "../.licenseignorefile",
4 | "defaultFormat": {
5 | "gitignore|npmignore|eslintignore|dockerignore|sh|py": {
6 | "eachLine": {
7 | "prepend": "# "
8 | }
9 | },
10 | "html|xml|svg": {
11 | "prepend": ""
13 | },
14 | "js|ts|tsx|css|scss|less|php|as|c|java|cpp|go|cto|acl": {
15 | "prepend": "/*",
16 | "append": " */\n",
17 | "eachLine": {
18 | "prepend": " * "
19 | }
20 | },
21 | "txt": {}
22 | },
23 | "licenseFormats": {
24 | "ts|tsx": {
25 | "prepend": "/*",
26 | "append": " */\n",
27 | "eachLine": {
28 | "prepend": " * "
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/dea-main/license-add-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "license": "../apache-license-header.txt",
3 | "ignoreFile": "../.licenseignorefile",
4 | "defaultFormat": {
5 | "gitignore|npmignore|eslintignore|dockerignore|sh|py": {
6 | "eachLine": {
7 | "prepend": "# "
8 | }
9 | },
10 | "html|xml|svg": {
11 | "prepend": ""
13 | },
14 | "js|ts|tsx|css|scss|less|php|as|c|java|cpp|go|cto|acl": {
15 | "prepend": "/*",
16 | "append": " */\n",
17 | "eachLine": {
18 | "prepend": " * "
19 | }
20 | },
21 | "txt": {}
22 | },
23 | "licenseFormats": {
24 | "ts|tsx": {
25 | "prepend": "/*",
26 | "append": " */\n",
27 | "eachLine": {
28 | "prepend": " * "
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/dea-backend/license-add-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "license": "../apache-license-header.txt",
3 | "ignoreFile": "../.licenseignorefile",
4 | "defaultFormat": {
5 | "gitignore|npmignore|eslintignore|dockerignore|sh|py": {
6 | "eachLine": {
7 | "prepend": "# "
8 | }
9 | },
10 | "html|xml|svg": {
11 | "prepend": ""
13 | },
14 | "js|ts|tsx|css|scss|less|php|as|c|java|cpp|go|cto|acl": {
15 | "prepend": "/*",
16 | "append": " */\n",
17 | "eachLine": {
18 | "prepend": " * "
19 | }
20 | },
21 | "txt": {}
22 | },
23 | "licenseFormats": {
24 | "ts|tsx": {
25 | "prepend": "/*",
26 | "append": " */\n",
27 | "eachLine": {
28 | "prepend": " * "
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/license-add-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "license": "../../apache-license-header.txt",
3 | "ignoreFile": "../../.licenseignorefile",
4 | "defaultFormat": {
5 | "gitignore|npmignore|eslintignore|dockerignore|sh|py": {
6 | "eachLine": {
7 | "prepend": "# "
8 | }
9 | },
10 | "html|xml|svg": {
11 | "prepend": ""
13 | },
14 | "js|ts|tsx|css|scss|less|php|as|c|java|cpp|go|cto|acl": {
15 | "prepend": "/*",
16 | "append": " */\n",
17 | "eachLine": {
18 | "prepend": " * "
19 | }
20 | },
21 | "txt": {}
22 | },
23 | "licenseFormats": {
24 | "ts|tsx": {
25 | "prepend": "/*",
26 | "append": " */\n",
27 | "eachLine": {
28 | "prepend": " * "
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/.github/workflows/pipeline-workflow.yml:
--------------------------------------------------------------------------------
1 | name: Pipeline Workflow
2 |
3 | env:
4 | REGION: us-east-1
5 |
6 | on:
7 | push:
8 | branches: [main, develop, release-v1.0.0]
9 |
10 | jobs:
11 | pipeline-job:
12 | name: Pipeline Job
13 | runs-on: ubuntu-latest
14 | permissions:
15 | id-token: write
16 | steps:
17 | - name: Configure AWS credentials
18 | uses: aws-actions/configure-aws-credentials@v1
19 | with:
20 | role-to-assume: ${{ secrets.DISPATCHER_ROLE_ARN }}
21 | aws-region: ${{ env.REGION }}
22 | role-duration-seconds: 900
23 | role-session-name: OIDCSession
24 | - name: Run CodeBuild
25 | uses: aws-actions/aws-codebuild-run-build@v1
26 | with:
27 | project-name: ${{ secrets.DISPATCHER_CODEBUILD_PROJECT_NAME }}
28 |
--------------------------------------------------------------------------------
/source/dea-app/config/rig.json:
--------------------------------------------------------------------------------
1 | // The "rig.json" file directs tools to look for their config files in an external package.
2 | // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
3 | {
4 | "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
5 |
6 | /**
7 | * (Required) The name of the rig package to inherit from.
8 | * It should be an NPM package name with the "-rig" suffix.
9 | */
10 | "rigPackageName": "@rushstack/heft-node-rig"
11 |
12 | /**
13 | * (Optional) Selects a config profile from the rig package. The name must consist of
14 | * lowercase alphanumeric words separated by hyphens, for example "sample-profile".
15 | * If omitted, then the "default" profile will be used."
16 | */
17 | // "rigProfile": "your-profile-name"
18 | }
19 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-available-endpoints.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getAvailableEndpoints } from '../services/parameter-service';
7 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
8 | import { responseOk } from './dea-lambda-utils';
9 |
10 | export const getAvailableEndpointsForUser: DEAGatewayProxyHandler = async (
11 | event,
12 | context,
13 | /* the default case is handled in e2e tests */
14 | /* istanbul ignore next */
15 | providers = defaultProviders
16 | ) => {
17 | const actions = await getAvailableEndpoints(event, providers.parametersProvider, providers.cacheProvider);
18 | return responseOk(event, { endpoints: actions });
19 | };
20 |
--------------------------------------------------------------------------------
/source/dea-main/config/rig.json:
--------------------------------------------------------------------------------
1 | // The "rig.json" file directs tools to look for their config files in an external package.
2 | // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
3 | {
4 | "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
5 |
6 | /**
7 | * (Required) The name of the rig package to inherit from.
8 | * It should be an NPM package name with the "-rig" suffix.
9 | */
10 | "rigPackageName": "@rushstack/heft-node-rig"
11 |
12 | /**
13 | * (Optional) Selects a config profile from the rig package. The name must consist of
14 | * lowercase alphanumeric words separated by hyphens, for example "sample-profile".
15 | * If omitted, then the "default" profile will be used."
16 | */
17 | // "rigProfile": "your-profile-name"
18 | }
19 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/components/data-vaults-table/dataVaultListDefinitions.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { PropertyFilterProperty } from '@cloudscape-design/collection-hooks';
7 | import { PropertyFilterProps } from '@cloudscape-design/components';
8 |
9 | export const filteringProperties: readonly PropertyFilterProperty[] = [
10 | {
11 | key: 'name',
12 | operators: ['=', '!=', ':', '!:'],
13 | propertyLabel: 'Data Vault Name',
14 | groupValuesLabel: 'Data Vault Name Values',
15 | },
16 | ];
17 |
18 | export const searchableColumns: string[] = ['name'];
19 |
20 | export const filteringOptions: readonly PropertyFilterProps.FilteringOption[] = [
21 | { propertyKey: 'name', value: '' },
22 | ];
23 |
--------------------------------------------------------------------------------
/source/dea-backend/config/rig.json:
--------------------------------------------------------------------------------
1 | // The "rig.json" file directs tools to look for their config files in an external package.
2 | // Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
3 | {
4 | "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
5 |
6 | /**
7 | * (Required) The name of the rig package to inherit from.
8 | * It should be an NPM package name with the "-rig" suffix.
9 | */
10 | "rigPackageName": "@rushstack/heft-node-rig"
11 |
12 | /**
13 | * (Optional) Selects a config profile from the rig package. The name must consist of
14 | * lowercase alphanumeric words separated by hyphens, for example "sample-profile".
15 | * If omitted, then the "default" profile will be used."
16 | */
17 | // "rigProfile": "your-profile-name"
18 | }
19 |
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/license-add-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "license": "../../apache-license-header.txt",
3 | "ignoreFile": "../../.licenseignorefile",
4 | "defaultFormat": {
5 | "gitignore|npmignore|eslintignore|dockerignore|sh|py": {
6 | "eachLine": {
7 | "prepend": "# "
8 | }
9 | },
10 | "html|xml|svg": {
11 | "prepend": ""
13 | },
14 | "js|ts|tsx|css|scss|less|php|as|c|java|cpp|go|cto|acl": {
15 | "prepend": "/*",
16 | "append": " */\n",
17 | "eachLine": {
18 | "prepend": " * "
19 | }
20 | },
21 | "txt": {}
22 | },
23 | "licenseFormats": {
24 | "ts|tsx": {
25 | "prepend": "/*",
26 | "append": " */\n",
27 | "eachLine": {
28 | "prepend": " * "
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/dea-app/src/storage/restrict-account-statement.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { Aws } from 'aws-cdk-lib';
7 | import { PolicyStatementProps } from 'aws-cdk-lib/aws-iam';
8 |
9 | export const restrictAccountStatement = {
10 | Sid: 'AllowS3AccessInTrustedAccounts',
11 | Effect: 'Allow',
12 | Action: ['s3:PutObject', 's3:GetObject'],
13 | Resource: '*',
14 | Condition: {
15 | StringEquals: {
16 | 's3:ResourceAccount': [Aws.ACCOUNT_ID],
17 | },
18 | },
19 | };
20 |
21 | export const restrictAccountStatementStatementProps: PolicyStatementProps = {
22 | actions: restrictAccountStatement.Action,
23 | conditions: restrictAccountStatement.Condition,
24 | resources: [restrictAccountStatement.Resource],
25 | };
26 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/download-case-file.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 | const FILE_ID = '{fileId}';
11 |
12 | const downloadCaseFileArgs: argsType = [
13 | 'downloadCaseFileDetails',
14 | [CaseAction.DOWNLOAD],
15 | `cases/${CASE_ID}/files/${FILE_ID}/contents`,
16 | 'POST',
17 | JSON.stringify({
18 | caseUlid: CASE_ID,
19 | ulid: FILE_ID,
20 | downloadReason: 'i want to test file download,',
21 | }),
22 | false,
23 | true,
24 | false,
25 | true,
26 | ];
27 |
28 | validateEndpointACLs(...downloadCaseFileArgs);
29 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/complete-case-file-upload.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 | const FILE_ID = '{fileId}';
11 | const UPLOAD_ID = '{uploadId}';
12 |
13 | const completeCaseFileUploadArgs: argsType = [
14 | 'completeCaseFileUpload',
15 | [CaseAction.UPLOAD],
16 | `cases/${CASE_ID}/files/${FILE_ID}/contents`,
17 | 'PUT',
18 | JSON.stringify({
19 | caseUlid: CASE_ID,
20 | ulid: FILE_ID,
21 | uploadId: UPLOAD_ID,
22 | }),
23 | false,
24 | true,
25 | true,
26 | ];
27 |
28 | validateEndpointACLs(...completeCaseFileUploadArgs);
29 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2022",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "skipLibCheck": true,
7 | "strict": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "noEmit": true,
10 | "incremental": true,
11 | "esModuleInterop": true,
12 | "module": "esnext",
13 | "moduleResolution": "node",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "jsx": "preserve",
17 | "paths": {
18 | "^@/components/(.*)$": ["/components/*"],
19 | "^@/pages/(.*)$": ["/pages/*"]
20 | },
21 | "types": ["heft-jest", "node"]
22 | },
23 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "jest-setup.ts"],
24 | "exclude": ["cypress.config.ts", "node_modules", "infrastructure"],
25 | "rootDir": "."
26 | }
27 |
--------------------------------------------------------------------------------
/source/dea-app/src/test-e2e/acls/initiate-upload-case-file.e2e.acl.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '../../models/case-action';
7 | import { argsType, validateEndpointACLs } from '../resources/case-api-acl-tester';
8 |
9 | const CASE_ID = '{caseId}';
10 | const RANDOM_STRING = '{rand}';
11 |
12 | const initiateUploadCaseFileArgs: argsType = [
13 | 'initiateUploadCaseFile',
14 | [CaseAction.UPLOAD],
15 | `cases/${CASE_ID}/files`,
16 | 'POST',
17 | JSON.stringify({
18 | caseUlid: CASE_ID,
19 | fileName: RANDOM_STRING,
20 | filePath: `/`,
21 | contentType: 'application/octet-stream',
22 | fileSizeBytes: 1,
23 | }),
24 | false,
25 | ];
26 |
27 | validateEndpointACLs(...initiateUploadCaseFileArgs);
28 |
--------------------------------------------------------------------------------
/source/common/scripts/add-license.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | solutions=("swb-ui/infrastructure ")
4 | solutions+=$(ls solutions)
5 | workbenchCore=("repo-scripts/repo-toolbox example/express example/infrastructure ")
6 | workbenchCore+=$(ls workbench-core)
7 |
8 | for d in $solutions; do
9 | echo "$d"
10 | for f in $(find . -type f -path "*/solutions/$d/src/*.ts*"); do
11 | if ! grep -q "Copyright Amazon.com, Inc." $f
12 | then
13 | cat common/license.txt | cat - $f > temp && mv temp $f
14 | fi
15 | done
16 | done
17 |
18 | for d in $workbenchCore; do
19 | echo "$d"
20 | for f in $(find . -type f -path "*/workbench-core/$d/src/*.ts*"); do
21 | if ! grep -q "Copyright Amazon.com, Inc." $f
22 | then
23 | cat common/license.txt | cat - $f > temp && mv temp $f
24 | fi
25 | done
26 | done
27 |
--------------------------------------------------------------------------------
/source/dea-backend/src/oas-3.0/openapi-availableEndpoints.yml:
--------------------------------------------------------------------------------
1 | openapi: '3.0.0'
2 | info:
3 | version: 1.1.1
4 | title: DEA Available Endpoints API
5 | paths:
6 | # root resource path entity must match the file name or the documentation will not get attached to the right API Gateweay resource
7 | # (e.g. openapi-auth.yml must only contain '/auth' and all child APIs)
8 | /availableEndpoints:
9 | get:
10 | summary: Get available endpoints for a user
11 | tags:
12 | - cases
13 | responses:
14 | 200:
15 | description: Success Response
16 | content:
17 | application/json:
18 | schema:
19 | type: object
20 | properties:
21 | endpoints:
22 | type: array
23 | items:
24 | type: string
25 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/models/AppSettings.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export enum Language {
7 | en = 'en',
8 | es = 'es',
9 | pt = 'pt',
10 | }
11 |
12 | export interface IAppSettings {
13 | language: Language;
14 | logo: string;
15 | favicon: string;
16 | name: string;
17 | stage: string;
18 | slogan?: string;
19 | description?: string;
20 | }
21 |
22 | export const defaultAppSettings: IAppSettings = {
23 | language: Language.en,
24 | logo: 'logo.svg',
25 | favicon: 'favicon.svg',
26 | name: 'Digital Evidence Archive on AWS',
27 | slogan: 'Better ingredients better evidence',
28 | description: 'Digital Evidence Archive is the perfect place to store all your evidence.',
29 | stage: process.env.NEXT_PUBLIC_STAGE ?? 'devsample',
30 | };
31 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/pages/login.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import '@testing-library/jest-dom';
2 | import { render, screen } from '@testing-library/react';
3 | import { commonLabels } from '../../src/common/labels';
4 | import LoginPage from '../../src/pages/login';
5 |
6 | interface Query {
7 | code: string;
8 | }
9 | let query: Query = {
10 | code: 'abcdefg',
11 | };
12 | jest.mock('next/navigation', () => ({
13 | useSearchParams: () => ({
14 | get: jest.fn().mockImplementation((key: keyof Query) => query[key]),
15 | }),
16 | useRouter: () => ({
17 | push: jest.fn(),
18 | }),
19 | }));
20 |
21 | describe('LoginPage', () => {
22 | it('renders a login page when waiting to log in', async () => {
23 | const page = render();
24 | const loginLabel = screen.getByText(commonLabels.loginLabel);
25 | expect(page).toBeTruthy();
26 | expect(loginLabel).toBeTruthy();
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/pages/data-vault-association-details.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import wrapper from '@cloudscape-design/components/test-utils/dom';
2 | import '@testing-library/jest-dom';
3 | import { render, screen } from '@testing-library/react';
4 | import DataVaultAssociationDetailsBody from '../../src/components/file-details/DataVaultAssociationDetailsBody';
5 |
6 | describe('DataVault association details body', () => {
7 | const dataVaultTestName = 'Test data vault name';
8 |
9 | it('renders a data vault details section', async () => {
10 | const props = {
11 | dataVaultUlid: 'dummyulid',
12 | dataVaultName: dataVaultTestName,
13 | executionId: 'dummyexecutionid',
14 | associationCreatedBy: 'Some name',
15 | associationDate: new Date(),
16 | };
17 |
18 | render();
19 |
20 | await screen.findByText(dataVaultTestName);
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/source/common/scripts/setEnvDummy.sh:
--------------------------------------------------------------------------------
1 | export DEA_API_URL=dummyUrl
2 | export IDENTITY_POOL_ID=dummyId
3 | export USER_POOL_ID=dummyPool
4 | export USER_POOL_CLIENT_ID=dummyClient
5 | export DATASETS_BUCKET_NAME=dummyBucket
6 | export AUDIT_BUCKET_NAME=dummyAuditBucket
7 | export ATHENA_WORKGROUP_NAME=dummyWorkgroup
8 | export GLUE_TABLE=dummyTable
9 | export GLUE_DB=dummyDb
10 | export FIREHOSE_STREAM_NAME=dummyStream
11 | export AUDIT_LOG_GROUP=deaAuditLogsDummy
12 | export TRAIL_LOG_GROUP=deaTrailLogsDummy
13 | export DATASYNC_REPORTS_BUCKET_NAME=dummySyncBucket
14 | export DATASYNC_ROLE=dummyDatasyncRole
15 | export DATASYNC_REPORTS_ROLE=dummyDatasyncReportsRole
16 | export TABLE_NAME=dummyTable
17 | export IDENTITY_STORE_ID=dummyId
18 | export IDENTITY_STORE_REGION=us-east-1
19 | export IDENTITY_STORE_ACCOUNT="555555555555"
20 | export HAS_AWS_MANAGED_ACTIVE_DIRECTORY=false
21 | export AWS_USE_FIPS_ENDPOINT=false
22 | unset ADMIN_ROLE_ARN
23 |
--------------------------------------------------------------------------------
/source/dea-app/.npmignore:
--------------------------------------------------------------------------------
1 | # THIS IS A STANDARD TEMPLATE FOR .npmignore FILES IN THIS REPO.
2 |
3 | # Ignore all files by default, to avoid accidentally publishing unintended files.
4 | *
5 |
6 | # Use negative patterns to bring back the specific things we want to publish.
7 | !/bin/**
8 | !/lib/**
9 | !/lib-*/**
10 | !/dist/**
11 | !ThirdPartyNotice.txt
12 | !NOTICE
13 |
14 | # Ignore certain patterns that should not get published.
15 | /dist/*.stats.*
16 | /lib/**/test/
17 | /lib-*/**/test/
18 | /lib/**/__mocks__/
19 | *.test.js
20 | *.test.d.ts
21 | *.test.d.ts.map
22 | *.test.js.map
23 |
24 | # NOTE: These don't need to be specified, because NPM includes them automatically.
25 | #
26 | # package.json
27 | # README (and its variants)
28 | # CHANGELOG (and its variants)
29 | # LICENSE / LICENCE
30 |
31 | #--------------------------------------------
32 | # DO NOT MODIFY THE TEMPLATE ABOVE THIS LINE
33 | #--------------------------------------------
34 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/delete-cases.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getRequiredPathParam } from '../../lambda-http-helpers';
7 | import { joiUlid } from '../../models/validation/joi-common';
8 | import * as CaseService from '../services/case-service';
9 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
10 | import { responseNoContent } from './dea-lambda-utils';
11 |
12 | export const deleteCase: DEAGatewayProxyHandler = async (
13 | event,
14 | context,
15 | /* the default case is handled in e2e tests */
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const caseId = getRequiredPathParam(event, 'caseId', joiUlid);
20 |
21 | await CaseService.deleteCase(caseId, providers.repositoryProvider);
22 |
23 | return responseNoContent(event);
24 | };
25 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/components/create-case/CreateCaseBody.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { SpaceBetween, ContentLayout, Header } from '@cloudscape-design/components';
7 | import * as React from 'react';
8 | import { createCaseLabels } from '../../common/labels';
9 | import CreateCasesForm from './CreateCasesForm';
10 |
11 | function CreateCasePage() {
12 | return (
13 |
17 |
18 | {createCaseLabels.createNewCaseLabel}
19 |
20 |
21 | }
22 | >
23 |
24 |
25 | );
26 | }
27 |
28 | export default CreateCasePage;
29 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/revoke-token.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 | import { getOauthToken } from '../../lambda-http-helpers';
6 | import { revokeRefreshToken } from '../services/auth-service';
7 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
8 | import { responseOk } from './dea-lambda-utils';
9 |
10 | export const revokeToken: DEAGatewayProxyHandler = async (
11 | event,
12 | context,
13 | /* the default case is handled in e2e tests */
14 | /* istanbul ignore next */
15 | providers = defaultProviders
16 | ) => {
17 | const oauthToken = getOauthToken(event);
18 | const revokeTokenResult = await revokeRefreshToken(
19 | oauthToken.refresh_token,
20 | providers.cacheProvider,
21 | providers.parametersProvider
22 | );
23 |
24 | return responseOk(event, revokeTokenResult);
25 | };
26 |
--------------------------------------------------------------------------------
/source/dea-main/src/index.ts:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /*
4 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 | * SPDX-License-Identifier: Apache-2.0
6 | */
7 |
8 | /* eslint-disable no-new */
9 | import 'source-map-support/register';
10 | import { deaConfig } from '@aws/dea-backend/lib/config';
11 | import * as cdk from 'aws-cdk-lib';
12 | import { DefaultStackSynthesizer } from 'aws-cdk-lib';
13 | import { DeaMainStack } from './dea-main-stack';
14 |
15 | const app: cdk.App = new cdk.App();
16 | const stage = deaConfig.stage();
17 | const region = deaConfig.region();
18 |
19 | let props: cdk.StackProps = {
20 | synthesizer: new DefaultStackSynthesizer({
21 | generateBootstrapVersionRule: false,
22 | }),
23 | };
24 |
25 | if (!deaConfig.isOneClick()) {
26 | props = {
27 | env: {
28 | region,
29 | },
30 | crossRegionReferences: true,
31 | };
32 | }
33 |
34 | new DeaMainStack(app, `${stage}-DeaMainStack`, props);
35 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/models/CaseFiles.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface InitiateUploadForm {
7 | caseUlid: string;
8 | fileName: string;
9 | filePath: string;
10 | contentType: string;
11 | fileSizeBytes: number;
12 | details: string;
13 | reason: string;
14 | chunkSizeBytes: number;
15 | uploadId?: string;
16 | }
17 |
18 | export interface CompleteUploadForm {
19 | caseUlid: string;
20 | ulid?: string;
21 | sha256Hash?: string;
22 | uploadId?: string;
23 | }
24 |
25 | export interface DownloadFileForm {
26 | caseUlid: string;
27 | ulid?: string;
28 | downloadReason?: string;
29 | }
30 |
31 | export interface RestoreFileForm {
32 | caseUlid: string;
33 | ulid?: string;
34 | }
35 |
36 | export interface DownloadFileResult {
37 | downloadUrl?: string;
38 | isArchived?: boolean;
39 | isRestoring?: boolean;
40 | }
41 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/public/locales/es/common.json:
--------------------------------------------------------------------------------
1 | {
2 | "Header": {
3 | "CloseSearch": "Cerrar busqueda",
4 | "CustomerSupport": "Servicio al cliente",
5 | "Documentation": "Documentacion",
6 | "ExternalIconLabel": " (abrir en nueva ventana)",
7 | "Feedback": "Comentarios",
8 | "More": "Mas",
9 | "Preferences": "Preferencias",
10 | "Profile": "Perfil",
11 | "Search": "Buscar",
12 | "SearchInput": "Buscar",
13 | "Security": "Seguridad",
14 | "SignOut": "Cerrar sesion",
15 | "Support": "Soporte"
16 | },
17 | "Hero": {
18 | "DashboardImageAlt": "Imagen de informe"
19 | },
20 | "Navigation": {
21 | "Administration": "Administracion",
22 | "CreateDashboard": "Crear informe",
23 | "Dashboards": "Informes",
24 | "InviteUsers": "",
25 | "ManageDashboards": "Manage dashboards",
26 | "ManageUsers": "Manage users",
27 | "Users": "Users",
28 | "ViewPublishedDashboards": "View published dashboards"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/styles/FileUpload.module.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | @use '@cloudscape-design/design-tokens/index' as awsui;
7 |
8 | .upload-input {
9 | position: absolute;
10 | clip: rect(0, 0, 0, 0);
11 | display: none;
12 | }
13 |
14 | .dropzone {
15 | display: flex;
16 | flex-direction: column;
17 | align-items: center;
18 | justify-content: center;
19 | gap: awsui.$space-static-l;
20 | padding: awsui.$space-static-l;
21 | border-radius: awsui.$border-radius-container;
22 | color: awsui.$color-charts-threshold-neutral;
23 | background-color: awsui.$color-text-interactive-inverted-hover;
24 | border: 1px solid awsui.$color-border-button-normal-disabled;
25 | min-height: 200px;
26 |
27 | &-hovered {
28 | color: awsui.$color-background-button-primary-default;
29 | background-color: awsui.$color-background-dropdown-item-filter-match;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/components/common-components/action-container.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import { Button } from '@cloudscape-design/components';
3 | import ActionContainer from '../../../src/components/common-components/ActionContainer';
4 |
5 | describe('action container', () => {
6 | it('should render the inner component', async () => {
7 | render(
8 |
9 |
10 |
11 | );
12 | const createButton = await screen.getByRole('button');
13 | expect(createButton).toBeTruthy();
14 | });
15 |
16 | it('should not render the inner component', async () => {
17 | render(
18 |
19 |
20 |
21 | );
22 | const createButton = screen.queryByRole('button');
23 | expect(createButton).toBeFalsy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/api/models/case.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from '@aws/dea-app/lib/models/case-action';
7 | import { CaseFileStatus } from '@aws/dea-app/lib/models/case-file-status';
8 | import { CaseStatus } from '@aws/dea-app/lib/models/case-status';
9 |
10 | export interface DeaCaseDTO {
11 | readonly ulid: string;
12 | readonly name: string;
13 | readonly status: CaseStatus;
14 | readonly filesStatus: CaseFileStatus;
15 | readonly description?: string;
16 | readonly objectCount: number;
17 | readonly totalSizeBytes: number;
18 | readonly actions?: CaseAction[];
19 | readonly created: string;
20 | readonly updated: string;
21 | }
22 |
23 | export interface ScopedDeaCaseDTO {
24 | readonly ulid: string;
25 | readonly name: string;
26 | }
27 |
28 | export interface CaseOwnerDTO {
29 | readonly userUlid: string;
30 | readonly caseUlid: string;
31 | }
32 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/validation/case-user.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import Joi from 'joi';
7 | import { CaseAction } from '../case-action';
8 | import { joiUlid, safeName } from './joi-common';
9 |
10 | export const caseUserSchema = Joi.object({
11 | userUlid: joiUlid,
12 | caseUlid: joiUlid,
13 | actions: Joi.array()
14 | .items(Joi.string().valid(...Object.keys(CaseAction)))
15 | .required(),
16 | });
17 |
18 | export const caseUserResponseSchema = Joi.object({
19 | userFirstName: safeName,
20 | userLastName: safeName,
21 | caseName: safeName,
22 | userUlid: joiUlid,
23 | caseUlid: joiUlid,
24 | actions: Joi.array()
25 | .items(Joi.string().valid(...Object.keys(CaseAction)))
26 | .required(),
27 | created: Joi.date(),
28 | updated: Joi.date(),
29 | });
30 |
31 | export const caseOwnerSchema = Joi.object({
32 | userUlid: joiUlid,
33 | caseUlid: joiUlid,
34 | });
35 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/components/create-data-vault/CreateDataVaultBody.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { SpaceBetween, ContentLayout, Header } from '@cloudscape-design/components';
7 | import * as React from 'react';
8 | import { createDataVaultLabels } from '../../common/labels';
9 | import CreateDataVaultsForm from './CreateDataVaultsForm';
10 |
11 | function CreateDataVaultPage() {
12 | return (
13 |
17 |
18 | {createDataVaultLabels.createNewDataVaultLabel}
19 |
20 |
21 | }
22 | >
23 |
24 |
25 | );
26 | }
27 |
28 | export default CreateDataVaultPage;
29 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/components/upload-files/UploadFilesBody.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { SpaceBetween, ContentLayout, Header } from '@cloudscape-design/components';
7 | import * as React from 'react';
8 | import { fileOperationsLabels } from '../../common/labels';
9 | import UploadFilesForm from './UploadFilesForm';
10 |
11 | export interface UploadFilesProps {
12 | readonly caseId: string;
13 | readonly filePath: string;
14 | }
15 |
16 | function UploadFilePage(props: UploadFilesProps) {
17 | return (
18 |
22 | {fileOperationsLabels.uploadFileLabel}
23 |
24 | }
25 | >
26 |
27 |
28 | );
29 | }
30 |
31 | export default UploadFilePage;
32 |
--------------------------------------------------------------------------------
/deployment/run-unit-tests.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This assumes all of the OS-level configuration has been completed and git repo has already been cloned
4 | #
5 | # This script should be run from the repo's deployment directory
6 | # cd deployment
7 | # ./run-unit-tests.sh
8 | #
9 |
10 | # Get reference for all important folders
11 | template_dir="$PWD"
12 | source_dir="$template_dir/../source"
13 |
14 | echo "------------------------------------------------------------------------------"
15 | echo "Install packages"
16 | echo "------------------------------------------------------------------------------"
17 | npm install -g @microsoft/rush
18 | npm install -g pnpm@7.16.0
19 | npm install -g aws-cdk@2.76.0
20 | echo "------------------------------------------------------------------------------"
21 | echo "Install Run Unit Tests"
22 | echo "------------------------------------------------------------------------------"
23 | cd $source_dir
24 | rush purge
25 | rush update
26 | rush build
27 | rush test:sonar
28 | echo "Test Complete"
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/delete-case-membership.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getRequiredPathParam } from '../../lambda-http-helpers';
7 | import { joiUlid } from '../../models/validation/joi-common';
8 | import { deleteCaseUser } from '../services/case-user-service';
9 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
10 | import { responseNoContent } from './dea-lambda-utils';
11 |
12 | export const deleteCaseMembership: DEAGatewayProxyHandler = async (
13 | event,
14 | context,
15 | /* the default case is handled in e2e tests */
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const caseId = getRequiredPathParam(event, 'caseId', joiUlid);
20 | const userId = getRequiredPathParam(event, 'userId', joiUlid);
21 |
22 | await deleteCaseUser(userId, caseId, providers.repositoryProvider);
23 | return responseNoContent(event);
24 | };
25 |
--------------------------------------------------------------------------------
/source/dea-backend/src/test/infra/validate-app-registry-construct.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { Template } from 'aws-cdk-lib/assertions';
7 |
8 | export const validateAppRegistryConstruct = (template: Template, solutionVersion: string): void => {
9 | //the app registry construct
10 | template.hasResourceProperties('AWS::ServiceCatalogAppRegistry::Application', {
11 | Description: 'Service Catalog application to track and manage all your resources for the solution',
12 | });
13 |
14 | template.hasMapping('Solution', {
15 | Data: {
16 | ID: 'SO0224',
17 | SolutionVersion: solutionVersion,
18 | AppRegistryApplicationName: 'digital-evidence-archive',
19 | SolutionName: 'Digital Evidence Archive',
20 | ApplicationType: 'AWS-Solutions',
21 | },
22 | });
23 |
24 | template.hasOutput('AppRegistryArn', {
25 | Description: 'ARN of the application registry',
26 | });
27 | };
28 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/components/navigation.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import { SideNavigationProps } from '@cloudscape-design/components/side-navigation';
2 | import { render, screen } from '@testing-library/react';
3 | import Navigation from '../../src/components/Navigation';
4 |
5 | jest.mock('next/navigation', () => ({
6 | useRouter: () => ({
7 | push: jest.fn(),
8 | }),
9 | }));
10 |
11 | describe('Navigation', () => {
12 | it('should render navigation with a default header', async () => {
13 | render();
14 |
15 | const sideNavigation = await screen.findByTestId('sideNavigation');
16 | expect(sideNavigation).toBeTruthy();
17 | // https://github.com/testing-library/jest-dom#custom-matchers
18 | });
19 |
20 | it('should render a custom header', async () => {
21 | render();
22 |
23 | const sideNavigation = await screen.findByTestId('sideNavigation');
24 | expect(sideNavigation).toBeTruthy();
25 | expect(sideNavigation).toHaveTextContent('Documentation');
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/services/service-helpers.unit.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { retry } from '../../app/services/service-helpers';
7 |
8 | describe('service helpers', () => {
9 | it('retry will throw error if it runs out of retries', async () => {
10 | const failFunction = () => {
11 | throw new Error('should not succeed');
12 | };
13 | await expect(retry(failFunction, /*retries=*/ 3, /*interval=*/ 1)).rejects.toThrow('should not succeed');
14 | });
15 |
16 | it('retry will retry successfully', async () => {
17 | let attempt = 1;
18 | const failFirst2TimesThenSucceed = async () => {
19 | if (attempt < 3) {
20 | attempt = attempt + 1;
21 | throw new Error('Fail');
22 | } else {
23 | return 3;
24 | }
25 | };
26 |
27 | const result = await retry(failFirst2TimesThenSucceed, /*retries=*/ 3, /*interval=*/ 1);
28 | expect(result).toBe(3);
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-data-vault-details.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getRequiredPathParam } from '../../lambda-http-helpers';
7 | import { joiUlid } from '../../models/validation/joi-common';
8 | import * as DataVaultService from '../services/data-vault-service';
9 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
10 | import { responseOk } from './dea-lambda-utils';
11 |
12 | export const getDataVault: DEAGatewayProxyHandler = async (
13 | event,
14 | context,
15 | /* the default case is handled in e2e tests */
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const dataVaultId = getRequiredPathParam(event, 'dataVaultId', joiUlid);
20 |
21 | const retreivedDataVault = await DataVaultService.getRequiredDataVault(
22 | dataVaultId,
23 | providers.repositoryProvider
24 | );
25 |
26 | return responseOk(event, retreivedDataVault);
27 | };
28 |
--------------------------------------------------------------------------------
/source/dea-app/src/persistence/schema/dea-table.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
7 | import { Table } from 'dynamodb-onetable';
8 | import { Dynamo } from 'dynamodb-onetable/Dynamo';
9 | import { getCustomUserAgent, getRequiredEnv } from '../../lambda-http-helpers';
10 | import { DeaSchema } from './dea-schema';
11 |
12 | const region = getRequiredEnv('AWS_REGION', 'us-east-1');
13 | const fipsSupported = getRequiredEnv('AWS_USE_FIPS_ENDPOINT', 'false') === 'true';
14 | const client = new Dynamo({
15 | client: new DynamoDBClient({
16 | region,
17 | customUserAgent: getCustomUserAgent(),
18 | useFipsEndpoint: fipsSupported,
19 | }),
20 | });
21 | const deaTableName = getRequiredEnv('TABLE_NAME', 'TABLE_NAME is not set in your lambda!');
22 |
23 | export const deaTable = new Table({
24 | client: client,
25 | name: deaTableName,
26 | schema: DeaSchema,
27 | partial: false,
28 | });
29 |
--------------------------------------------------------------------------------
/deployment/cdk-solution-helper/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cdk-solution-helper",
3 | "version": "0.1.0",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "cdk-solution-helper",
9 | "version": "0.1.0",
10 | "dependencies": {
11 | "fs": "0.0.1-security"
12 | },
13 | "devDependencies": {
14 | "fs": "0.0.1-security"
15 | }
16 | },
17 | "node_modules/fs": {
18 | "version": "0.0.1-security",
19 | "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
20 | "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==",
21 | "dev": true
22 | }
23 | },
24 | "dependencies": {
25 | "fs": {
26 | "version": "0.0.1-security",
27 | "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
28 | "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==",
29 | "dev": true
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/app/resources/data-sync-tasks-integration-test-helper.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getDataSyncTasks } from '../../../app/resources/get-data-sync-tasks';
7 | import { retry } from '../../../app/services/service-helpers';
8 | import { ModelRepositoryProvider } from '../../../persistence/schema/entities';
9 | import { createTestProvidersObject, dummyContext, getDummyEvent } from '../../integration-objects';
10 |
11 | export const callGetDataSyncTasks = async (
12 | repositoryProvider: ModelRepositoryProvider,
13 | limit = 100,
14 | next: string | undefined
15 | ) => {
16 | return await retry(async () => {
17 | const response = await getDataSyncTasks(
18 | getDummyEvent({
19 | queryStringParameters: {
20 | limit,
21 | next,
22 | },
23 | }),
24 | dummyContext,
25 | createTestProvidersObject({ repositoryProvider })
26 | );
27 | return response;
28 | });
29 | };
30 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/components/common-components/table-header.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import { TableHeader } from '../../../src/components/common-components/TableHeader';
3 |
4 | describe('table header', () => {
5 | it('should render with a counter', async () => {
6 | render();
7 | const counter = await screen.findAllByText('counter text');
8 | expect(counter).toBeTruthy();
9 | });
10 |
11 | it('should render with no counter', () => {
12 | render();
13 | });
14 |
15 | it('should render with items length', async () => {
16 | render();
17 | const counter = await screen.findAllByText('(3)');
18 | expect(counter).toBeTruthy();
19 | });
20 |
21 | it('should render with selected count', async () => {
22 | render();
23 | const counter = await screen.findAllByText('(2/3)');
24 | expect(counter).toBeTruthy();
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/app/audit-test-support.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { QueryExecutionState } from '@aws-sdk/client-athena';
7 | import { ulid } from 'ulid';
8 | import { createAuditJob } from '../../persistence/audit-job';
9 | import { AuditType } from '../../persistence/schema/dea-schema';
10 | import { ModelRepositoryProvider } from '../../persistence/schema/entities';
11 |
12 | export const startAudit = async (
13 | auditType: AuditType,
14 | resourceId: string,
15 | modelProvider: ModelRepositoryProvider
16 | ) => {
17 | return await createAuditJob(ulid(), auditType, resourceId, modelProvider);
18 | };
19 |
20 | export function getQueryResponseWithState(state: QueryExecutionState) {
21 | return {
22 | $metadata: {},
23 | QueryExecution: {
24 | Status: {
25 | State: state,
26 | },
27 | ResultConfiguration: {
28 | OutputLocation: 's3://test-bucket/test-folder/',
29 | },
30 | },
31 | };
32 | }
33 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/public/locales/en/common.json:
--------------------------------------------------------------------------------
1 | {
2 | "Header": {
3 | "All": "All",
4 | "Back": "Back",
5 | "CloseMenu": "Close menu",
6 | "CloseSearch": "Close search",
7 | "CustomerSupport": "Customer support",
8 | "Documentation": "Documentation",
9 | "ExternalIconLabel": " (opens in new tab)",
10 | "Feedback": "Feedback",
11 | "More": "More",
12 | "Preferences": "Preferences",
13 | "Profile": "Profile",
14 | "Search": "Search",
15 | "SearchInput": "Search input",
16 | "Security": "Security",
17 | "SignOut": "Sign out",
18 | "Support": "Support"
19 | },
20 | "CaseListBody": {
21 | "DashboardImageAlt": "Dashboard image"
22 | },
23 | "Navigation": {
24 | "Administration": "Administration",
25 | "CreateDashboard": "Create new dashboard",
26 | "Dashboards": "Dashboards",
27 | "InviteUsers": "Invite users",
28 | "ManageDashboards": "Manage dashboards",
29 | "ManageUsers": "Manage users",
30 | "Users": "Users",
31 | "ViewPublishedDashboards": "View published dashboards"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/components/common-components/formfield.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import '@testing-library/jest-dom';
2 | import { render, screen } from '@testing-library/react';
3 | import { FormFieldModal } from '../../../src/components/common-components/FormFieldModal';
4 | import { commonLabels } from '../../../src/common/labels';
5 |
6 | const validProps = {
7 | modalTestId: '',
8 | inputTestId: '',
9 | cancelButtonTestId: 'cancelbutton',
10 | primaryButtonTestId: '',
11 | isOpen: true,
12 | title: '',
13 | inputHeader: '',
14 | inputDetails: '',
15 | inputField: '',
16 | setInputField: jest.fn(),
17 | confirmAction: jest.fn(),
18 | confirmButtonText: '',
19 | cancelAction: jest.fn(),
20 | cancelButtonText: commonLabels.cancelButton,
21 | };
22 |
23 | describe('formfield modal', () => {
24 | it('shows cancel button prop text', async () => {
25 | const page = render();
26 | const button = page.getByTestId(validProps.cancelButtonTestId);
27 | expect(button).toHaveTextContent(validProps.cancelButtonText);
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/local-dev-support/get-user-creds.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import minimist from 'minimist';
7 | import CognitoHelper from '../../test-e2e/helpers/cognito-helper';
8 |
9 | const args = minimist(process.argv.slice(2));
10 |
11 | const outputCreds = async (userName: string) => {
12 | const [creds, idToken] = await cognitoHelper.getCredentialsForUser(userName);
13 | console.log(`----------- IAM Credentials for ${userName} -----------`);
14 | console.log({
15 | ...creds,
16 | idToken,
17 | });
18 | console.log(`----------- IAM Credentials end -----------`);
19 | };
20 |
21 | const verifyRequiredParam = (name: string) => {
22 | if (!args[name]) {
23 | console.error(`required parameter '--${name}' is unspecified`);
24 | process.exit(1);
25 | }
26 | };
27 |
28 | verifyRequiredParam('username');
29 | verifyRequiredParam('password');
30 |
31 | const cognitoHelper = new CognitoHelper(args.password);
32 |
33 | void outputCreds(args.username);
34 |
--------------------------------------------------------------------------------
/source/dea-backend/src/deployment-helpers/generate-config-command.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import minimist from 'minimist';
7 | import { configFileExists, generateConfig } from './manage-config';
8 |
9 | const args = minimist(process.argv.slice(2));
10 |
11 | const verifyRequiredParam = (name: string) => {
12 | if (args[name] === undefined) {
13 | console.error(`required parameter '--${name}' is unspecified`);
14 | process.exit(1);
15 | }
16 | };
17 |
18 | verifyRequiredParam('configname');
19 |
20 | if (args.configname.length == 0 || typeof args.configname !== 'string') {
21 | console.error(`must specify a config file name`);
22 | process.exit(1);
23 | }
24 |
25 | // Assert that the config file does not already exist
26 | if (configFileExists(args.configname)) {
27 | console.error(
28 | `config with name '${args.configname}' already exists, use update-config-command to update it.`
29 | );
30 | process.exit(1);
31 | }
32 |
33 | void generateConfig(args.configname);
34 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/components/case-list-table/caseListDefinitions.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { PropertyFilterProperty } from '@cloudscape-design/collection-hooks';
7 | import { PropertyFilterProps } from '@cloudscape-design/components';
8 |
9 | export const filteringProperties: readonly PropertyFilterProperty[] = [
10 | {
11 | key: 'name',
12 | operators: ['=', '!=', ':', '!:'],
13 | propertyLabel: 'Case Name',
14 | groupValuesLabel: 'Case Name Values',
15 | },
16 | {
17 | key: 'created',
18 | operators: ['<', '<=', '>', '>=', ':'],
19 | propertyLabel: 'Creation Date',
20 | groupValuesLabel: 'Creation Date Values',
21 | },
22 | ];
23 |
24 | export const searchableColumns: string[] = ['name', 'caseLead', 'creationDate'];
25 |
26 | export const filteringOptions: readonly PropertyFilterProps.FilteringOption[] = [
27 | { propertyKey: 'caseLead', value: '' },
28 | { propertyKey: 'name', value: '' },
29 | { propertyKey: 'creationDate', value: '' },
30 | ];
31 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/create-data-vault.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getRequiredPayload } from '../../lambda-http-helpers';
7 | import { DeaDataVaultInput } from '../../models/data-vault';
8 | import { createDataVaultSchema } from '../../models/validation/data-vault';
9 | import * as DataVaultService from '../services/data-vault-service';
10 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
11 | import { responseOk } from './dea-lambda-utils';
12 |
13 | export const createDataVault: DEAGatewayProxyHandler = async (
14 | event,
15 | context,
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const deaDataVault: DeaDataVaultInput = getRequiredPayload(
20 | event,
21 | 'Create Data Vaults',
22 | createDataVaultSchema
23 | );
24 |
25 | const responseBody = await DataVaultService.createDataVault(deaDataVault, providers.repositoryProvider);
26 |
27 | return responseOk(event, responseBody);
28 | };
29 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-login-url.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 | import Joi from 'joi';
6 | import { getQueryParam } from '../../lambda-http-helpers';
7 | import { loginUrlRegex } from '../../models/validation/joi-common';
8 | import { getLoginHostedUiUrl } from '../services/auth-service';
9 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
10 | import { responseOk } from './dea-lambda-utils';
11 |
12 | export const getLoginUrl: DEAGatewayProxyHandler = async (
13 | event,
14 | context,
15 | /* the default case is handled in e2e tests */
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const callbackUrl = getQueryParam(event, 'callbackUrl', '', Joi.string().uri());
20 |
21 | const loginUrl = await getLoginHostedUiUrl(
22 | callbackUrl,
23 | providers.cacheProvider,
24 | providers.parametersProvider
25 | );
26 |
27 | Joi.assert(loginUrl, loginUrlRegex);
28 | return responseOk(event, loginUrl);
29 | };
30 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-logout-url.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 | import Joi from 'joi';
6 | import { getQueryParam } from '../../lambda-http-helpers';
7 | import { loginUrlRegex } from '../../models/validation/joi-common';
8 | import { getCognitoLogoutUrl } from '../services/auth-service';
9 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
10 | import { responseOk } from './dea-lambda-utils';
11 |
12 | export const getLogoutUrl: DEAGatewayProxyHandler = async (
13 | event,
14 | context,
15 | /* the default case is handled in e2e tests */
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const callbackUrl = getQueryParam(event, 'callbackUrl', '', Joi.string().uri());
20 |
21 | const logoutUrl = await getCognitoLogoutUrl(
22 | callbackUrl,
23 | providers.cacheProvider,
24 | providers.parametersProvider
25 | );
26 |
27 | Joi.assert(logoutUrl, loginUrlRegex);
28 | return responseOk(event, logoutUrl);
29 | };
30 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-all-cases.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getPaginationParameters } from '../../lambda-http-helpers';
7 | import { listAllCases } from '../services/case-service';
8 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
9 | import { responseOk } from './dea-lambda-utils';
10 | import { getNextToken } from './get-next-token';
11 |
12 | export const getAllCases: DEAGatewayProxyHandler = async (
13 | event,
14 | context,
15 | /* the default case is handled in e2e tests */
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const paginationParams = getPaginationParameters(event);
20 |
21 | const pageOfCases = await listAllCases(
22 | providers.repositoryProvider,
23 | paginationParams.nextToken,
24 | paginationParams.limit
25 | );
26 |
27 | return responseOk(event, {
28 | cases: pageOfCases,
29 | total: pageOfCases.count,
30 | next: getNextToken(pageOfCases.next),
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/source/common/git-hooks/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Called by "git commit" with no arguments. The hook should
3 | # exit with non-zero status after issuing an appropriate message if
4 | # it wants to stop the commit.
5 |
6 | # Invoke the "rush prettier" custom command to reformat files whenever they
7 | # are committed. The command is defined in common/config/rush/command-line.json
8 | # and uses the "rush-prettier" autoinstaller.
9 |
10 | cd source
11 | node common/scripts/install-run-rush.js add-license-header|| exit $?
12 | node common/scripts/install-run-rush.js prettier || exit $?
13 | if [ "$RUN_HOOKS" == true ]; then
14 | node common/scripts/install-run-rush.js lint:fix || exit $?
15 | node common/scripts/install-run-rush.js sort-package-json && git add **/package.json || exit $?
16 | if ! node common/scripts/install-run-rush.js build:test; then
17 | echo "\033[0;31mA Failure was encountered, please check the output above\033[0m"
18 | exit 1
19 | fi
20 | node common/scripts/install-run-rush.js common-coverage-make-badge
21 | node common/scripts/install-run-rush.js common-cov-info
22 | fi
23 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-case-details.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getRequiredPathParam } from '../../lambda-http-helpers';
7 | import { joiUlid } from '../../models/validation/joi-common';
8 | import { NotFoundError } from '../exceptions/not-found-exception';
9 | import * as CaseService from '../services/case-service';
10 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
11 | import { responseOk } from './dea-lambda-utils';
12 |
13 | export const getCase: DEAGatewayProxyHandler = async (
14 | event,
15 | context,
16 | /* the default case is handled in e2e tests */
17 | /* istanbul ignore next */
18 | providers = defaultProviders
19 | ) => {
20 | const caseId = getRequiredPathParam(event, 'caseId', joiUlid);
21 |
22 | const retreivedCase = await CaseService.getCase(caseId, providers.repositoryProvider);
23 | if (!retreivedCase) {
24 | throw new NotFoundError(`Case with ulid ${caseId} not found.`);
25 | }
26 |
27 | return responseOk(event, retreivedCase);
28 | };
29 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/data-vault-task.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export interface DeaDataVaultTask {
7 | readonly taskId: string;
8 | readonly dataVaultUlid: string;
9 | readonly name: string;
10 | readonly description?: string;
11 | readonly sourceLocationArn: string;
12 | readonly destinationLocationArn: string;
13 | readonly taskArn: string;
14 | readonly created?: Date;
15 | readonly updated?: Date;
16 | readonly deleted: boolean;
17 | }
18 |
19 | export interface DataVaultTaskDTO {
20 | readonly name: string;
21 | readonly sourceLocationArn: string;
22 | readonly description?: string;
23 | readonly destinationFolder?: string;
24 | }
25 |
26 | export interface DeaDataVaultTaskInput {
27 | readonly taskId: string;
28 | readonly dataVaultUlid: string;
29 | readonly name: string;
30 | readonly description?: string;
31 | readonly sourceLocationArn: string;
32 | readonly destinationLocationArn: string;
33 | readonly taskArn: string;
34 | readonly destinationFolder: string;
35 | readonly deleted: boolean;
36 | }
37 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-data-vaults.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getPaginationParameters } from '../../lambda-http-helpers';
7 | import { listDataVaults } from '../../persistence/data-vault';
8 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
9 | import { responseOk } from './dea-lambda-utils';
10 | import { getNextToken } from './get-next-token';
11 |
12 | export const getDataVaults: DEAGatewayProxyHandler = async (
13 | event,
14 | context,
15 | /* the default case is handled in e2e tests */
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const paginationParams = getPaginationParameters(event);
20 |
21 | const pageOfDataVaults = await listDataVaults(
22 | providers.repositoryProvider,
23 | paginationParams.nextToken,
24 | paginationParams.limit
25 | );
26 |
27 | return responseOk(event, {
28 | dataVaults: pageOfDataVaults,
29 | total: pageOfDataVaults.count,
30 | next: getNextToken(pageOfDataVaults.next),
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/source/dea-backend/src/test/deployment-config-helpers.unit.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { configFileExists, generateQuestions } from '../deployment-helpers/manage-config';
7 |
8 | describe('deployment helpers for config', () => {
9 | describe('configFileExists', () => {
10 | it('returns false when file does NOT exist', () => {
11 | expect(configFileExists('doesnotexistfile')).toBeFalsy();
12 | });
13 |
14 | it('returns true when file does exist', () => {
15 | expect(configFileExists('devsample')).toBeTruthy();
16 | });
17 | });
18 |
19 | describe('generateQuestions', () => {
20 | // This test will fail when there is a schema field it does not recognize
21 | // which ensure we are handling every new schema field for generate/update config
22 | // If this unit test fails, add your new schema field
23 | // to the generateQuestions switch statement in manage-config.ts
24 | it('has a question for each schema field', async () => {
25 | generateQuestions('fakeconfig');
26 | });
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/__tests__/components/common-components/notifications.unit.test.tsx:
--------------------------------------------------------------------------------
1 | import { render } from '@testing-library/react';
2 | import { Notifications } from '../../../src/components/common-components/Notifications';
3 | import { IAppNotification } from '../../../src/models/AppNotification';
4 | import { useNotifications } from '../../../src/context/NotificationsContext';
5 |
6 | const error: IAppNotification = {
7 | type: 'error',
8 | id: '1',
9 | content: 'This is an error',
10 | };
11 |
12 | const success: IAppNotification = {
13 | type: 'success',
14 | id: '2',
15 | content: 'This is a success',
16 | };
17 |
18 | jest.mock('../../../src/context/NotificationsContext');
19 |
20 | const mockUseNotifications = jest.mocked(useNotifications);
21 |
22 | describe('notifications', () => {
23 | it('should render', async () => {
24 | mockUseNotifications.mockImplementation(() => {
25 | return {
26 | notifications: [error, success],
27 | pushNotification() {},
28 | dismissNotification: () => {},
29 | };
30 | });
31 | const noti = render();
32 | expect(noti).toBeTruthy();
33 | });
34 | });
35 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/audit/dea-audit-plugin.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import BaseAuditPlugin from '@aws/workbench-core-audit/lib/plugins/baseAuditPlugin';
7 | import { AthenaClient } from '@aws-sdk/client-athena';
8 | import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
9 | import { getCustomUserAgent, getRequiredEnv } from '../../lambda-http-helpers';
10 | import DeaAuditWriter from './dea-audit-writer';
11 |
12 | const region = getRequiredEnv('AWS_REGION', 'us-east-1');
13 | const fipsSupported = getRequiredEnv('AWS_USE_FIPS_ENDPOINT', 'false') === 'true';
14 |
15 | export const defaultCloudwatchClient = new CloudWatchLogsClient({
16 | region,
17 | useFipsEndpoint: fipsSupported,
18 | customUserAgent: getCustomUserAgent(),
19 | });
20 |
21 | export const defaultAthenaClient = new AthenaClient({
22 | region,
23 | useFipsEndpoint: fipsSupported,
24 | customUserAgent: getCustomUserAgent(),
25 | });
26 |
27 | const theWriter = new DeaAuditWriter(defaultCloudwatchClient);
28 | export const deaAuditPlugin = new BaseAuditPlugin(theWriter);
29 |
--------------------------------------------------------------------------------
/source/dea-app/src/logger.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export declare type LogLevel = 'silly' | 'debug' | 'verbose' | 'http' | 'info' | 'warn' | 'error';
7 |
8 | export const logLevel = (): LogLevel => {
9 | const level = process.env.LOG_LEVEL;
10 | switch (level) {
11 | case 'silly':
12 | case 'debug':
13 | case 'verbose':
14 | case 'http':
15 | case 'info':
16 | case 'warn':
17 | case 'error':
18 | return level;
19 | default:
20 | return 'debug';
21 | }
22 | };
23 |
24 | export const logger = {
25 | debug: (msg: string, obj?: object) => {
26 | console.debug(`${msg}`, obj);
27 | },
28 | error: (msg: string, obj?: object) => {
29 | console.error(`${msg}`, obj);
30 | },
31 | info: (msg: string, obj?: object) => {
32 | console.info(`${msg}`, obj);
33 | },
34 | warn: (msg: string, obj?: object) => {
35 | console.warn(`${msg}`, obj);
36 | },
37 | };
38 | // Removing the logger until we figure out performance
39 | // export const logger = new LoggingService({
40 | // maxLogLevel: logLevel(),
41 | // });
42 |
--------------------------------------------------------------------------------
/source/dea-backend/src/logger.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | export declare type LogLevel = 'silly' | 'debug' | 'verbose' | 'http' | 'info' | 'warn' | 'error';
7 |
8 | export const logLevel = (): LogLevel => {
9 | const level = process.env.LOG_LEVEL;
10 | switch (level) {
11 | case 'silly':
12 | case 'debug':
13 | case 'verbose':
14 | case 'http':
15 | case 'info':
16 | case 'warn':
17 | case 'error':
18 | return level;
19 | default:
20 | return 'debug';
21 | }
22 | };
23 |
24 | export const logger = {
25 | debug: (msg: string, obj: object) => {
26 | console.debug(`${msg}`, obj);
27 | },
28 | error: (msg: string, obj: object) => {
29 | console.error(`${msg}`, obj);
30 | },
31 | info: (msg: string, obj: object) => {
32 | console.info(`${msg}`, obj);
33 | },
34 | warn: (msg: string, obj: object) => {
35 | console.warn(`${msg}`, obj);
36 | },
37 | };
38 | // Removing the logger until we figure out performance
39 | // export const logger = new LoggingService({
40 | // maxLogLevel: logLevel(),
41 | // });
42 |
--------------------------------------------------------------------------------
/source/dea-backend/src/resources/api-gateway-route-config.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { AuditEventType } from '@aws/dea-app/lib/app/services/audit-service';
7 | import { AuthorizationType } from 'aws-cdk-lib/aws-apigateway';
8 | import { DeaApiRoleName } from './dea-route-config';
9 |
10 | export interface ApiGatewayRouteConfig {
11 | readonly routes: ApiGatewayRoute[];
12 | }
13 |
14 | export interface ApiGatewayRoute {
15 | readonly eventName: AuditEventType;
16 | readonly path: string;
17 | readonly pathToSource: string;
18 | readonly httpMethod: ApiGatewayMethod;
19 | readonly pagination?: boolean;
20 | readonly queryParams?: string[];
21 | readonly authMethod?: AuthorizationType; //Override authorization type if auth type should be custom or none
22 | readonly latencyAlarmThreshold?: number; //Threshold in ms for latency alarm
23 | readonly roleName?: DeaApiRoleName;
24 | readonly isPrivileged: boolean;
25 | }
26 |
27 | export enum ApiGatewayMethod {
28 | POST = 'POST',
29 | PUT = 'PUT',
30 | DELETE = 'DELETE',
31 | GET = 'GET',
32 | }
33 |
--------------------------------------------------------------------------------
/source/dea-app/src/models/case.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { CaseAction } from './case-action';
7 | import { CaseFileStatus } from './case-file-status';
8 | import { CaseStatus } from './case-status';
9 |
10 | export interface DeaCase {
11 | readonly ulid: string;
12 | readonly name: string;
13 | readonly status: CaseStatus;
14 | readonly description?: string;
15 | readonly objectCount: number;
16 | readonly totalSizeBytes: number;
17 | readonly filesStatus: CaseFileStatus;
18 | readonly s3BatchJobId?: string;
19 | readonly created?: Date;
20 | readonly updated?: Date;
21 | }
22 |
23 | export interface MyCase extends DeaCase {
24 | readonly actions: CaseAction[];
25 | }
26 |
27 | export interface ScopedDeaCase {
28 | readonly ulid: string;
29 | readonly name: string;
30 | }
31 |
32 | export interface DeaCaseInput {
33 | readonly name: string;
34 | readonly description?: string;
35 | }
36 |
37 | export interface UpdateCaseStatusInput {
38 | readonly name: string;
39 | readonly status: CaseStatus;
40 | readonly deleteFiles: boolean;
41 | }
42 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/context/SettingsContext.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { Context, createContext, useContext, useMemo, useState } from 'react';
7 | import { IAppSettings, defaultAppSettings } from '../models/AppSettings';
8 |
9 | export interface ISettingsProps {
10 | settings: IAppSettings;
11 | reload: () => void;
12 | }
13 |
14 | const SettingsContext: Context = createContext({
15 | settings: defaultAppSettings,
16 | reload: () => {
17 | /*do nothing*/
18 | },
19 | });
20 |
21 | export function SettingsProvider({ children }: { children: React.ReactNode }): JSX.Element {
22 | const [settings] = useState(defaultAppSettings);
23 |
24 | const props = useMemo(
25 | () => ({
26 | settings,
27 | reload: () => {
28 | /*do nothing*/
29 | },
30 | }),
31 | [settings]
32 | );
33 | return {children};
34 | }
35 |
36 | export function useSettings(): ISettingsProps {
37 | return useContext(SettingsContext);
38 | }
39 |
--------------------------------------------------------------------------------
/source/dea-ui/infrastructure/cdk.json:
--------------------------------------------------------------------------------
1 | {
2 | "app": "lib/index.js",
3 | "watch": {
4 | "include": ["**"],
5 | "exclude": [
6 | "README.md",
7 | "cdk*.json",
8 | "**/*.d.ts",
9 | "**/*.js",
10 | "tsconfig.json",
11 | "package*.json",
12 | "yarn.lock",
13 | "node_modules",
14 | "test"
15 | ]
16 | },
17 | "context": {
18 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
19 | "@aws-cdk/core:stackRelativeExports": true,
20 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
21 | "@aws-cdk/aws-lambda:recognizeVersionProps": true,
22 | "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
23 | "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
24 | "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
25 | "@aws-cdk/core:checkSecretUsage": true,
26 | "@aws-cdk/aws-iam:minimizePolicies": true,
27 | "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
28 | "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
29 | "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
30 | "@aws-cdk/core:target-partitions": ["aws", "aws-cn"]
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/source/dea-ui/ui/src/components/common-components/Notifications.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { Flashbar } from '@cloudscape-design/components';
7 | import { commonLabels } from '../../common/labels';
8 | import { useNotifications } from '../../context/NotificationsContext';
9 | import { i18nStringsForFlashbar } from './commonDefinitions';
10 |
11 | export function Notifications() {
12 | const { notifications, dismissNotification } = useNotifications();
13 | return (
14 | ({
17 | type: notification.type,
18 | dismissible: true,
19 | dismissLabel: commonLabels.dismissMessageLabel,
20 | content: notification.content,
21 | id: notification.id,
22 | ariaRole: notification.type === 'error' ? 'alert' : 'status',
23 | onDismiss: () => dismissNotification(notification.id),
24 | statusIconAriaLabel: notification.type === 'error' ? 'Error' : 'Success',
25 | }))}
26 | stackItems
27 | />
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/source/dea-app/README.md:
--------------------------------------------------------------------------------
1 | # Code Coverage
2 |
3 | | Statements | Branches | Functions | Lines |
4 | | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
5 | |  |  |  |  |
6 |
7 | This project is the routing package for `dea-backend`. It is used by `dea-backend` to generate routes for DEA API. Please refer [here](../dea-backend/README.md) for more information on how to use this project.
8 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-my-cases.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getPaginationParameters, getUserUlid } from '../../lambda-http-helpers';
7 | import { listCasesForUser } from '../services/case-service';
8 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
9 | import { responseOk } from './dea-lambda-utils';
10 | import { getNextToken } from './get-next-token';
11 |
12 | export const getMyCases: DEAGatewayProxyHandler = async (
13 | event,
14 | context,
15 | /* the default case is handled in e2e tests */
16 | /* istanbul ignore next */
17 | providers = defaultProviders
18 | ) => {
19 | const paginationParams = getPaginationParameters(event);
20 | const userUlid = getUserUlid(event);
21 |
22 | const pageOfCases = await listCasesForUser(
23 | userUlid,
24 | providers.repositoryProvider,
25 | paginationParams.nextToken,
26 | paginationParams.limit
27 | );
28 |
29 | return responseOk(event, {
30 | cases: pageOfCases,
31 | total: pageOfCases.count,
32 | next: getNextToken(pageOfCases.next),
33 | });
34 | };
35 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-case-actions.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getRequiredPathParam, getUserUlid } from '../../lambda-http-helpers';
7 | import { joiUlid } from '../../models/validation/joi-common';
8 | import { NotFoundError } from '../exceptions/not-found-exception';
9 | import { getCaseUser } from '../services/case-user-service';
10 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
11 | import { responseOk } from './dea-lambda-utils';
12 |
13 | export const getCaseActions: DEAGatewayProxyHandler = async (
14 | event,
15 | context,
16 | /* the default case is handled in e2e tests */
17 | /* istanbul ignore next */
18 | providers = defaultProviders
19 | ) => {
20 | const caseUlid = getRequiredPathParam(event, 'caseId', joiUlid);
21 | const userUlid = getUserUlid(event);
22 |
23 | const caseUser = await getCaseUser({ caseUlid, userUlid }, providers.repositoryProvider);
24 | if (!caseUser) {
25 | throw new NotFoundError(`Could not find case: ${caseUlid} in the DB`);
26 | }
27 |
28 | return responseOk(event, caseUser);
29 | };
30 |
--------------------------------------------------------------------------------
/source/dea-app/src/app/resources/get-scoped-case-information.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import { getRequiredPathParam } from '../../lambda-http-helpers';
7 | import { joiUlid } from '../../models/validation/joi-common';
8 | import { NotFoundError } from '../exceptions/not-found-exception';
9 | import * as CaseService from '../services/case-service';
10 | import { DEAGatewayProxyHandler, defaultProviders } from './dea-gateway-proxy-handler';
11 | import { responseOk } from './dea-lambda-utils';
12 |
13 | export const getScopedCaseInformation: DEAGatewayProxyHandler = async (
14 | event,
15 | context,
16 | /* the default case is handled in e2e tests */
17 | /* istanbul ignore next */
18 | providers = defaultProviders
19 | ) => {
20 | const caseId = getRequiredPathParam(event, 'caseId', joiUlid);
21 |
22 | const retreivedCase = await CaseService.getCase(caseId, providers.repositoryProvider);
23 | if (!retreivedCase) {
24 | throw new NotFoundError(`Case with ulid ${caseId} not found.`);
25 | }
26 |
27 | return responseOk(event, { name: retreivedCase.name, ulid: retreivedCase.ulid });
28 | };
29 |
--------------------------------------------------------------------------------
/.github/workflows/main-merge-workflow.yml:
--------------------------------------------------------------------------------
1 | name: Merge to Main Workflow
2 |
3 | env:
4 | STAGE: prodexample
5 | DOMAIN_PREFIX: deaplayground
6 |
7 | on:
8 | push:
9 | branches: [main]
10 |
11 | permissions:
12 | id-token: write # This is required for requesting the JWT
13 | contents: read # This is required for actions/checkout
14 | jobs:
15 | verify:
16 | environment: dea-test
17 | defaults:
18 | run:
19 | shell: bash
20 | working-directory: ./source
21 | name: Deploy Playground
22 | runs-on: ubuntu-latest
23 | steps:
24 | - name: Checkout
25 | uses: actions/checkout@v3
26 | - name: Install
27 | uses: ./.github/actions/baseAction
28 | - name: Rush Build
29 | run: |
30 | node common/scripts/install-run-rush.js build
31 | - name: configure aws credentials
32 | uses: aws-actions/configure-aws-credentials@v1
33 | with:
34 | role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
35 | role-session-name: GITHUBACTIONSESSION
36 | aws-region: ${{ secrets.AWS_REGION }}
37 | - name: cdk deploy
38 | run: |
39 | cd dea-main
40 | npm run cdk deploy
41 |
--------------------------------------------------------------------------------
/source/dea-app/src/test/app/exceptions/dea-exceptions.unit.test.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 | import { ForbiddenError, FORBIDDEN_ERROR_NAME } from '../../../app/exceptions/forbidden-exception';
6 | import { NotFoundError, NOT_FOUND_ERROR_NAME } from '../../../app/exceptions/not-found-exception';
7 | import {
8 | ReauthenticationError,
9 | REAUTHENTICATION_ERROR_NAME,
10 | } from '../../../app/exceptions/reauthentication-exception';
11 | import { ValidationError, VALIDATION_ERROR_NAME } from '../../../app/exceptions/validation-exception';
12 |
13 | describe('dea exceptions', () => {
14 | it('should have defined names', () => {
15 | const notFound = new NotFoundError('');
16 | const forbidden = new ForbiddenError('');
17 | const validation = new ValidationError('');
18 | const reauthentication = new ReauthenticationError('');
19 |
20 | expect(notFound.name).toEqual(NOT_FOUND_ERROR_NAME);
21 | expect(forbidden.name).toEqual(FORBIDDEN_ERROR_NAME);
22 | expect(validation.name).toEqual(VALIDATION_ERROR_NAME);
23 | expect(reauthentication.name).toEqual(REAUTHENTICATION_ERROR_NAME);
24 | });
25 | });
26 |
--------------------------------------------------------------------------------