diff --git a/.gitignore b/.gitignore index ec00b98..0154b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,22 @@ Lambdas/Lists/target/surefire-reports/TEST-TestInputUtils.xml Lambdas/Scraping/scraperConfigs.json Lambdas/Scraping/dbConfigs.json Lambdas/Scraping/artifacts/* + +#amplify +amplify/\#current-cloud-backend +amplify/.config/local-* +amplify/logs +amplify/mock-data +amplify/backend/amplify-meta.json +amplify/backend/awscloudformation +amplify/backend/.temp +build/ +dist/ +node_modules/ +aws-exports.js +awsconfiguration.json +amplifyconfiguration.json +amplify-build-config.json +amplify-gradle-config.json +amplifytools.xcconfig +.secret-* \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c87b85e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "files.exclude": { + "amplify/.config": true, + "amplify/**/*-parameters.json": true, + "amplify/**/amplify.state": true, + "amplify/**/transform.conf.json": true, + "amplify/#current-cloud-backend": true, + "amplify/backend/amplify-meta.json": true, + "amplify/backend/awscloudformation": true + } +} \ No newline at end of file diff --git a/Lambdas/Lists/User/resources/cognitoProperties.json b/Lambdas/Lists/User/resources/cognitoProperties.json index a01aefd..f9579b4 100644 --- a/Lambdas/Lists/User/resources/cognitoProperties.json +++ b/Lambdas/Lists/User/resources/cognitoProperties.json @@ -1,3 +1,3 @@ { - "userPoolId": "us-east-2_MFgSVKQMd", + "userPoolId": " us-east-2_hcxKr2fA1" } \ No newline at end of file diff --git a/Listify/.gitignore b/Listify/.gitignore index 49b1255..31cd65d 100644 --- a/Listify/.gitignore +++ b/Listify/.gitignore @@ -16,9 +16,11 @@ #amplify amplify/\#current-cloud-backend amplify/.config/local-* +amplify/logs amplify/mock-data amplify/backend/amplify-meta.json amplify/backend/awscloudformation +amplify/backend/.temp build/ dist/ node_modules/ @@ -27,4 +29,5 @@ awsconfiguration.json amplifyconfiguration.json amplify-build-config.json amplify-gradle-config.json -amplifytools.xcconfig \ No newline at end of file +amplifytools.xcconfig +.secret-* \ No newline at end of file diff --git a/Listify/.vscode/settings.json b/Listify/.vscode/settings.json new file mode 100644 index 0000000..c87b85e --- /dev/null +++ b/Listify/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "files.exclude": { + "amplify/.config": true, + "amplify/**/*-parameters.json": true, + "amplify/**/amplify.state": true, + "amplify/**/transform.conf.json": true, + "amplify/#current-cloud-backend": true, + "amplify/backend/amplify-meta.json": true, + "amplify/backend/awscloudformation": true + } +} \ No newline at end of file diff --git a/Listify/amplify/backend/auth/listifyf4fad454/listifyf4fad454-cloudformation-template.yml b/Listify/amplify/backend/auth/listify0c093a990c093a99/listify0c093a990c093a99-cloudformation-template.yml similarity index 82% rename from Listify/amplify/backend/auth/listifyf4fad454/listifyf4fad454-cloudformation-template.yml rename to Listify/amplify/backend/auth/listify0c093a990c093a99/listify0c093a990c093a99-cloudformation-template.yml index 8560fdb..39f8e52 100644 --- a/Listify/amplify/backend/auth/listifyf4fad454/listifyf4fad454-cloudformation-template.yml +++ b/Listify/amplify/backend/auth/listify0c093a990c093a99/listify0c093a990c093a99-cloudformation-template.yml @@ -7,106 +7,157 @@ Parameters: Type: String unauthRoleArn: Type: String - + identityPoolName: Type: String - + + + allowUnauthenticatedIdentities: Type: String resourceNameTruncated: Type: String - + + userPoolName: Type: String - + + + autoVerifiedAttributes: Type: CommaDelimitedList mfaConfiguration: Type: String - + + + mfaTypes: Type: CommaDelimitedList smsAuthenticationMessage: Type: String - + + smsVerificationMessage: Type: String - + + emailVerificationSubject: Type: String - + + emailVerificationMessage: Type: String - + + + defaultPasswordPolicy: Type: String - + + passwordPolicyMinLength: Type: Number - + + passwordPolicyCharacters: Type: CommaDelimitedList - + + requiredAttributes: Type: CommaDelimitedList - + + userpoolClientGenerateSecret: Type: String - + + userpoolClientRefreshTokenValidity: Type: Number - + + userpoolClientWriteAttributes: Type: CommaDelimitedList - + + userpoolClientReadAttributes: Type: CommaDelimitedList userpoolClientLambdaRole: Type: String - + + + userpoolClientSetAttributes: Type: String sharedId: Type: String - + + resourceName: Type: String - + + authSelections: Type: String - + + + + useDefault: Type: String - + + + usernameAttributes: Type: CommaDelimitedList + + userPoolGroups: + Type: String + + + adminQueries: + Type: String + triggers: Type: String - + + + + hostedUI: + Type: String + + userPoolGroupList: Type: CommaDelimitedList serviceName: Type: String - + + + + usernameCaseSensitive: + Type: String + + parentStack: Type: String - + + permissions: Type: CommaDelimitedList - + + dependsOn: Type: CommaDelimitedList - + + Conditions: ShouldNotCreateEnvResources: !Equals [ !Ref env, NONE ] @@ -114,32 +165,32 @@ Resources: # BEGIN SNS ROLE RESOURCE - SNSRole: + SNSRole: # Created to allow the UserPool SMS Config to publish via the Simple Notification Service during MFA Process Type: AWS::IAM::Role Properties: - RoleName: !If [ShouldNotCreateEnvResources, 'listiff4fad454_sns-role', !Join ['',[ 'sns', 'f4fad454', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]] - AssumeRolePolicyDocument: + RoleName: !If [ShouldNotCreateEnvResources, 'listif0c093a99_sns-role', !Join ['',[ 'sns', '0c093a99', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]] + AssumeRolePolicyDocument: Version: "2012-10-17" - Statement: + Statement: - Sid: "" Effect: "Allow" - Principal: + Principal: Service: "cognito-idp.amazonaws.com" - Action: + Action: - "sts:AssumeRole" - Condition: + Condition: StringEquals: - sts:ExternalId: listiff4fad454_role_external_id - Policies: - - - PolicyName: listiff4fad454-sns-policy - PolicyDocument: + sts:ExternalId: listif0c093a99_role_external_id + Policies: + - + PolicyName: listif0c093a99-sns-policy + PolicyDocument: Version: "2012-10-17" - Statement: - - + Statement: + - Effect: "Allow" - Action: + Action: - "sns:Publish" Resource: "*" # BEGIN USER POOL RESOURCES @@ -151,7 +202,11 @@ Resources: Properties: UserPoolName: !If [ShouldNotCreateEnvResources, !Ref userPoolName, !Join ['',[!Ref userPoolName, '-', !Ref env]]] - Schema: + + UsernameConfiguration: + CaseSensitive: false + + Schema: - Name: email @@ -166,7 +221,7 @@ Resources: EmailVerificationMessage: !Ref emailVerificationMessage EmailVerificationSubject: !Ref emailVerificationSubject - + Policies: PasswordPolicy: MinimumLength: !Ref passwordPolicyMinLength @@ -176,23 +231,23 @@ Resources: RequireUppercase: false UsernameAttributes: !Ref usernameAttributes - + MfaConfiguration: !Ref mfaConfiguration SmsVerificationMessage: !Ref smsVerificationMessage - SmsConfiguration: + SmsConfiguration: SnsCallerArn: !GetAtt SNSRole.Arn - ExternalId: listiff4fad454_role_external_id - - - - - - + ExternalId: listif0c093a99_role_external_id - - + + + + + + + + # Updating lambda role with permissions to Cognito @@ -201,7 +256,7 @@ Resources: # Depends on UserPool for ID reference Type: "AWS::Cognito::UserPoolClient" Properties: - ClientName: listiff4fad454_app_clientWeb + ClientName: listif0c093a99_app_clientWeb RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity UserPoolId: !Ref UserPool @@ -211,7 +266,7 @@ Resources: # Depends on UserPool for ID reference Type: "AWS::Cognito::UserPoolClient" Properties: - ClientName: listiff4fad454_app_client + ClientName: listif0c093a99_app_client GenerateSecret: !Ref userpoolClientGenerateSecret RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity @@ -222,7 +277,7 @@ Resources: # Created to execute Lambda which gets userpool app client config values Type: 'AWS::IAM::Role' Properties: - RoleName: !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',['upClientLambdaRole', 'f4fad454', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]] + RoleName: !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',['upClientLambdaRole', '0c093a99', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]] AssumeRolePolicyDocument: Version: '2012-10-17' Statement: @@ -240,7 +295,7 @@ Resources: Type: 'AWS::Lambda::Function' Properties: Code: - ZipFile: !Join + ZipFile: !Join - |+ - - 'const response = require(''cfn-response'');' - 'const aws = require(''aws-sdk'');' @@ -256,7 +311,7 @@ Resources: - ' };' - ' identity.describeUserPoolClient(params).promise()' - ' .then((res) => {' - - ' response.send(event, context, response.SUCCESS, {''appSecret'': res.UserPoolClient.ClientSecret});' + - ' response.send(event, context, response.SUCCESS, {''appSecret'': res.UserPoolClient.ClientSecret});' - ' })' - ' .catch((err) => {' - ' response.send(event, context, response.FAILED, {err});' @@ -266,7 +321,7 @@ Resources: Handler: index.handler Runtime: nodejs10.x Timeout: '300' - Role: !GetAtt + Role: !GetAtt - UserPoolClientRole - Arn DependsOn: UserPoolClientRole @@ -276,8 +331,8 @@ Resources: # Marked as depending on UserPoolClientRole for easier to understand CFN sequencing Type: 'AWS::IAM::Policy' Properties: - PolicyName: listiff4fad454_userpoolclient_lambda_iam_policy - Roles: + PolicyName: listif0c093a99_userpoolclient_lambda_iam_policy + Roles: - !Ref UserPoolClientRole PolicyDocument: Version: '2012-10-17' @@ -293,8 +348,8 @@ Resources: # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing Type: 'AWS::IAM::Policy' Properties: - PolicyName: listiff4fad454_userpoolclient_lambda_log_policy - Roles: + PolicyName: listif0c093a99_userpoolclient_lambda_log_policy + Roles: - !Ref UserPoolClientRole PolicyDocument: Version: 2012-10-17 @@ -304,10 +359,10 @@ Resources: - 'logs:CreateLogGroup' - 'logs:CreateLogStream' - 'logs:PutLogEvents' - Resource: !Sub + Resource: !Sub - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:* - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref UserPoolClientLambda} - DependsOn: UserPoolClientLambdaPolicy + DependsOn: UserPoolClientLambdaPolicy UserPoolClientInputs: # Values passed to Userpool client Lambda # Depends on UserPool for Id @@ -328,12 +383,12 @@ Resources: # BEGIN IDENTITY POOL RESOURCES - + IdentityPool: # Always created Type: AWS::Cognito::IdentityPool - Properties: - IdentityPoolName: !If [ShouldNotCreateEnvResources, 'listifyf4fad454_identitypool_f4fad454', !Join ['',['listifyf4fad454_identitypool_f4fad454', '__', !Ref env]]] + Properties: + IdentityPoolName: !If [ShouldNotCreateEnvResources, 'listify0c093a990c093a99_identitypool_6bcaf6ac', !Join ['',['listify0c093a990c093a99_identitypool_6bcaf6ac', '__', !Ref env]]] CognitoIdentityProviders: - ClientId: !Ref UserPoolClient @@ -346,16 +401,16 @@ Resources: - { region: !Ref "AWS::Region", client: !Ref UserPool} AllowUnauthenticatedIdentities: !Ref allowUnauthenticatedIdentities - - - DependsOn: UserPoolClientInputs + - + DependsOn: UserPoolClientInputs + + IdentityPoolRoleMap: # Created to map Auth and Unauth roles to the identity pool # Depends on Identity Pool for ID ref Type: AWS::Cognito::IdentityPoolRoleAttachment - Properties: + Properties: IdentityPoolId: !Ref IdentityPool Roles: unauthenticated: !Ref unauthRoleArn @@ -369,7 +424,7 @@ Outputs : Value: !Ref 'IdentityPool' Description: Id for the identity pool IdentityPoolName: - Value: !GetAtt IdentityPool.Name + Value: !GetAtt IdentityPool.Name @@ -388,9 +443,9 @@ Outputs : AppClientSecret: Value: !GetAtt UserPoolClientInputs.appSecret - - - - + + + + diff --git a/Listify/amplify/backend/auth/listifyf4fad454/parameters.json b/Listify/amplify/backend/auth/listify0c093a990c093a99/parameters.json similarity index 71% rename from Listify/amplify/backend/auth/listifyf4fad454/parameters.json rename to Listify/amplify/backend/auth/listify0c093a990c093a99/parameters.json index 8c6f1d6..ffe3f4f 100644 --- a/Listify/amplify/backend/auth/listifyf4fad454/parameters.json +++ b/Listify/amplify/backend/auth/listify0c093a990c093a99/parameters.json @@ -1,8 +1,8 @@ { - "identityPoolName": "listifyf4fad454_identitypool_f4fad454", - "allowUnauthenticatedIdentities": true, - "resourceNameTruncated": "listiff4fad454", - "userPoolName": "listifyf4fad454_userpool_f4fad454", + "identityPoolName": "listify0c093a990c093a99_identitypool_6bcaf6ac", + "allowUnauthenticatedIdentities": false, + "resourceNameTruncated": "listif0c093a99", + "userPoolName": "listify0c093a99_userpool_0c093a99", "autoVerifiedAttributes": [ "email" ], @@ -14,7 +14,7 @@ "smsVerificationMessage": "Your verification code is {####}", "emailVerificationSubject": "Your verification code", "emailVerificationMessage": "Your verification code is {####}", - "defaultPasswordPolicy": false, + "defaultPasswordPolicy": true, "passwordPolicyMinLength": 8, "passwordPolicyCharacters": [], "requiredAttributes": [ @@ -28,10 +28,10 @@ "userpoolClientReadAttributes": [ "email" ], - "userpoolClientLambdaRole": "listiff4fad454_userpoolclient_lambda_role", + "userpoolClientLambdaRole": "listif0c093a99_userpoolclient_lambda_role", "userpoolClientSetAttributes": false, - "sharedId": "f4fad454", - "resourceName": "listifyf4fad454", + "sharedId": "0c093a99", + "resourceName": "listify0c093a990c093a99", "authSelections": "identityPoolAndUserPool", "authRoleArn": { "Fn::GetAtt": [ @@ -49,9 +49,13 @@ "usernameAttributes": [ "email" ], + "userPoolGroups": false, + "adminQueries": false, "triggers": "{}", + "hostedUI": false, "userPoolGroupList": [], "serviceName": "Cognito", + "usernameCaseSensitive": false, "parentStack": { "Ref": "AWS::StackId" }, diff --git a/Listify/amplify/backend/backend-config.json b/Listify/amplify/backend/backend-config.json index 771cac6..c9d34e7 100644 --- a/Listify/amplify/backend/backend-config.json +++ b/Listify/amplify/backend/backend-config.json @@ -1,12 +1,10 @@ { "auth": { - "listifyf4fad454": { + "listify0c093a990c093a99": { "service": "Cognito", "providerPlugin": "awscloudformation", "dependsOn": [], "customAuth": false } - }, - "function": {}, - "api": {} + } } \ No newline at end of file diff --git a/Listify/amplify/cli.json b/Listify/amplify/cli.json index 876a6e2..c1a830d 100644 --- a/Listify/amplify/cli.json +++ b/Listify/amplify/cli.json @@ -1,3 +1,19 @@ { - "features": {} + "features": { + "graphqltransformer": { + "addmissingownerfields": true, + "validatetypenamereservedwords": true, + "useexperimentalpipelinedtransformer": false, + "enableiterativegsiupdates": false + }, + "frontend-ios": { + "enablexcodeintegration": true + }, + "auth": { + "enablecaseinsensitivity": true + }, + "codegen": { + "useappsyncmodelgenplugin": true + } + } } \ No newline at end of file diff --git a/Listify/amplify/team-provider-info.json b/Listify/amplify/team-provider-info.json index 2ff66cd..9ce4864 100644 --- a/Listify/amplify/team-provider-info.json +++ b/Listify/amplify/team-provider-info.json @@ -1,19 +1,19 @@ { "dev": { "awscloudformation": { - "AuthRoleName": "amplify-listify-dev-134836-authRole", - "UnauthRoleArn": "arn:aws:iam::569815541706:role/amplify-listify-dev-134836-unauthRole", - "AuthRoleArn": "arn:aws:iam::569815541706:role/amplify-listify-dev-134836-authRole", + "AuthRoleName": "amplify-listify-dev-175235-authRole", + "UnauthRoleArn": "arn:aws:iam::683822751040:role/amplify-listify-dev-175235-unauthRole", + "AuthRoleArn": "arn:aws:iam::683822751040:role/amplify-listify-dev-175235-authRole", "Region": "us-east-2", - "DeploymentBucketName": "amplify-listify-dev-134836-deployment", - "UnauthRoleName": "amplify-listify-dev-134836-unauthRole", - "StackName": "amplify-listify-dev-134836", - "StackId": "arn:aws:cloudformation:us-east-2:569815541706:stack/amplify-listify-dev-134836/5980b520-faa0-11ea-a89c-0650659cf0f8", - "AmplifyAppId": "dbnznhwtkbqz6" + "DeploymentBucketName": "amplify-listify-dev-175235-deployment", + "UnauthRoleName": "amplify-listify-dev-175235-unauthRole", + "StackName": "amplify-listify-dev-175235", + "StackId": "arn:aws:cloudformation:us-east-2:683822751040:stack/amplify-listify-dev-175235/8b09fbb0-400a-11eb-bec3-0af2d26319e4", + "AmplifyAppId": "diphjs0cwsd7r" }, "categories": { "auth": { - "listifyf4fad454": {} + "listify0c093a990c093a99": {} } } } diff --git a/Listify/app/src/main/java/com/example/listify/AuthManager.java b/Listify/app/src/main/java/com/example/listify/AuthManager.java index 31f2991..0c15c8a 100644 --- a/Listify/app/src/main/java/com/example/listify/AuthManager.java +++ b/Listify/app/src/main/java/com/example/listify/AuthManager.java @@ -57,6 +57,7 @@ public class AuthManager { if (authSession.isSignedIn() == false) { return ""; } + System.out.println(authSession.getUserPoolTokens().getValue().getIdToken()); return authSession.getUserPoolTokens().getValue().getIdToken(); } diff --git a/Listify/app/src/main/java/com/example/listify/Requestor.java b/Listify/app/src/main/java/com/example/listify/Requestor.java index ed149c3..6c62d84 100644 --- a/Listify/app/src/main/java/com/example/listify/Requestor.java +++ b/Listify/app/src/main/java/com/example/listify/Requestor.java @@ -12,7 +12,8 @@ import java.io.IOException; public class Requestor { - private final String DEV_BASEURL = "https://datoh7woc9.execute-api.us-east-2.amazonaws.com/Development"; + //API Gateway ID + private final String DEV_BASEURL = "https://u7g2t7ok4a.execute-api.us-east-2.amazonaws.com/ListifyStage"; AuthManager authManager; String apiKey;