Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(amplify_auth_cognito): signIn, confirmSignIn, confirmSignUp and signOut #10

Closed
wants to merge 81 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2064ba8
Initial Commit for Amplify-Flutter
Jun 24, 2020
98a78d8
updating readmes
Jun 24, 2020
ec7eda5
removing gson dependency
Jun 24, 2020
1d5148e
removing boilerplate comments
Jun 24, 2020
7136223
removing interface tests
Jun 24, 2020
6232c08
created amplify_auth package
Jun 24, 2020
985f622
changed platform_interface to plugin_interface
Jun 24, 2020
99fb0f9
Merge branch 'amplify_core' into amplify_auth
Jun 24, 2020
7c4a8f6
fixed interface file name
Jun 24, 2020
ba4289f
added dependencies for auth android
Jun 24, 2020
0f38020
added compile options
Jun 24, 2020
e197d5c
Merge branch 'amplify_core' into amplify_auth
Jun 25, 2020
14549f5
attempting code coverage
Jun 25, 2020
ed26e4c
removed .jar and .iml and updated gitignore
Jun 25, 2020
6e5cd96
updated podpsec with team information; consolidated 2 lines of swift;…
Jun 25, 2020
526fc45
simplifying class name
Jun 26, 2020
85560ee
Merge branch 'amplify_core' into amplify_auth
Jun 26, 2020
376cfc1
added signIn method to dart
Jun 27, 2020
cc7323b
changed package name
Jun 27, 2020
d0d9cc9
Merge branch 'amplify_core' into amplify_auth
Jun 27, 2020
1f2abff
changed directory to match packages
Jun 27, 2020
1d919e6
renamed director to match update package name
Jun 27, 2020
6c4b028
type info
Jun 29, 2020
8c6a232
shortened class names
Jun 29, 2020
583640d
signup for ios
Jul 5, 2020
471d552
ios signup types
Jul 6, 2020
440fa5c
return types cast to simple maps
Jul 7, 2020
2d2ee01
split out provider level types from plugin level types
Jul 8, 2020
7ab6d3d
organzied types and fixed bugs
Jul 9, 2020
d026ad7
renamed plugin with _cognito appended
Jul 9, 2020
97e3704
fixed error handling
Jul 9, 2020
0f9386f
removing podfile.lock
Jul 9, 2020
4a7e71d
removed auth example Podfile.lock, and updated gitignore to exclude same
Jul 9, 2020
ae8c6f3
Merge branch 'master' into amplify_auth
haverchuck Jul 9, 2020
19ec042
began adding tests and cleaning up types
Jul 10, 2020
6b8f704
Merge branch 'amplify_auth' of github.com:haverchuck/amplify-flutter …
Jul 10, 2020
c2f538b
fixed done case for signup state
Jul 11, 2020
8b94c1b
added callback functionality to signUp
Jul 13, 2020
dcce7c1
additinal callback handling and tests
Jul 13, 2020
a2d7385
removed provider data from interfaces signup type
Jul 13, 2020
fc5abe2
improved auth sample app
Jul 13, 2020
dc80f46
initial confirmSignUp commit
Jul 14, 2020
a3a4ba8
fixing android type
Jul 14, 2020
a3abd24
removed circular dependency
Jul 14, 2020
7df3c84
types reorganized; confirmSignUp working
Jul 14, 2020
ed467ca
rolling back confirmSignUp code
Jul 14, 2020
758b2d3
signIn
Jul 16, 2020
9421e6c
encapsulated types and added error enums
Jul 17, 2020
33862d1
removed most class extensions
Jul 17, 2020
bcd6b2a
simplifying types
Jul 17, 2020
a0fc0cc
delete unneeded classes
Jul 17, 2020
5c056c7
created return type for swift signUp
Jul 21, 2020
e037a0a
updating classes for signIn, confirmSignUp
Jul 21, 2020
0bb1436
added request class for signup
Jul 21, 2020
30bb3fc
removed unneeded method
Jul 21, 2020
9cc62b1
minor fix
Jul 21, 2020
d698d79
working on signIn
Jul 22, 2020
a7bcf95
fixing codeDeliveryDetails for ios signup
Jul 22, 2020
315912f
signOut done
Jul 23, 2020
c3839a9
confirmSignIn
Jul 24, 2020
3d60118
removing build files
Jul 24, 2020
3d3fde3
PR suggestions
Jul 27, 2020
0c9db87
unit tests
Jul 27, 2020
8036aaa
Merge branch 'master' into amplify_auth
haverchuck Jul 27, 2020
47c38c6
conforming to interface of other amplify libs
Jul 28, 2020
57e1cc6
Merge branch 'amplify_auth' of github.com:haverchuck/amplify-flutter …
Jul 28, 2020
ce1761d
merging analytics
Jul 28, 2020
4515c59
confirming auth methods to team interfaces
Jul 28, 2020
cb191a4
updated core to allow named list of plugins, but will only allow one …
Jul 28, 2020
602675f
merging latest
Jul 28, 2020
f536692
multiplugin warning
Jul 28, 2020
8d37fcc
fixing test
Jul 28, 2020
a933b89
code review comments from signup
Jul 29, 2020
b8f81f3
unifying method results
Jul 29, 2020
bc4384e
removed provider idea
Jul 30, 2020
4c78e8a
fixing enum issue
Jul 31, 2020
af812f7
final signup
Jul 31, 2020
0a9f8f0
signIn, confirmSignIn, confirmSignUp, signOut
Jul 31, 2020
c5306be
unit test skeletons
Aug 3, 2020
ebcb24d
error mapping
Aug 3, 2020
dc8e7cf
ios bug
Aug 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
.dart_tool/
.DS_Store
build/
ios/.generated/
**/ios/.generated/
**/android/.settings/
pubspec.lock
Podfile.lock
*.iml
*.jar
Podfile.lock


# IDEs
.idea/
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify_analytics_pinpoint/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class _MyAppState extends State<MyApp> {

// Configure analytics plugin
AmplifyAnalyticsPinpointPlugin analyticsPlugin = new AmplifyAnalyticsPinpointPlugin();
amplifyInstance.addPlugin(analyticsPlugin);
amplifyInstance.addPlugin(analyticsPlugin: [analyticsPlugin]);

var isConfigured = await amplifyInstance.configure(amplifyconfig);
try {
Expand Down
7 changes: 7 additions & 0 deletions packages/amplify_auth_cognito/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
.dart_tool/

.packages
.pub/

build/
10 changes: 10 additions & 0 deletions packages/amplify_auth_cognito/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 599566177736e6b30af922a8f06e8a260acafc36
channel: master

project_type: plugin
3 changes: 3 additions & 0 deletions packages/amplify_auth_cognito/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
175 changes: 175 additions & 0 deletions packages/amplify_auth_cognito/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
3 changes: 3 additions & 0 deletions packages/amplify_auth_cognito/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# amplify_auth_cognito

The Amazon Cognito plugin for Amplify-Flutter
6 changes: 6 additions & 0 deletions packages/amplify_auth_cognito/android/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
8 changes: 8 additions & 0 deletions packages/amplify_auth_cognito/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
23 changes: 23 additions & 0 deletions packages/amplify_auth_cognito/android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>amplify_auth_cognito</name>
<comment>Project android___ created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.3))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Users/dnnoyes/.sdkman/candidates/java/current
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
53 changes: 53 additions & 0 deletions packages/amplify_auth_cognito/android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
group 'com.amazonaws.amplify.amplify_auth_cognito'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

rootProject.allprojects {
repositories {
google()
jcenter()
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 16
}
lintOptions {
disable 'InvalidPackage'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.amplifyframework:aws-auth-cognito:1.0.+'
testImplementation 'junit:junit:4.13'
testImplementation 'org.mockito:mockito-core:3.1.0'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'org.robolectric:robolectric:4.3.1'
}
4 changes: 4 additions & 0 deletions packages/amplify_auth_cognito/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
1 change: 1 addition & 0 deletions packages/amplify_auth_cognito/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'amplify_auth_cognito'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws.amplify.amplify_auth_cognito">
</manifest>