Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d3b5fdb
chore: Update issue template to GH form (#1387)
dnys1 Feb 22, 2022
2cbb142
fix(amplify_authenticator): remove use of onInverseSurface to support…
Jordan-Nelson Feb 22, 2022
bb033ba
chore(amplify_authenticator): run unit tests for amplify_authenticato…
Feb 22, 2022
b2e1b7d
fix(core): Implement Result in AtomicResult (#1393)
dnys1 Feb 23, 2022
ee088c0
chore: Small QOS additions to bug report template (#1394)
dnys1 Feb 23, 2022
506eb89
fix(amplify_authenticator): allow multiple custom attributes in custo…
Jordan-Nelson Feb 24, 2022
93ebb09
chore: authenticator v0.1.0 (#1402)
Jordan-Nelson Feb 24, 2022
36fc97a
chore: adds API for auth integ tests + minor fixes (#1302)
haverchuck Feb 24, 2022
3725958
chore(amplify_authenticator): add more detail to api docs for usernam…
Jordan-Nelson Feb 24, 2022
7738348
fix overflow in custom loyout example (#1401)
Jordan-Nelson Feb 24, 2022
53ba820
chore: rename docs dir to doc (#1406)
Jordan-Nelson Feb 25, 2022
881c86b
chore(amplify_api): clean up some code to limit analysis infos (#1404)
Feb 28, 2022
5fa6387
fix(datastore): delete default predicate causes deletion failure (#1409)
HuiSF Feb 28, 2022
c0a7436
Release 4.0.1 version bump (#1418)
fjnoyp Feb 28, 2022
ea88973
chore: add pub analysis to CI (#1408)
Jordan-Nelson Mar 1, 2022
33b95dc
chore: remove obsolete integration test driver files (#1395)
Mar 1, 2022
54ca44d
fix(amplify_api): model helpers query predicates correctly translates…
Mar 1, 2022
a5399e4
chore(amplify_auth_cognito) federated plugin (#1349)
haverchuck Mar 2, 2022
923a1f7
chore(auth): fix pubspec urls (#1424)
haverchuck Mar 2, 2022
dbaccf8
Merge remote-tracking branch 'org_origin/main' into feat/custom-pk
HuiSF Mar 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ commands:
command: |
flutter pub global activate melos 1.3.0
melos bootstrap
activate_pana:
steps:
- run:
name: Install and set up pana
command: |
flutter pub global activate pana
install_tuneup:
steps:
- run:
Expand All @@ -63,6 +69,21 @@ jobs:
name: Analyze Dart/Flutter Code
command: melos run analyze --no-select

pub_analysis:
executor: docker-executor
parameters:
plugin_threshold:
type: string
description: the plugin name and the pub analysis threshold in the format <plugin_name>:<threshold>
steps:
- install_flutter
- checkout
- install_melos
- activate_pana
- run:
name: Run pub analysis and fail if the score is below the max score
command: param=<< parameters.plugin_threshold >> && plugin=${param%:*} && threshold=${param#*:} && melos exec -c 1 --fail-fast --scope="$plugin" -- pana --no-warning --exit-code-threshold $threshold .

unit_test_flutter:
executor: docker-executor
parameters:
Expand Down Expand Up @@ -181,6 +202,20 @@ workflows:
jobs:
- format_flutter
- analyze_flutter
- pub_analysis:
matrix:
parameters:
plugin_threshold: [
# should be in format <plugin_name>:<threshold>
"amplify_analytics_pinpoint:10",
"amplify_api:10",
"amplify_auth_cognito:10",
"amplify_authenticator:0",
"amplify_core:10",
"amplify_datastore:20",
"amplify_flutter:20",
"amplify_storage_s3:10",
]
- unit_test_flutter:
matrix:
parameters:
Expand All @@ -189,6 +224,7 @@ workflows:
"amplify_analytics_pinpoint",
"amplify_api",
"amplify_auth_cognito",
"amplify_authenticator",
"amplify_core",
"amplify_datastore",
"amplify_datastore_plugin_interface",
Expand Down
6 changes: 4 additions & 2 deletions .circleci/test_all_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ test_failure=0
test_suite=$1
plugin=$3
project_root_dir=$2

dummy_file_path=example/lib/amplifyconfiguration.dart
category_dir=$(echo $plugin | cut -d'_' -f 2)

set +e
set -o pipefail

# Check for federated plugin structure
if [ -d "${plugin}_plugin" ]; then
cd "./${plugin}_plugin/" || exit
if [ -d "${category_dir}" ]; then
cd "./${category_dir}/" || exit
else
cd "./$plugin" || exit
fi
Expand Down
114 changes: 114 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Bug Report
description: File a bug report
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: description
attributes:
label: Description
description: Describe the bug
placeholder: |
A clear and concise description of what the bug is.
validations:
required: true
- type: checkboxes
id: categories
attributes:
label: Categories
description: "Select the affected categories, if applicable."
options:
- label: Analytics
required: false
- label: API
required: false
- label: Auth
required: false
- label: DataStore
required: false
- label: Storage
required: false
- type: textarea
id: repro
attributes:
label: Steps to Reproduce
description: "How do you trigger this bug? Please walk us through it step by step."
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: false
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: "If applicable, add screenshots to help explain your problem."
placeholder: "No screenshots provided"
validations:
required: false
- type: checkboxes
id: platforms
attributes:
label: Platforms
description: "Please mark the platforms where this issue occurs."
options:
- label: iOS
required: false
- label: Android
required: false
- type: textarea
id: environment
attributes:
label: Environment
description: "Please provide details of your Flutter build environment (`flutter doctor`)."
placeholder: |
Paste the output of running `flutter doctor` here
render: bash
validations:
required: true
- type: textarea
id: dependencies
attributes:
label: Dependencies
description: "Please provide your project's dependency versions (`flutter pub deps --no-dev --style=compact`)."
placeholder: |
Paste the output of running `flutter pub deps --no-dev --style=compact` here
render: bash
validations:
required: true
- type: input
id: device
attributes:
label: Device
description: "Which device(s) did you experience the issue on? (or `N/A` if not applicable)"
placeholder: "iPhone 12, Pixel 5"
validations:
required: true
- type: input
id: os
attributes:
label: OS
description: "Which operating system(s) did you experience the issue on? (or `N/A` if not applicable)"
placeholder: "iOS 15.1, Android 11"
validations:
required: true
- type: input
id: cli-version
attributes:
label: CLI Version
description: "Which version of the Amplify CLI are you running? (`amplify -v`)"
placeholder: "7.6.21"
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional Context
description: Please add any other context about the problem here.
placeholder: "No additional context provided"
validations:
required: false
56 changes: 0 additions & 56 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Podfile.lock
**/test-results/
.test_coverage.dart
.last_build_id
.fvm/

# IDEs
.idea/
Expand Down
94 changes: 16 additions & 78 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Thank you for your interest in contributing to our project! <3 Whether it's a bu
- [Our Design](#our-design)
- [Development Process](#development-process)
- [Setting up for local development](#setting-up-for-local-development)
- [Packages inside Amplify Flutter](#packages-inside-amplify-flutter)
- [Packages inside Amplify Flutter](#packages-inside-amplify-flutter)
- [Steps towards contributions](#steps-towards-contributions)
- [Pull Requests](#pull-requests)
- [Release](#release)
Expand Down Expand Up @@ -155,6 +155,21 @@ toolkit for interacting with AWS backend resources.
2. [AWS SDK for iOS](https://github.com/aws-amplify/aws-sdk-ios)
3. [AWS SDK for JavaScript](https://github.com/aws/aws-sdk-js)

## Unit Tests

To run all the flutter unit tests for all plugins:

```bash
$ melos run test:unit:flutter
```

or run all unit tests for a given platform

```bash
$ melos run test:unit:android
$ melos run test:unit:ios
```

## Integration Tests

In addition to unit tests which mock Amplify API interaction, this repository has integration tests which
Expand Down Expand Up @@ -207,83 +222,6 @@ $ melos run provision_integration_test_resources
Note: you will need to have [`jq`](https://github.com/stedolan/jq) installed, which you can install by running `brew install jq`.
The provisioning script uses the [Amplify CLI headless mode](https://docs.amplify.aws/cli/usage/headless).

The auth tests require some additional configuration to support lambda triggers for automatically
verifying temporary test users. Note that this should only be done for the test environment, never a production one. This can be done manually by [following this process](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html#aws-lambda-triggers-pre-registration-example-2) or by following these instructions for the amplify CLI:

```
$ cd packages/amplify_auth_cognito/example
$ amplify update auth
Please note that certain attributes may not be overwritten if you choose to use defaults settings.
Using service: Cognito, provided by: awscloudformation
What do you want to do?
Walk-through all the auth configurations
Select the authentication/authorization services that you want to use:
User Sign-Up, Sign-In, connected with AWS IAM controls ( Enables per-user Storage features for images or other content, Analytics, and more)
Please enter a name for your identity pool.
authintegrationtest
Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM)
No
Do you want to enable 3rd party authentication providers in your identity pool?
No
Do you want to add User Pool Groups?
No
Do you want to add an admin queries API?
No
Multi-factor authentication (MFA) user login options:
OFF
Email based user registration/forgot password:
Enabled (Requires per-user email entry at registration)
Please specify an email verification subject:
Your verification code
Please specify an email verification message:
Your verification code is {####}
Do you want to override the default password policy for this User Pool?
No
Specify the app's refresh token expiration period (in days):
30
Do you want to specify the user attributes this app can read and write?
No
Do you want to enable any of the following capabilities?
Do you want to use an OAuth flow?
No
? Do you want to configure Lambda Triggers for Cognito?
Yes
? Which triggers do you want to enable for Cognito
Pre Sign-up
? What functionality do you want to use for Pre Sign-up
Create your own module
Successfully added resource authintegrationtestPreSignup locally.
```

When prompted to edit the function now, choose "yes" and add the following code to the `custom.js` file
created by the amplify CLI, from [documentation](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html#aws-lambda-triggers-pre-registration-example-2).

```js
exports.handler = async event => {
// Confirm the user
event.response.autoConfirmUser = true;

// Set the email as verified if it is in the request
if (event.request.userAttributes.hasOwnProperty("email")) {
event.response.autoVerifyEmail = true;
}

// Set the phone number as verified if it is in the request
if (event.request.userAttributes.hasOwnProperty("phone_number")) {
event.response.autoVerifyPhone = true;
}

// Return to Amazon Cognito
return event;
};
```

Finally, run a push to update the resources with the new function resource (lambda trigger):

```bash
$ amplify push
```

Additionally, the storage category requires some manual configuration as the [headless CLI does not yet support storage](https://github.com/aws-amplify/amplify-cli/issues/7378). Those instructions
are notes in the [storage example app](packages/amplify_storage_s3/example/README.md).

Expand Down
Empty file modified build-support/lint_android.sh
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ dependencies:
flutter:
sdk: flutter
file_picker: ^4.0.0
amplify_flutter: 0.4.0
amplify_analytics_pinpoint: 0.4.0
amplify_auth_cognito: 0.4.0
amplify_storage_s3: 0.4.0
amplify_flutter: 0.4.1
amplify_analytics_pinpoint: 0.4.1
amplify_auth_cognito: 0.4.1
amplify_storage_s3: 0.4.1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
Expand Down
Loading