Skip to content

Commit

Permalink
Merge branch '10007-DOD' of https://github.com/flexion/ef-cms into 10…
Browse files Browse the repository at this point in the history
…007-DOD-move-to-user-gateway
  • Loading branch information
rachelschneiderman committed Mar 13, 2024
2 parents 210eb7c + 62392e0 commit 8704afd
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cypress/helpers/dynamo/getDynamoCypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getCypressEnv } from '../env/cypressEnvironment';
import type {
DeleteRequest,
PutRequest,
} from '../../../web-api/src/persistence/dynamo/dynamoTypes';
} from '@web-api/persistence/dynamo/dynamoTypes';

let dynamoCache: DynamoDBClient;
let documentCache: DynamoDBDocument;
Expand Down
7 changes: 6 additions & 1 deletion cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"noEmit": true,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
"types": ["cypress", "node"],
"paths": {
"@web-api/*": [
"../web-api/src/*"
],
}
},
"include": ["**/*.ts"]
}
12 changes: 6 additions & 6 deletions scripts/dynamo/set-maintenance-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { InvokeCommand, LambdaClient } from '@aws-sdk/client-lambda';

// # Arguments
// # - $1 - true to engage maintenance mode, false to disengage maintenance mode
// # - $2 - the environment to set the flag

const args = process.argv.slice(2);
const enableMaintenanceMode: boolean = args[0] === 'true';
const env: string = args[1];

const { ENV } = process.env;

if (typeof enableMaintenanceMode !== 'boolean') {
throw new Error('A value for enable maintenance mode is required.');
}
if (typeof env !== 'string') {
if (typeof ENV !== 'string') {
throw new Error('A value for env is required.');
}

Expand All @@ -29,7 +29,7 @@ async function setMaintenanceMode() {
});
const currentColorRecord = await documentClient.get({
Key: { pk: 'current-color', sk: 'current-color' },
TableName: `efcms-deploy-${env}`,
TableName: `efcms-deploy-${ENV}`,
});
const activeColor: 'blue' | 'green' | undefined =
currentColorRecord?.Item?.current;
Expand All @@ -48,11 +48,11 @@ async function setMaintenanceMode() {
});

console.log(
`Setting Maintenance mode to ${enableMaintenanceMode} for ${env}`,
`Setting Maintenance mode to ${enableMaintenanceMode} for ${ENV}`,
);

const command = new InvokeCommand({
FunctionName: `send_maintenance_notifications_${env}_${activeColor}`,
FunctionName: `send_maintenance_notifications_${ENV}_${activeColor}`,
InvocationType: 'RequestResponse',
Payload: Buffer.from(
JSON.stringify({
Expand Down
10 changes: 5 additions & 5 deletions scripts/jest-scripts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ const config: Config = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: [
'**/*.{js,ts}',
'!checkUntouchedFiles.ts',
'!circleci/*.ts',
'!circleci/judge/bulkImportJudgeUsers.ts',
'!checkUntouchedFiles.ts',
'!compareTypescriptErrors.ts',
'!coverage/**',
'!download-all-case-documents.ts',
'!dynamo/archive-outboxes.ts',
'!dynamo/fix-race-condition-served-in-drafts.ts',
'!dynamo/read-segment.ts',
'!dynamo/set-local-migration-complete-marker.ts',
'!dynamo/set-maintenance-mode.ts',
'!elasticsearch/create-temporary-indices.ts',
'!elasticsearch/docket-entry-search.ts',
'!elasticsearch/docket-inbox.ts',
Expand All @@ -29,14 +29,14 @@ const config: Config = {
'!import-case-status-changes-from-csv.ts',
'!irs-super-user.ts',
'!jest-scripts.config.ts',
'!set-maintenance-mode-locally.ts',
'!judge/update-judge-titles.ts',
'!judge/update-judge-isSeniorJudge.ts',
'!judge/update-judge-titles.ts',
'!reports/**',
'!run-once-scripts/**',
'!dynamo/set-maintenance-mode.ts',
'!set-maintenance-mode-locally.ts',
'!upload-practitioner-application-packages.ts',
'!user/**',
'**/*.{js,ts}',
],
coverageDirectory: './coverage',
coverageProvider: 'babel',
Expand Down
4 changes: 2 additions & 2 deletions web-api/jest-unit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const config: Config = {
'src/**/*.{js,ts}',
'workflow-terraform/migration/main/lambdas/migrations/*.{js,ts}',
'!src/applicationContext.{js,ts}',
'!src/gateways/worker/workerLocal.ts',
'!src/getPersistenceGateway.{js,ts}',
'!src/getUseCases.{js,ts}',
'!src/getUseCaseHelpers.{js,ts}',
'!src/getPersistenceGateway.{js,ts}',
'!src/getUserGateway.ts',
'!src/gateways/worker/workerLocal.ts',
'!src/**/*Handlers.{js,ts}',
'!src/**/*Lambda.{js,ts}',
'!src/app.{js,ts}',
Expand Down
2 changes: 1 addition & 1 deletion web-api/src/persistence/cognito/getCognito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function getCognito() {

export function getLocalCognito() {
// KNOWN BUGS:
// - users is a FORCE_CHANGE_PASSWORD state will get a new password challenge when authenticating even if the wrong password is entered
// - users in a FORCE_CHANGE_PASSWORD state will get a new password challenge when authenticating even if the wrong password is entered
// - respondToAuthChallenge does not associate tokens returned in authenticationResult on the user; cannot refresh app _immediately_ after changing password

if (!cognitoClientCache) {
Expand Down

0 comments on commit 8704afd

Please sign in to comment.