forked from aws-amplify/amplify-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test): use Amplify Gen 2 config in unit tests (aws-amplify#5205)
- Loading branch information
Showing
18 changed files
with
300 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 41 additions & 78 deletions
119
packages/api/amplify_api_dart/test/test_data/fake_amplify_configuration.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,45 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
const amplifyconfig = '''{ | ||
"UserAgent": "aws-amplify-cli/2.0", | ||
"Version": "1.0", | ||
"api": { | ||
"plugins": { | ||
"awsAPIPlugin": { | ||
"apiIntegrationTestGraphQL": { | ||
"endpointType": "GraphQL", | ||
"endpoint": "https://abc123.appsync-api.us-east-1.amazonaws.com/graphql", | ||
"region": "us-east-1", | ||
"authorizationType": "API_KEY", | ||
"apiKey": "abc123" | ||
}, | ||
"api123": { | ||
"endpointType": "REST", | ||
"endpoint": "https://abc123.execute-api.us-east-1.amazonaws.com/test", | ||
"region": "us-east-1", | ||
"authorizationType": "AWS_IAM" | ||
} | ||
} | ||
} | ||
}, | ||
"auth": { | ||
"plugins": { | ||
"awsCognitoAuthPlugin": { | ||
"UserAgent": "aws-amplify-cli/0.1.0", | ||
"Version": "0.1.0", | ||
"IdentityManager": { | ||
"Default": {} | ||
}, | ||
"AppSync": { | ||
"Default": { | ||
"ApiUrl": "https://abc123.appsync-api.us-east-1.amazonaws.com/graphql", | ||
"Region": "us-east-1", | ||
"AuthMode": "API_KEY", | ||
"ApiKey": "abc123", | ||
"ClientDatabasePrefix": "apiIntegrationTestGraphQL_API_KEY" | ||
} | ||
}, | ||
"CredentialsProvider": { | ||
"CognitoIdentity": { | ||
"Default": { | ||
"PoolId": "us-east-1:abc123", | ||
"Region": "us-east-1" | ||
} | ||
} | ||
}, | ||
"CognitoUserPool": { | ||
"Default": { | ||
"PoolId": "us-east-1_abc123", | ||
"AppClientId": "abc123", | ||
"Region": "us-east-1" | ||
} | ||
}, | ||
"Auth": { | ||
"Default": { | ||
"authenticationFlowType": "USER_SRP_AUTH", | ||
"socialProviders": [], | ||
"usernameAttributes": [], | ||
"signupAttributes": [ | ||
"EMAIL" | ||
], | ||
"passwordProtectionSettings": { | ||
"passwordPolicyMinLength": 8, | ||
"passwordPolicyCharacters": [] | ||
}, | ||
"mfaConfiguration": "OFF", | ||
"mfaTypes": [ | ||
"SMS" | ||
], | ||
"verificationMechanisms": [ | ||
"EMAIL" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
const amplifyConfig = '''{ | ||
"version": "1", | ||
"auth": { | ||
"aws_region": "us-east-1", | ||
"user_pool_id": "us-east-1_abc123", | ||
"user_pool_client_id": "abc123", | ||
"identity_pool_id": "us-east-1:abc123", | ||
"password_policy": { | ||
"min_length": 8, | ||
"require_numbers": false, | ||
"require_lowercase": false, | ||
"require_uppercase": false, | ||
"require_symbols": false | ||
}, | ||
"standard_required_attributes":[ | ||
"email" | ||
], | ||
"username_attributes":[], | ||
"user_verification_types":[ | ||
"email" | ||
], | ||
"unauthenticated_identities_enabled": true, | ||
"mfa_configuration": "NONE", | ||
"mfa_methods":[ | ||
"SMS" | ||
] | ||
}, | ||
"data": { | ||
"aws_region": "us-east-1", | ||
"url": "https://abc123.appsync-api.us-east-1.amazonaws.com/graphql", | ||
"api_key": "abc123", | ||
"default_authorization_type": "API_KEY", | ||
"authorization_types":[] | ||
}, | ||
"rest_api": { | ||
"api123": { | ||
"aws_region": "us-east-1", | ||
"url": "https://abc123.execute-api.us-east-1.amazonaws.com/test", | ||
"authorization_type": "AWS_IAM" | ||
} | ||
} | ||
}'''; |
117 changes: 41 additions & 76 deletions
117
...ages/api/amplify_api_dart/test/test_data/fake_amplify_configuration_iam_with_api_key.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,46 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
const amplifyconfigwithapikey = '''{ | ||
"UserAgent": "aws-amplify-cli/2.0", | ||
"Version": "1.0", | ||
"api": { | ||
"plugins": { | ||
"awsAPIPlugin": { | ||
"apiIntegrationTestGraphQL": { | ||
"endpointType": "GraphQL", | ||
"endpoint": "https://abc123.appsync-api.us-east-1.amazonaws.com/graphql", | ||
"region": "us-east-1", | ||
"authorizationType": "AWS_IAM", | ||
"apiKey": "abc123" | ||
}, | ||
"api123": { | ||
"endpointType": "REST", | ||
"endpoint": "https://abc123.execute-api.us-east-1.amazonaws.com/test", | ||
"region": "us-east-1", | ||
"authorizationType": "AWS_IAM" | ||
} | ||
} | ||
} | ||
}, | ||
const amplifyConfigIamWithApiKey = ''' { | ||
"version": "1", | ||
"auth": { | ||
"plugins": { | ||
"awsCognitoAuthPlugin": { | ||
"UserAgent": "aws-amplify-cli/0.1.0", | ||
"Version": "0.1.0", | ||
"IdentityManager": { | ||
"Default": {} | ||
}, | ||
"AppSync": { | ||
"Default": { | ||
"ApiUrl": "https://abc123.appsync-api.us-east-1.amazonaws.com/graphql", | ||
"Region": "us-east-1", | ||
"AuthMode": "AWS_IAM", | ||
"ClientDatabasePrefix": "apiIntegrationTestGraphQL_API_KEY" | ||
} | ||
}, | ||
"CredentialsProvider": { | ||
"CognitoIdentity": { | ||
"Default": { | ||
"PoolId": "us-east-1:abc123", | ||
"Region": "us-east-1" | ||
} | ||
} | ||
}, | ||
"CognitoUserPool": { | ||
"Default": { | ||
"PoolId": "us-east-1_abc123", | ||
"AppClientId": "abc123", | ||
"Region": "us-east-1" | ||
} | ||
}, | ||
"Auth": { | ||
"Default": { | ||
"authenticationFlowType": "USER_SRP_AUTH", | ||
"socialProviders": [], | ||
"usernameAttributes": [], | ||
"signupAttributes": [ | ||
"EMAIL" | ||
], | ||
"passwordProtectionSettings": { | ||
"passwordPolicyMinLength": 8, | ||
"passwordPolicyCharacters": [] | ||
}, | ||
"mfaConfiguration": "OFF", | ||
"mfaTypes": [ | ||
"SMS" | ||
], | ||
"verificationMechanisms": [ | ||
"EMAIL" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
"aws_region": "us-east-1", | ||
"user_pool_id": "us-east-1_abc123", | ||
"user_pool_client_id": "abc123", | ||
"identity_pool_id": "us-east-1:abc123", | ||
"password_policy": { | ||
"min_length": 8, | ||
"require_numbers": false, | ||
"require_lowercase": false, | ||
"require_uppercase": false, | ||
"require_symbols": false | ||
}, | ||
"standard_required_attributes":[ | ||
"email" | ||
], | ||
"username_attributes":[], | ||
"user_verification_types":[ | ||
"email" | ||
], | ||
"unauthenticated_identities_enabled": true, | ||
"mfa_configuration": "NONE", | ||
"mfa_methods":[ | ||
"SMS" | ||
] | ||
}, | ||
"data": { | ||
"aws_region": "us-east-1", | ||
"url": "https://abc123.appsync-api.us-east-1.amazonaws.com/graphql", | ||
"api_key": "abc123", | ||
"default_authorization_type": "AWS_IAM", | ||
"authorization_types":[] | ||
}, | ||
"rest_api": { | ||
"api123": { | ||
"aws_region": "us-east-1", | ||
"url": "https://abc123.execute-api.us-east-1.amazonaws.com/test", | ||
"authorization_type": "AWS_IAM" | ||
} | ||
} | ||
}'''; | ||
} | ||
'''; |
Oops, something went wrong.