From 9540d2355540c4e0e7c7813c9805fba2d9e318ba Mon Sep 17 00:00:00 2001 From: BearHanded Date: Mon, 8 Jul 2024 13:51:15 -0400 Subject: [PATCH] configure amplify test deploy no attachments bucket comments users match mfp, per product --- serverless-compose.yml | 1 - services/ui-auth/libs/users.json | 84 ++++++++++++++++++++++ services/ui-auth/serverless.yml | 12 ---- services/ui-src/src/components/app/App.tsx | 2 +- services/ui-src/src/index.tsx | 39 +++++----- services/ui-src/src/utils/other/parsing.ts | 2 - 6 files changed, 102 insertions(+), 38 deletions(-) diff --git a/serverless-compose.yml b/serverless-compose.yml index 054055d8..eecff5f2 100644 --- a/serverless-compose.yml +++ b/serverless-compose.yml @@ -21,7 +21,6 @@ services: # SarFormBucketName: ${database.SarFormBucketName} # SarReportTableName: ${database.SarReportTableName} # SarReportTableStreamArn: ${database.SarReportTableStreamArn} - # AttachmentsBucketName: ${uploads.AttachmentsBucketName} # wave 3: depends on many ui-auth: diff --git a/services/ui-auth/libs/users.json b/services/ui-auth/libs/users.json index acf5539f..6453f9bf 100644 --- a/services/ui-auth/libs/users.json +++ b/services/ui-auth/libs/users.json @@ -24,6 +24,32 @@ } ] }, + + { + "username": "borep@test.com", + "attributes": [ + { + "Name": "email", + "Value": "borep@test.com" + }, + { + "Name": "given_name", + "Value": "Bobby" + }, + { + "Name": "family_name", + "Value": "Business" + }, + { + "Name": "email_verified", + "Value": "true" + }, + { + "Name": "custom:cms_roles", + "Value": "mdcthcbs-bor" + } + ] + }, { "username": "helpdeskuser@test.com", "attributes": [ @@ -103,6 +129,64 @@ } ] }, + { + "username": "staterep@test.com", + "attributes": [ + { + "Name": "email", + "Value": "staterep@test.com" + }, + { + "Name": "given_name", + "Value": "Robert" + }, + { + "Name": "family_name", + "Value": "States" + }, + { + "Name": "email_verified", + "Value": "true" + }, + { + "Name": "custom:cms_roles", + "Value": "mdcthcbs-state-rep" + }, + { + "Name": "custom:cms_state", + "Value": "MA" + } + ] + }, + { + "username": "stateapprover@test.com", + "attributes": [ + { + "Name": "email", + "Value": "stateapprover@test.com" + }, + { + "Name": "given_name", + "Value": "Zara" + }, + { + "Name": "family_name", + "Value": "Zustimmer" + }, + { + "Name": "email_verified", + "Value": "true" + }, + { + "Name": "custom:cms_roles", + "Value": "mdcthcbs-approver" + }, + { + "Name": "custom:cms_state", + "Value": "MN" + } + ] + }, { "username": "stateuser1@test.com", "attributes": [ diff --git a/services/ui-auth/serverless.yml b/services/ui-auth/serverless.yml index d017a97c..133d42a8 100644 --- a/services/ui-auth/serverless.yml +++ b/services/ui-auth/serverless.yml @@ -45,7 +45,6 @@ custom: - val - production sesSourceEmailAddress: ${ssm:/configuration/${self:custom.stage}/sesSourceEmailAddress, ssm:/configuration/default/sesSourceEmailAddress, ""} - attachments_bucket_arn: ${param:AttachmentsBucketArn} api_gateway_rest_api_name: ${param:ApiGatewayRestApiName, ""} application_endpoint_url: ${param:ApplicationEndpointUrl} bootstrapUsersEnabled: ${ssm:/configuration/${self:custom.stage}/cognito/bootstrapUsers/enabled, ssm:/configuration/default/cognito/bootstrapUsers/enabled, ""} @@ -269,17 +268,6 @@ resources: Action: - "execute-api:Invoke" Resource: !Sub arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${self:custom.api_gateway_rest_api_name}/* - - Effect: "Allow" - Action: - - "s3:*" - Resource: - # Must use Join here. See: https://github.com/serverless/serverless/issues/3565 - - Fn::Join: - - "" - - - ${self:custom.attachments_bucket_arn} - - "/protected/" - - "$" - - "{cognito-identity.amazonaws.com:sub}/*" CognitoUserPoolIdParameter: Type: AWS::SSM::Parameter Properties: diff --git a/services/ui-src/src/components/app/App.tsx b/services/ui-src/src/components/app/App.tsx index bbc6e2a8..14c6c861 100644 --- a/services/ui-src/src/components/app/App.tsx +++ b/services/ui-src/src/components/app/App.tsx @@ -29,7 +29,7 @@ export const App = () => {
- Home and Community Based Services + Home & Community Based Services diff --git a/services/ui-src/src/index.tsx b/services/ui-src/src/index.tsx index b62b7868..b3a921c0 100644 --- a/services/ui-src/src/index.tsx +++ b/services/ui-src/src/index.tsx @@ -3,7 +3,7 @@ import ReactDOM from "react-dom"; import { BrowserRouter as Router } from "react-router-dom"; import { ErrorBoundary } from "react-error-boundary"; -// import { Amplify } from "aws-amplify"; +import { Amplify } from "aws-amplify"; import config from "config"; import { ApiProvider, UserProvider } from "utils"; import { asyncWithLDProvider } from "launchdarkly-react-client-sdk"; @@ -12,27 +12,22 @@ import { ChakraProvider } from "@chakra-ui/react"; import theme from "styles/theme"; import "./styles/index.scss"; -// Amplify.configure({ -// Storage: { -// region: config.s3.REGION, -// bucket: config.s3.BUCKET, -// identityPoolId: config.cognito.IDENTITY_POOL_ID, -// }, -// Auth: { -// mandatorySignIn: true, -// region: config.cognito.REGION, -// userPoolId: config.cognito.USER_POOL_ID, -// identityPoolId: config.cognito.IDENTITY_POOL_ID, -// userPoolWebClientId: config.cognito.APP_CLIENT_ID, -// oauth: { -// domain: config.cognito.APP_CLIENT_DOMAIN, -// redirectSignIn: config.cognito.REDIRECT_SIGNIN, -// redirectSignOut: config.cognito.REDIRECT_SIGNOUT, -// scope: ["email", "openid", "profile"], -// responseType: "code", -// }, -// }, -// }); +Amplify.configure({ + Auth: { + mandatorySignIn: true, + region: config.cognito.REGION, + userPoolId: config.cognito.USER_POOL_ID, + identityPoolId: config.cognito.IDENTITY_POOL_ID, + userPoolWebClientId: config.cognito.APP_CLIENT_ID, + oauth: { + domain: config.cognito.APP_CLIENT_DOMAIN, + redirectSignIn: config.cognito.REDIRECT_SIGNIN, + redirectSignOut: config.cognito.REDIRECT_SIGNOUT, + scope: ["email", "openid", "profile"], + responseType: "code", + }, + }, +}); // LaunchDarkly configuration const ldClientId = config.REACT_APP_LD_SDK_CLIENT; (async () => { diff --git a/services/ui-src/src/utils/other/parsing.ts b/services/ui-src/src/utils/other/parsing.ts index d5817bb1..eb9d7dcf 100644 --- a/services/ui-src/src/utils/other/parsing.ts +++ b/services/ui-src/src/utils/other/parsing.ts @@ -1,7 +1,6 @@ import React, { ReactElement } from "react"; import DOMPurify from "dompurify"; import parse from "html-react-parser"; -// components import { Link as RouterLink } from "react-router-dom"; import { Heading, @@ -18,7 +17,6 @@ import { Tr, UnorderedList, } from "@chakra-ui/react"; -// types import { CustomHtmlElement } from "types"; import uuid from "react-uuid";