Skip to content

Commit

Permalink
chore(authenticator): Clean up (#931)
Browse files Browse the repository at this point in the history
* chore: make .gitignore more specific for amplify dirs and tweak integration test melos tasks (#711)

* feat: ✨ first snippet for the amplify authenticator

* chore(auth): User attributes/sign up docs (#697)

* feat(amplify): Null Safety Core (#492)

Null Safety upgrade for (to min Dart 2.12):
Core
Flutter
All Plugin Interface Packages

* feat(amplify_auth): Null Safety Auth (#536)

* feat(amplify_analytics): Null safety (#483)

* feat(amplify_storage_s3): Null safety (#485)

* feat(amplify_api): Null safety api (#484)

* fix: Broken Unit Tests

* fix: upgrade Auth changes to null safety

* fix: Broken Auth Unit Tests

* fix(amplify_auth_cognito): fixes auth null safety issues (#613)

* Example app null safety fixes (#617)

* Null safety master fixes pr (#614)

* chore(release): 0.2.0-nullsafety.0 (#622)

* Version Update to 0.2.0-nullsafety.0

* Update amplify.dart

Co-authored-by: Dustin Noyes <[email protected]>

* Update FlutterFetchCognitoAuthSessionResult.kt (#653)

* Null safety datastore (#649)

* chore: release 0.2.0-nullsafety.1 (#656)

* bug(datastore): HubEvent null check (#670)

* Fix HubEventElements for NS

* Refactor and add tests

* Null safety master rebase (#676)

* chore: pin Amplify iOS to '~> 1.9.2' (#589)

* set amplify ios to '~> 1.9'

* set amplify ios to '~> 1.9.2'

* add 'ObjectMapper' back to podspec

Co-authored-by: Ashish Nanda <[email protected]>

* chore: foundation for integration tests and basic auth suite with signIn and signOut (#568)

* feat(auth): add updateUserAttributes (batch) (#601)

* feat: add auth.updateUserAttributes

* Apply suggestions from code review

Co-authored-by: Chris F <[email protected]>

* address pr comments

* refactor android user attributes

* consolidate user attr logic on iOS

* refactor deliveryDetails serialization

* add missing newline

* revert missing attribute changes

* update serializeAuthUpdateAttributeResult for nil

* move comment to to of file

* bump amplify-android to 1.17.7

Co-authored-by: Chris F <[email protected]>

* chore(amplify_api): add httpStatusCode property to ApiException when available from REST response (#590)

Add integer property httpStatusCode to ApiException. In android and iOS, look for the status code in the response/error object and add to the serialized map. In flutter, add the new property to the serialization logic specifically for ApiException.

* fix(auth): Add clientMetadata to confirmSignUp API options (#619)

* Chore: remove check for duplicate error in Storage (#618)

* remove check for dup err cb

* bump amplify-android to version 1.17.8

* fix(auth): iOS/Android user attribute inconsistencies  (#620)

* feat: add auth.updateUserAttributes

* Apply suggestions from code review

Co-authored-by: Chris F <[email protected]>

* address pr comments

* refactor android user attributes

* consolidate user attr logic on iOS

* refactor deliveryDetails serialization

* add missing newline

* revert missing attribute changes

* update serializeAuthUpdateAttributeResult for nil

* move comment to to of file

* bump amplify-android to 1.17.7

* iOS: handle missing and custom attributes

* add constant for customKeyPrefix

Co-authored-by: Chris F <[email protected]>

* Add support of DataStore custom configuration (#610)

* refactor: Minor refactor of DataStore methods

* Free up `configure` method for native passthrough

* Move observe configuration into its own explicit method

* Corrected observe setup method in swift to call the invokeMethod callback so the call can be properly awaited upon in dart layer

* Broaden `configureDataStore` naming to convey more than model provider being able to be configured through this method

* Allow plugins to be added in parallel instead of in a series

* Update unit tests to correctly assert observe call result

* Remove setUpObserve API. Restore setUpObserve call to configure

* feat(datastore) Allow configure DataStore with custom configuration

* Reintroduce configureModelProvider as deprecated method

* chore(datastore) Add unit tests for custom DataStore configuration

* Update configure to not throw error if DataStore plugin is not found

* Split datastore configuration unit tests by use cases

Co-authored-by: Chris Fang <[email protected]>

* Use "flutter pub" in melos.yaml (and everywhere else) (#603)

* Use dart pub in melos.yaml

* Fix all references to 'pub _' with 'flutter pub _'

* Work around hanging build; don't install in postbootstrap

* fix(tests): add --no-pub to integration tests (#637)

* add --no-pub to integration tests

* fix typo

* fix: CONTRIBUTING Dead Links (#630)

* fix(amplify_auth_cognito): adds userAttributes to confirmSignIn (#607)

* chore: Add CircleCI badge (#631)

* chore: Add CircleCI badge

* fix: changed badge hyperlink

* fix: badage now points towards master branch

* Update README.md

Co-authored-by: Jordan Nelson <[email protected]>

Co-authored-by: Jordan Nelson <[email protected]>

* chore: upgrade amplify-android to 1.19.0 (#650)

* fix: amplify-ios version bump (#648)

* fix: amplify-ios version bump ~> 1.11.0 (#665)

* chore: release 0.1.6 (#667)

* fix: amplify-ios version bump ~> 1.11.0

* chore: release 0.1.6

* Update CHANGELOG.md

Co-authored-by: Noyes <[email protected]>

* Pagination with Datastore #500 (#673)

* Fix compile errors

* Fix broken unit tests

* Fix Android Unit Tests

* fix(amplify_datastore): force cast exception codegen

1) add new exception for force cast in codegen models

# Conflicts:
#	packages/amplify_datastore_plugin_interface/lib/src/publicTypes.dart

* Fix ios unit tests

This file was corrupted during the rebase

* Update codegen models to latest

* PR Comments

* Fix Android Unit Tests

* Last PR Comment

Co-authored-by: Jordan Nelson <[email protected]>
Co-authored-by: Ashish Nanda <[email protected]>
Co-authored-by: Travis Sheppard <[email protected]>
Co-authored-by: Chris F <[email protected]>
Co-authored-by: Hui Zhao <[email protected]>
Co-authored-by: Chris Fang <[email protected]>
Co-authored-by: A.J. Gardner <[email protected]>
Co-authored-by: Elijah Quartey <[email protected]>
Co-authored-by: Dustin Noyes <[email protected]>
Co-authored-by: Noyes <[email protected]>
Co-authored-by: Mo Malaka <[email protected]>

* fix(amplify_datstore): mprovider compile issue (#681)

* chore: remove deprecated method - configureModelProvider

* Revert "chore: remove deprecated method - configureModelProvider"

This reverts commit 00dbc7a.

* Revert "Revert "chore: remove deprecated method - configureModelProvider"" (#682)

remove deprecated method - configureModelProvider

Co-authored-by: Chris Fang <[email protected]>

* fix(Auth): Remove use of TypeToken (#683)

* remove use of type token from auth session

* remove TypeToken from exception util

* fix(auth): update user attribute serialization (#684)

* update user attr res serialization

* update unit tests

* Fix enum string function (#687)

* Fix enum string function

* Update logic

* Revert "Update logic"

This reverts commit 75d257a.

* fix(auth): uses nextStep helper for signInResult on Android (#689)

* chore: release 0.2.0 (#690)

* Revert "Merge branch 'master' into null-safety-master"

This reverts commit 5e7fd30, reversing
changes made to bf394bb.

* Update docs

* Add user attributes

* Update tests

* Revert minor change

* Merge branch 'master' into chore/user-attributes-ns

* Add export

Co-authored-by: Kyle <[email protected]>
Co-authored-by: Dustin Noyes <[email protected]>
Co-authored-by: Mo Malaka <[email protected]>
Co-authored-by: Leonardo Custodio <[email protected]>
Co-authored-by: Jordan Nelson <[email protected]>
Co-authored-by: Ashish Nanda <[email protected]>
Co-authored-by: Travis Sheppard <[email protected]>
Co-authored-by: Chris F <[email protected]>
Co-authored-by: Hui Zhao <[email protected]>
Co-authored-by: Chris Fang <[email protected]>
Co-authored-by: A.J. Gardner <[email protected]>
Co-authored-by: Elijah Quartey <[email protected]>
Co-authored-by: Noyes <[email protected]>

* docs: 📝 update of license & project's description

* feat(amplify_auth_cognito): add initial example app for the authenticator

* iOS & Android files

* feat(amplify_authenticator): screens implementation -Sign In, Sign Up & Confirm Sign Up

* dependecies & project's name updated

* chore(amplify_api): add GraphQL integration tests (#694)

* feat(amplify_authenticator): button disable for auth calls

* chore(CI): enable formatting in CI w/ code changes (#570)

* enable formatting in CI

* diable analyze

* split up format and analyze

* chore: melos run format

* chore: empty commit to re-run CI

* Fix: user not able to sign out

* closing brace

* test directory deleted

* fix: AuthFormField(type: 'password') is able to hide values

* feat: default & custom validators

* chore(auth): integration tests for user attributes (#640)

* handle missing or empty signUpOptions

* add android unit test

* fix iOS tests

* add integration tests for auth.signUp

* remove unused imports, formatting

* add integration tests for user attributes

* add integration tests

* update auth category after NS changes

* update auth category for NS changes

* update unit test for NS changes

* update unit tests for NS changes

* address PR comments

* remove extra parens

* Apply SignUpRequest changes from code review

* add test for invalid attr value

* add user attribute confirmation test

* add fetchUserAttributes group

* remove test for email confirmation

* chore(api): Add API response headers/status (#721)

* Add API response headers/status

* Clean up

* Ensure proper deserialization

* Fix ios tests

* remove unnecessary default

* Add iOS status/headers + tests

* Remove empty body fix

* Missing status code

* Add license comments

* Clean up iOS tests

* Add RestException tests

* Add deprecation warning

* Fix example encoding

* Add Flutter plugin tests

* Rename file

* refactor: signin, signup & confirm signup view models

* docs: initial documentation

* chore: keys in form fields and buttons

* chore: keys in form fields and buttons

* chore(amplify_datastore): make SubscriptionEvent directly available via datastore plugin by adding to publicTypes in interface (#728)

* fix(datastore): not serializing enum type in a predicate (#726)

* test: integration test setup

* feat: custom form field

* refactor: nullable auth variables in confirm sign up, sign in and sign up view models

* refactor: boilerplate from example app

* refactor: amplify_configure.dart deleted

* test: sign in screen integration testing

* doc: public members

* refactor: form field keys

* refactor: using types

* refactor: sign out method

* refactor: handle result from sign in / up calls

* chore(amplify_storage_s3): add storage integration tests and update example app (#734)

* chore(auth): add integration test coverage for auth (#724)

* chore(auth): add integ tests for auth hub

* chore(auth): add integ test for update password

* chore(auth): add integ test for sign up exceptions

* chore(auth): test exceptions in signIn, signOut

* chore(auth): add fetch session integration tests

* chore(auth): add integ tests for getCurrentUser

* chore: formatting in get_current_user

* chore: formatting in fetch_session

* chore: refactor setup for update password tests

* chore: update fetch session test to check for null

* fix typos in comments

* chore: address PR feedback

* chore: fix formatting issues

* test: sign in integration testing

* test: sign up integration testing

* refactor: enums in signup, signin and confirm_signup form fields

* feat: confirm sign in screen

* Update amplify_authenticator.dart

* refactor: late keyword removed

* refactor: getCurrentUser() method

* refactor: return type of currentUser method

* print() removed

* refactor: copy/paste error

* refactor: non-null types

* refactor: non-null type

* refactor: void Function()

* refactor: return null types in form field types

* refactor: null return type

* Update signin_types.dart

* refactor: null return type

* refactor: pr comments

* chore(datastore): add integration tests for datastore (#753)

* chore: add integration tests for datastore

* chore: address pr comments

* chore: configure datastore before each test

* chore: refactor save test

* chore: fix formatting

* chore: update name to configureDataStore

* test: confirm sign in integration test

* Release updates 0.2.1 (#756)

* chore: Update Changelog for 0.2.1 release

* chore: Update Pubspec version to 0.2.1

Also update amplify.dart to return 0.2.1 for version string

* Update changelog

* refactor: code removed

* chore: set min flutter version to '>1.20.0' in packages where set to … (#757)

* fix: unsed code

* fix

* feat: display exceptions widget

* feat(amplify_auth_cognito): enables clientMetadata for signUp (#713)

* Extra lines removed

* extra lines

* chore: extra lines

* fix(datastore): Query nested model causes column not found sql error (#761)

* Reformat source code

* fix(datastore): Query nested model causes column not found sql error

* Optimize method interface to clarify the purpose

* Optimize method interface

* Added relationship check ensure the field conversion happens only for BelongsTo

* bug(analytics): Force session start (#764)

* Force session start

* Add iOS no-op

* Update comment

* Mark internal method protected

* fix(analytics): Typo (#765)

* Force session start

* Add iOS no-op

* Update comment

* Mark internal method protected

* Fix iOS method name

* feat: username alias

This change will allow a customer to pass in an username alias to setup the initial auth flow of their apps

* feat: resend code button in confirm sign up screen |

Now the username is automatically setup in the username form field.

* feat(amplify_auth_cognito): Auth Devices API (#735)

* Add platform code

* Clean up

* Add licenses

* Fix error handling

* Add logging and update threading logic

* Add iOS unit tests

* Clean up

* Add tests to project

* Fix unit tests

* feat: rest password option enabled

screen to request the change of password with username

* feat: reset password screen

users can reset their password by setting up a new one and passing a confirmation code

* chore(datastore): Remove redundant files for the datastore example (#762)

* feat(datastore): Populate belongs-to nested models (#658)

* feat(datastore): Populate has-one and belongs-to nested models

* Nest data under serializedData key and persist modelName

* Resolve comment

* Update packages/amplify_datastore/example/ios/unit_tests/resources/SchemaData.swift

Co-authored-by: Chris F <[email protected]>

* feat: confirm sign in with new password screen

* fix(authenticator): SignInFormField pointing to the same instance |
form field in SendCodeScreen was pointing to the same instance in a form field in the SignInScreen

* fix: form field pointing to same instance

* refactor: update password

* refactor: keys

* chore(amplify_api): add support for apiName to GraphQL requests (#553)

* fix(amplify_api): prevent some fatal REST errors in Android

Throw ApiException in android when PUT, POST, and PATCH REST requests have no body to prevent fatal error (#661).

* refactor: branch conflicts

* fix: confirm password username attribute

* fix: second clause for non-Amplify exceptions

* refactor: clearException method for clearing all exceptions in the
exception controller.

* refactor: clearException method

* refactor: non null exception controller

* fix: throw error when signInStep == 'CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE'

* refactor: error objects

* feat: user is signed in after confirm sign up and when sign up respone is 'DONE'

* chore(release): 0.2.2 (#781)

* feat: confirm sign in auth flow

* refactor: show sign in screen after sign out

* refactor: const variable

* chore: unnecessary enum deleted

* refactor: non-null & final declaration

* chore: commented code removed

* refactor: VMs updated based on the triggered state

* refactor: resend code method

* refactor: validators in form fields

* fix: null value in a variable at confirm sign up VM

* refactor: authenticator container padding

* refactor: else clause in Authenticator Stream Builder

* refactor: username alias optional

* doc: finders in intergarion testion

* doc: finders

* doc: username alias doc

* refactor: inherited forms

* chore(release): missing dependency (#783)

* Bump analytics version

* Fix PR #

* Bump all versions

* Missing bump

* Pin collections

* fix: overflow in exception widget

* fix: validation in confirm sign up form fields.

* refactor: null check (!)  removed from inherited forms

* feat: loading state in sign out button if there's any exception.

* fix: overflow in buttons

* chore: commented code removed

* refactor: public methods in AuthBloc

* fix: unsued code

* chore: skip FlutterURLSessionTests (#795)

* chore(lints): Add amplify_lints package (#808)

* Add lints package

* Add missing readme item

* feat(auth): add options to resendSignUpCode (#738)

* feat(auth): add options to resendSignUpCode

* fix: add type export for sing up code options

* chore: fix formatting issues

* chore: update comments for consistency

* chore: rename private method names for consistency

* chore: update comments for consistency

* chore: make ResendSignUpCodeOptions abstract

* chore: update ResendSignUpCodeRequest serializeAsMap

* chore: update ios test

* chore update doc comments

* chore: bump amplify-android to 1.24.0

* chore: remove star import

* feat(auth): add support for options to resetPassword, confirmResetPassword (#743)

* chore: rename confirmPassword to confirmResetPassword

* chore: fix grammatical errors in docs

* feat(auth): add options support for resetPassword, confirmResetPassword

* chore: rename private methods for consistency

* chore: update comments for consistency

* chore: update ios tests

* chore: fix comments

* chore: handle deprecated methods

* separate out deprecated class

* chore: update serializeAsMap for consistency

* chore: properly deprecate confirmPassword

* chore: add deprecation annotation to interface

* chore: bump amplify-android to 1.24.0

* chore: apply suggestions from code review

* feat(auth): add options to updateAttribute, updateAttributes, resendUserAttributeConfirmationCode (#775)

* chore: move attribute types to new dir

* chore: rename fetch attribute classes

* feat: add client metadata to user attribute methods

* deprecate renamed types

* chore: update comments for consistency

* chore: rename methods, tests

* chore: break out depracted classes, make new classes abstract

* chore: revert star import

* chore: bump amplify-android to 1.24.0

* chore: apply suggestions from code review

* chore: remove empty line

* fix(amplify_auth_cognito): throws signedout exception (#730)

* fix(amplify_datastore): ios send modelProviderVersion (#439)

Co-authored-by: Hui Zhao <[email protected]>

* feat(datastore): Add start and stop APIs (#811)

* Convert file to LF mode

* feat(datastore): Add start and stop APIs

* Add docs

* Resolve comments

* chore(analytics): Apply lints (#810)

* Clean up pinpoint

* Clean up pinpoint dart

* Enable CI for analytics

* Add iOS linting

* Clean up

* Update iOS script

* Fix Android melos script

* Update CI order

* Small changes

* Update type

* Add iOS whitespace rules

* Update type

* Apply updated rules

* feat(auth): OIDC/Lambda Support (#777)

* OIDC/Lambda support

* Clean up

* Fix iOS test

* Add unit tests

* Fix Android test

* Fix Android tests

* Refactor and remove AuthToken from the public API

* Remove concurrent guards

* Clean up

* chore: upgrade amplify-android 1.24.1 (#829)

* fix(datastore): cannot saving boolean as integer in SQLite (#754)

* fix(datastore): cannot saving boolean as integer in SQLite

* fix unit test

* Apply the fix to double type field as well

* fix(datastore): return null for list field in nested model (#843)

* fix(datastore): Better loggin on unhandled DataStoreHubEvent (#647)

* fix(datastore): Better loggin on unhandled DataStoreHubEvent

* Print unrecognized event details in iOS

* Resolve comments

* chore(api): Apply lints (#812)

* Clean up pinpoint

* Clean up pinpoint dart

* Update iOS script

* Update CI order

* Add Dart lints to API

* Apply Android/iOS lints to API

* Rename uuid

* Small changes

* Fix scripts

* Clean up

* Fix unit tests

* Continue impl

* Fix android unit tests

* Remove duplicate lint check

* Fix analytics app

* Adjust java options

* Bump java RAM

* Remove concurrency

* Disable gradle daemon

* Update gradle properties

* Update gradle config

* Revert "Update gradle config"

This reverts commit a43ad29.

* Revert gradle changes

* Disable gradle daemon

* Add kotlin style flags

* Disable gradle daemon

* Bump JVM memory

* Change daemon setting

* Adjust JVM memory

* Lint debug only

* Fix API tests

* Bump deps and fix coverage script

* Fix Gradle version

* Revert unnecessary changes

* Update melos postclean files

* Enable fatal infos

* Fix analyze scope

* Fix postbootstrap

* Fix missing sample app

* Fix order in CI

* Revert add sample app

* Revert order change

* Revert license date

* Revert "Revert license date"

This reverts commit 1b93b3f.

* test(DataStore): add local integration tests for datastore (#831)

* chore: add new model types for tests

* test: add tests for model types

* chore: update models for relationship tests

* test: add tests for hasOne, belongsTo

* chore: update models for hasMany tests

* test: add tests for hasMany relationship

* test: add query predicate test for string type

* test: add test for updating an existing model

* chore: skip flaky test on Android

* chore: clean up string predicate tests

* test: add integ tests for int/double query predicates

* chore: remove unused model

* chore: update tests after fix of #511

* chore: refactor model type tests

* chore: add provisioning script

* chore: update relationship tests

* chore: remove skipped test in save

* chore: add delay before clearing datastore

* test: add bool query predicate tests

* chore: update issue link for skipped test

* chore: update test w/ fix of #834

* Apply suggestions from code review

Co-authored-by: Chris F <[email protected]>

* Update packages/amplify_datastore/example/integration_test/model_type_test.dart

Co-authored-by: Chris F <[email protected]>

* Update packages/amplify_datastore/example/integration_test/model_type_test.dart

* chore: update testQueryPredicate for all models

* chore: update comment in bool query tests

* test: add test cases for unicode

* chore: update bool model generation

* chore: update testModelOperations to use getModelType

* test: add edge cases for model type tests

* chore: remove unneeded Map.from

* test: add edge cases to query predicate tests

* chore: update int/double predicate tests to use <>=

* chore: remove unneeded configure calls

* chore: update string between() test

* chore: update relationship tests to check for single model

* test: update observe tests to test all events

* chore: add notes to equality checks

* chore: remove const from test

* chore: remove hard coded length

Co-authored-by: Chris F <[email protected]>

* fix(api): OIDC/Lambda Fixes (#862)

* Clean up pinpoint

* Clean up pinpoint dart

* Update iOS script

* Update CI order

* Add Dart lints to API

* Apply Android/iOS lints to API

* Rename uuid

* Small changes

* Fix scripts

* Clean up

* Fix unit tests

* Continue impl

* Fix android unit tests

* Remove duplicate lint check

* Fix analytics app

* Adjust java options

* Bump java RAM

* Remove concurrency

* Disable gradle daemon

* Update gradle properties

* Update gradle config

* Revert "Update gradle config"

This reverts commit a43ad29.

* Revert gradle changes

* Disable gradle daemon

* Add kotlin style flags

* Disable gradle daemon

* Bump JVM memory

* Change daemon setting

* Adjust JVM memory

* Lint debug only

* Fix API tests

* Bump deps and fix coverage script

* Fix Gradle version

* Revert unnecessary changes

* Update melos postclean files

* Enable fatal infos

* Fix analyze scope

* Fix postbootstrap

* Fix missing sample app

* Fix order in CI

* Revert add sample app

* Revert order change

* Merge branch 'datastore/multiauth' into chore/api-lints

* Revert multiauth

* Fix updateTokens

* Fix GraphQL error decoding

* Fix formatting

* Clean up

* Clean up

* Clean up

* Fix analysis for Flutter 2.5.0

* break(amplify_auth_cognito): fixes getCurrentUser disparity (#773)

* fix(amplify_datastore): iOS json deserialization (#806)

iOS ONLY fix.  Android was unaffected.

Ensure nested model int types are returned as int instead of double

Consolidate duplicated code for extracting values from Json during serialization step

* chore(release): 0.2.3 (#866)

* fix(example) updates amplify dependencies (#867)

* test(DataStore): add additional local integration tests for datastore (#844)

* Revert "Merge branch 'release-candidate' into main" (#871)

This reverts commit a88a109, reversing
changes made to 324ebad.

* fix: Cocoapods relative import (#874)

* Fix Cocoapods relative import

* Update dependencies

* Add lints license

* Update amplify_flutter

* 0.2.4

* fix(example): Update dependencies (#875)

* Update example app

* Add example app to CI

* Update iOS settings

* chore: Enable release checks via unpub (#876)

* Add unpub step to CI builds

* Fix CI config

* Fix CI script

* Add yq

* Fix brew

* Add yq on Android

* Add new workflows

* Fix yml

* Fix yml

* Fix yml

* Fix curl cmd

* Fix docker compose check

* Fix yml

* Fix yml

* Update path search

* Fix melos setup

* Fix yq script

* Switch executor flow

* Fix

* Try again

* Try again

* Try again

* Try again

* Try again

* Try again

* Try again

* Try again

* Try again

* Try again

* Update launcher

* Fix ref

* Test

* Fix versions

* Fix example version

* Fix remote build

* Fix dev dependency versioning

* Fix script order

* Use local project for seeding deps

* Add dummy configs back

* Reenable full pipeline

* Fix melos command

* Update step name

* Merge main

* fix: Melos bootstrap should not fail (#887)

* Fix postbootstrap

* Fix example app

* Replace JCenter with Maven Central (#903)

* Replace JCenter with Maven Central

* Make uniform

* Revert core

* fix(datastore): remove default pagination behavior on iOS (#906)

* fix: remove default pagination on ios

* chore: update test to use models.length

* chore: remove sort order from test

* test: update datastore unit test

* chore: move var declaration inside if block

* feat(Auth) support preferPrivateSession flag (#897)

* support preferPrivateSession flag

* fix flutter format

* fix unit test

* create and use SignInWithWebUIOptions

* update styles and doc

* remove unused code

Co-authored-by: Mo Malaka <[email protected]>

* feat(auth): add global sign out (#782)

* feat: add global sign out

* chore: rmove unused code

* chore: Update android unit tests

* chore: update iOS unit tests

* chore: add unit tests for global sign out

* chore: fix formatting

* chore: update amplify-android to 1.26.0

* chore: update SignOutRequest comment

* chore: refactor FlutterSignOutRequest

* chore: update integration test commands to allow selection (#910)

* chore: update integ test commands with selection

* chore: update description

* chore: Revert unpub (#919)

* Add unpub iOS checks

* Fix port

* Add logs

* Run server in background

* Make script foreground

* Add wait before pub get

* Remove sleep

* Update URL

* Remove from CI

* Remove unpub stuff

* Linting + reorg

* Rename

* Clean up

* Improve customizability

* Integrate Jordan's changes

* Clean up

* Clean up

* Clean up

* Revert attribute changes

* Fix API auth for REST (#925)

* Clean up

* Clean up

* Remove print

* Update authenticator config

* Add generated package to melos ignore

* Fix amplify_flutter test

* Fix validators

Co-authored-by: Travis Sheppard <[email protected]>
Co-authored-by: Israel Arcos <[email protected]>
Co-authored-by: Kyle <[email protected]>
Co-authored-by: Dustin Noyes <[email protected]>
Co-authored-by: Mo Malaka <[email protected]>
Co-authored-by: Leonardo Custodio <[email protected]>
Co-authored-by: Jordan Nelson <[email protected]>
Co-authored-by: Ashish Nanda <[email protected]>
Co-authored-by: Chris F <[email protected]>
Co-authored-by: Hui Zhao <[email protected]>
Co-authored-by: Chris Fang <[email protected]>
Co-authored-by: A.J. Gardner <[email protected]>
Co-authored-by: Elijah Quartey <[email protected]>
Co-authored-by: Noyes <[email protected]>
Co-authored-by: israx <[email protected]>
Co-authored-by: José Sánchez <[email protected]>
Co-authored-by: Su Tran <[email protected]>
  • Loading branch information
18 people authored Oct 5, 2021
1 parent 8e322fb commit 203fb22
Show file tree
Hide file tree
Showing 99 changed files with 5,310 additions and 4,732 deletions.
4 changes: 4 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ packages:
- example/*
- packages/**/example/*

# Generated output of flutter_localizations
ignore:
- synthetic_package

scripts:
setup_tuneup: >
flutter pub global activate tuneup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/// [here](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html).
abstract class CognitoUserAttributes {
static const address = 'address';
static const birthdate = 'birthdate';
static const email = 'email';
static const familyName = 'family_name';
static const gender = 'gender';
Expand Down
20 changes: 7 additions & 13 deletions packages/amplify_authenticator/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
analyzer:
strong-mode:
implicit-dynamic: false
include: package:amplify_lints/flutter_lib.yaml

linter:
rules:
- avoid_print
- exhaustive_cases
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_final_fields
- unawaited_futures
analyzer:
errors:
# TODO: Renable when logging library is finished
avoid_print: ignore
public_member_api_docs: ignore
implementation_imports: ignore
6 changes: 4 additions & 2 deletions packages/amplify_authenticator/example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ app.*.map.json
/android/app/profile
/android/app/release

#amplify
#amplify-do-not-edit-begin
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
Expand All @@ -63,4 +63,6 @@ amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
.secret-*
**.sample
#amplify-do-not-edit-end
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:amplify_lints/flutter_app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@
* permissions and limitations under the License.
*/

import 'package:amplify_authenticator/src/state/inherited_auth_bloc.dart';
import 'package:amplify_authenticator/src/blocs/auth/auth_bloc.dart';

import 'package:amplify_authenticator/src/models/authenticator_exceptions.dart';

import 'package:amplify_authenticator/src/models/authenticator_exception.dart';
import 'package:amplify_authenticator/src/state/inherited_auth_bloc.dart';
import 'package:amplify_authenticator_example/main.dart' as app;
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'finders/signIn_finder.dart';

import 'finders/confirm_signin_finder.dart';
import 'finders/signIn_finder.dart';
import 'finders/widgets_finder.dart';

import 'package:amplify_authenticator_example/main.dart' as app;

import 'utils/mock_data.dart';

void main() {
Expand All @@ -34,16 +31,11 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
setUpAll(() async {});

testWidgets("sign and in and back to sign in", (WidgetTester tester) async {
testWidgets('sign and in and back to sign in', (WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();

late InheritedAuthBloc authBloc;
try {
authBloc = await tester.widget(inheritedAuthBlocFinder);
} catch (e) {
fail('Error finding auth bloc: $e');
}
final InheritedAuthBloc authBloc = tester.widget(inheritedAuthBlocFinder);

//Signing In

Expand All @@ -54,7 +46,7 @@ void main() {
await tester.pumpAndSettle();

await tester.tap(signInButtonFinder);
final subscription = await authBloc.authBloc.stream;
final subscription = authBloc.authBloc.stream;
final stateAuthFlowConfirmSignIn = await subscription.first;

expect(stateAuthFlowConfirmSignIn, isA<AuthFlow>());
Expand All @@ -74,18 +66,13 @@ void main() {
await tester.pumpAndSettle();
});

testWidgets("sign and confirm sign in with a wrong code",
testWidgets('sign and confirm sign in with a wrong code',
(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();

late InheritedAuthBloc authBloc;
try {
authBloc = await tester.widget(inheritedAuthBlocFinder);
} catch (e) {
fail('Error finding auth bloc: $e');
}
final subscription = await authBloc.authBloc.stream;
final InheritedAuthBloc authBloc = tester.widget(inheritedAuthBlocFinder);
final subscription = authBloc.authBloc.stream;
//Signing In

await tester.enterText(usernameSignInFormFieldFinder, 'amplify-user-00');
Expand All @@ -109,7 +96,7 @@ void main() {

await tester.tap(confirmSignInButtonFinder);

final subscriptionException = await authBloc.authBloc.exceptions;
final subscriptionException = authBloc.authBloc.exceptions;
final authenticatorException = await subscriptionException.first;

expect(authenticatorException, isA<AuthenticatorException>());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:amplify_authenticator/src/keys.dart';
import 'package:flutter_test/flutter_test.dart';

/// Find specific widgets in the widget tree based on their keys
final codeConfirmSignInFormFieldFinder =
find.byKey(const Key(keyCodeConfirmSignInFormfield));
find.byKey(keyCodeConfirmSignInFormfield);

final backToSignInButtonFinder = find.byKey(const Key(keyBackToSignInButton));
final backToSignInButtonFinder = find.byKey(keyBackToSignInButton);

final confirmSignInButtonFinder = find.byKey(const Key(keyConfirmSignInButton));
final confirmSignInButtonFinder = find.byKey(keyConfirmSignInButton);
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:amplify_authenticator/src/keys.dart';
import 'package:flutter_test/flutter_test.dart';

/// Find specific widgets in the widget tree based on their keys
final usernameConfirmSignUpFormFieldFinder =
find.byKey(const Key(keyUsernameConfirmSignUpFormfield));
find.byKey(keyUsernameConfirmSignUpFormfield);
final codeConfirmSignUpFormFieldFinder =
find.byKey(const Key(keyCodeConfirmSignUpFormfield));
final backToSignInButtonFinder = find.byKey(const Key(keyBackToSignInButton));
find.byKey(keyCodeConfirmSignUpFormfield);
final backToSignInButtonFinder = find.byKey(keyBackToSignInButton);
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:amplify_authenticator/src/keys.dart';
import 'package:flutter_test/flutter_test.dart';

/// Find specific widgets in the widget tree based on their keys
final usernameSignInFormFieldFinder =
find.byKey(const Key(keyUsernameSignInFormField));
final emailSignInFormFieldFinder =
find.byKey(const Key(keyEmailSignInFormField));
final usernameSignInFormFieldFinder = find.byKey(keyUsernameSignInFormField);
final emailSignInFormFieldFinder = find.byKey(keyEmailSignInFormField);
final phoneNumberSignInFormFieldFinder =
find.byKey(const Key(keyPhoneNumberSignInFormField));
final passwordSignInFormFieldFinder =
find.byKey(const Key(keyPasswordSignInFormField));
final signInButtonFinder = find.byKey(const Key(keySignInButton));
final signOutButtonFinder = find.byKey(const Key(keySignOutButton));
find.byKey(keyPhoneNumberSignInFormField);
final passwordSignInFormFieldFinder = find.byKey(keyPasswordSignInFormField);
final signInButtonFinder = find.byKey(keySignInButton);
final signOutButtonFinder = find.byKey(keySignOutButton);
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:amplify_authenticator/src/keys.dart';
import 'package:flutter_test/flutter_test.dart';

/// Find specific widgets in the widget tree based on their keys
final usernameSignUpFormFieldFinder =
find.byKey(const Key(keyUsernameSignUpFormField));
final emailSignUpFormFieldFinder =
find.byKey(const Key(keyEmailSignUpFormField));
final usernameSignUpFormFieldFinder = find.byKey(keyUsernameSignUpFormField);
final emailSignUpFormFieldFinder = find.byKey(keyEmailSignUpFormField);
final phoneNumberSignUpFormFieldFinder =
find.byKey(const Key(keyPhoneNumberSignUpFormField));
final passwordSignUpFormFieldFinder =
find.byKey(const Key(keyPasswordSignUpFormField));
final signUpButtonFinder = find.byKey(const Key(keySignUpButton));
final gotToSignUpButtonFinder = find.byKey(const Key(keyGoToSignUpButton));
find.byKey(keyPhoneNumberSignUpFormField);
final passwordSignUpFormFieldFinder = find.byKey(keyPasswordSignUpFormField);
final signUpButtonFinder = find.byKey(keySignUpButton);
final gotToSignUpButtonFinder = find.byKey(keyGoToSignUpButton);
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:amplify_authenticator/src/keys.dart';
import 'package:flutter_test/flutter_test.dart';

/// Find specific widgets in the widget tree based on their keys
final inheritedAuthViewModelFinder =
find.byKey(const Key(keyInheritedAuthViewModel));
final inheritedAuthBlocFinder = find.byKey(const Key(keyInheritedAuthBloc));
final inheritedAuthViewModelFinder = find.byKey(keyInheritedAuthViewModel);
final inheritedAuthBlocFinder = find.byKey(keyInheritedAuthBloc);
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,28 @@
* permissions and limitations under the License.
*/

import 'package:amplify_authenticator/src/state/inherited_auth_bloc.dart';
import 'package:amplify_authenticator/src/blocs/auth/auth_bloc.dart';
import 'package:amplify_authenticator/src/models/authenticator_exceptions.dart';

import 'package:amplify_authenticator/src/models/authenticator_exception.dart';
import 'package:amplify_authenticator/src/state/inherited_auth_bloc.dart';
import 'package:amplify_authenticator_example/main.dart' as app;
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

import 'finders/signIn_finder.dart';
import 'finders/widgets_finder.dart';

import 'package:amplify_authenticator_example/main.dart' as app;

import 'utils/mock_data.dart';

void main() {
group('Sign In and Sign Out', () {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
setUpAll(() async {});

testWidgets("Signing in and out a confirmed user",
testWidgets('Signing in and out a confirmed user',
(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();

late InheritedAuthBloc authBloc;
try {
authBloc = await tester.widget(inheritedAuthBlocFinder);
} catch (e) {
fail('Error finding auth bloc: $e');
}
final InheritedAuthBloc authBloc = tester.widget(inheritedAuthBlocFinder);

await tester.enterText(usernameSignInFormFieldFinder, 'amplify-user-01');
await Future<void>.delayed(const Duration(seconds: 2));
Expand All @@ -52,7 +45,7 @@ void main() {
//Signing In

await tester.tap(signInButtonFinder);
final subscription = await authBloc.authBloc.stream;
final subscription = authBloc.authBloc.stream;
final stateAuthenticated = await subscription.first;

expect(stateAuthenticated, isA<Authenticated>());
Expand All @@ -68,19 +61,14 @@ void main() {
await tester.pumpAndSettle();
});

testWidgets("Signing in an unregistered user",
testWidgets('Signing in an unregistered user',
(WidgetTester tester) async {
final username = generateUsername();
final password = generatePassword();
app.main();
await tester.pumpAndSettle();

late InheritedAuthBloc authBloc;
try {
authBloc = await tester.widget(inheritedAuthBlocFinder);
} catch (e) {
fail('Error finding auth bloc: $e');
}
final InheritedAuthBloc authBloc = tester.widget(inheritedAuthBlocFinder);

await tester.enterText(usernameSignInFormFieldFinder, username);
await Future<void>.delayed(const Duration(seconds: 2));
Expand All @@ -90,7 +78,7 @@ void main() {

await tester.tap(signInButtonFinder);

final subscription = await authBloc.authBloc.exceptions;
final subscription = authBloc.authBloc.exceptions;
final authenticatorException = await subscription.first;

expect(authenticatorException, isA<AuthenticatorException>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
import 'package:amplify_authenticator/src/state/inherited_auth_bloc.dart';
import 'package:amplify_authenticator/src/blocs/auth/auth_bloc.dart';
import 'package:amplify_authenticator/src/models/authenticator_exceptions.dart';

import 'finders/signup_finder.dart';
import 'finders/widgets_finder.dart';
import 'finders/confirm_signup_finder.dart';

import 'package:amplify_authenticator/src/blocs/auth/auth_bloc.dart';
import 'package:amplify_authenticator/src/models/authenticator_exception.dart';
import 'package:amplify_authenticator/src/state/inherited_auth_bloc.dart';
import 'package:amplify_authenticator_example/main.dart' as app;
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

import 'finders/confirm_signup_finder.dart';
import 'finders/signup_finder.dart';
import 'finders/widgets_finder.dart';
import 'utils/mock_data.dart';
import 'package:amplify_authenticator_example/main.dart' as app;

//This tests asumes a default amplify configuration where
//username is neither a email or phone number but username.
Expand All @@ -33,17 +32,12 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
setUpAll(() async {});

testWidgets("Creates an account", (WidgetTester tester) async {
testWidgets('Creates an account', (WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();

late InheritedAuthBloc authBloc;
try {
authBloc = await tester.widget(inheritedAuthBlocFinder);
} catch (e) {
fail('Error finding auth bloc: $e');
}
final subscription = await authBloc.authBloc.stream;
final InheritedAuthBloc authBloc = tester.widget(inheritedAuthBlocFinder);
final subscription = authBloc.authBloc.stream;

//Going to sign up screen
await Future<void>.delayed(const Duration(seconds: 2));
Expand Down Expand Up @@ -92,18 +86,13 @@ void main() {
await tester.pumpAndSettle();
});

testWidgets("Creates an account with an existent username",
testWidgets('Creates an account with an existent username',
(WidgetTester tester) async {
app.main();
await tester.pumpAndSettle();

late InheritedAuthBloc authBloc;
try {
authBloc = await tester.widget(inheritedAuthBlocFinder);
} catch (e) {
fail('Error finding auth bloc: $e');
}
final subscriptionStream = await authBloc.authBloc.stream;
final InheritedAuthBloc authBloc = tester.widget(inheritedAuthBlocFinder);
final subscriptionStream = authBloc.authBloc.stream;

//Going to sign up screen
await Future<void>.delayed(const Duration(seconds: 2));
Expand All @@ -128,7 +117,7 @@ void main() {

await tester.tap(signUpButtonFinder);

final subscriptionException = await authBloc.authBloc.exceptions;
final subscriptionException = authBloc.authBloc.exceptions;
final authenticatorException = await subscriptionException.first;
expect(authenticatorException, isA<AuthenticatorException>());

Expand Down
Loading

0 comments on commit 203fb22

Please sign in to comment.