Skip to content

Commit

Permalink
configure amplify
Browse files Browse the repository at this point in the history
test deploy

no attachments bucket

comments

users match mfp, per product
  • Loading branch information
BearHanded committed Jul 8, 2024
1 parent af9e062 commit 9540d23
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 38 deletions.
1 change: 0 additions & 1 deletion serverless-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ services:
# SarFormBucketName: ${database.SarFormBucketName}
# SarReportTableName: ${database.SarReportTableName}
# SarReportTableStreamArn: ${database.SarReportTableStreamArn}
# AttachmentsBucketName: ${uploads.AttachmentsBucketName}

# wave 3: depends on many
ui-auth:
Expand Down
84 changes: 84 additions & 0 deletions services/ui-auth/libs/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,32 @@
}
]
},

{
"username": "[email protected]",
"attributes": [
{
"Name": "email",
"Value": "[email protected]"
},
{
"Name": "given_name",
"Value": "Bobby"
},
{
"Name": "family_name",
"Value": "Business"
},
{
"Name": "email_verified",
"Value": "true"
},
{
"Name": "custom:cms_roles",
"Value": "mdcthcbs-bor"
}
]
},
{
"username": "[email protected]",
"attributes": [
Expand Down Expand Up @@ -103,6 +129,64 @@
}
]
},
{
"username": "[email protected]",
"attributes": [
{
"Name": "email",
"Value": "[email protected]"
},
{
"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": "[email protected]",
"attributes": [
{
"Name": "email",
"Value": "[email protected]"
},
{
"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": "[email protected]",
"attributes": [
Expand Down
12 changes: 0 additions & 12 deletions services/ui-auth/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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, ""}
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/components/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const App = () => {
<main>
<Container sx={sx.appContainer}>
<Heading as="h1" size="xl" sx={sx.loginHeading}>
Home and Community Based Services
Home &amp; Community Based Services
</Heading>
</Container>
<Container sx={sx.loginContainer} data-testid="login-container">
Expand Down
39 changes: 17 additions & 22 deletions services/ui-src/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 () => {
Expand Down
2 changes: 0 additions & 2 deletions services/ui-src/src/utils/other/parsing.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -18,7 +17,6 @@ import {
Tr,
UnorderedList,
} from "@chakra-ui/react";
// types
import { CustomHtmlElement } from "types";
import uuid from "react-uuid";

Expand Down

0 comments on commit 9540d23

Please sign in to comment.