Skip to content

Commit

Permalink
Merge pull request #2077 from aws-amplify/2.18.0
Browse files Browse the repository at this point in the history
Release 2.18.0
  • Loading branch information
richardmcclellan authored Aug 18, 2020
2 parents 4105cd5 + 171119b commit a131321
Show file tree
Hide file tree
Showing 65 changed files with 415 additions and 230 deletions.
30 changes: 15 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
resource_class: xlarge
environment:
JVM_OPTS: -Xmx8192m
Expand All @@ -319,7 +319,7 @@ jobs:
unittest:
working_directory: ~/code
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
resource_class: xlarge
environment:
JVM_OPTS: -Xmx8192m
Expand Down Expand Up @@ -369,7 +369,7 @@ jobs:
release_javadoc:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
resource_class: xlarge
environment:
JVM_OPTS: -Xmx8192m
Expand Down Expand Up @@ -510,7 +510,7 @@ jobs:

release_s3:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down Expand Up @@ -576,7 +576,7 @@ jobs:
pre_integrationtest:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down Expand Up @@ -611,7 +611,7 @@ jobs:
post_integrationtest:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down Expand Up @@ -696,7 +696,7 @@ jobs:
bump_sampleapp_version:
working_directory: ~/code
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
resource_class: xlarge
environment:
JVM_OPTS: -Xmx8192m
Expand Down Expand Up @@ -730,7 +730,7 @@ jobs:
bump_applifydocs_version:
working_directory: ~/code
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
resource_class: xlarge
environment:
JVM_OPTS: -Xmx8192m
Expand Down Expand Up @@ -762,7 +762,7 @@ jobs:
- bump_version_post
bump_sdk_version:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down Expand Up @@ -826,7 +826,7 @@ jobs:

merge_to_main:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down Expand Up @@ -869,7 +869,7 @@ jobs:
prepare_release_sdk:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down Expand Up @@ -898,7 +898,7 @@ jobs:
create_pullrequest_for_modelupdate:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand All @@ -915,7 +915,7 @@ jobs:
check_sdk_on_maven:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down Expand Up @@ -943,7 +943,7 @@ jobs:
run_integrationtest_on_devicefarm:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down Expand Up @@ -1008,7 +1008,7 @@ jobs:
"https://circleci.com/api/v1.1/project/github/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/envvar?circle-token=${CIRCLE_API_USER_TOKEN}"
check_testresult_on_devicefarm:
docker:
- image: circleci/android:api-29
- image: circleci/android@sha256:2d4ef38bcef095335302e83a7b20e6f24087ed01594a7c232b114599b5271dc9
environment:
JVM_OPTS: -Xmx1024m
steps:
Expand Down
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Change Log - AWS SDK for Android

## [Release 2.18.0](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.18.0)

*Version 2.18.0 introduces breaking changes against 2.17.1.*

### Breaking Updates
- aws-android-sdk-mobile-client:
- No breaking changes code-wise but if you already setup HostedUI for an older version of the SDK,
you'll need to follow the steps in the [updated documentation](https://docs.amplify.aws/sdk/auth/hosted-ui/q/platform/android#setup-amazon-cognito-hosted-ui-in-android-app)
to properly handle the response going forward.
- aws-android-sdk-cognitoauth:
- `getSession()` method has been refactored to `getSession(Activity activity)`, where `activity` is an instance of
the activity the user is calling this method from. It uses this to launch HostedUI if it needs to sign in again.
- `getSession(boolean launchWebUIIfExpired)` has been refactored to `getSessionWithoutWebUI()`. It will get session
information if the refresh token is still valid, otherwise will throw an exception indicating the user must sign in
again.

### Bug Fixes
- aws-android-sdk-mobile-client:
- `getTokens()` was making a network call every time it was used, negating any benefit of cached tokens. Removed
the unnecessary network call so it now correctly returns cached tokens when available with no network call (Issue #1722)

## [Release 2.17.1](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.17.1)

### Bug fixes
Expand All @@ -23,7 +44,6 @@

- Allow override of User Agent in the AWSMobileClient


## [Release 2.17.0](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.17.0)

*Version 2.17.0 introduces breaking changes against 2.16.13.*
Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-apigateway-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-apigateway-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
defaultConfig {
minSdkVersion 14 // junit ext
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
}
Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-auth-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-auth-facebook/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14 // v4 support, brought from facebook sdk
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-auth-google/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14 // gms auth brought by google sdk
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-auth-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14 // appcompat
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-auth-userpools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14 // setAllCaps(), 11 otherwise
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-cloudwatch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions aws-android-sdk-cognito/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fabric-identifier=com.amazonaws.aws-android-sdk-cognito
fabric-version=2.17.1
fabric-version=2.18.0
fabric-build-type=binary
8 changes: 6 additions & 2 deletions aws-android-sdk-cognitoauth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ android {
defaultConfig {
minSdkVersion 16 // androidx.browser
targetSdkVersion 29
versionCode 21701
versionName "2.17.1"
versionCode 21800
versionName '2.18.0'

manifestPlaceholders = [
'authRedirectScheme': 'FOR_LIBRARY_CONSUMER_TO_OVERRIDE'
]
}

compileOptions {
Expand Down
21 changes: 18 additions & 3 deletions aws-android-sdk-cognitoauth/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:amazon="http://schemas.amazon.com/apk/res/android"
package="com.amazonaws.mobileconnectors.cognitoauth">

xmlns:amazon="http://schemas.amazon.com/apk/res/android"
package="com.amazonaws.mobileconnectors.cognitoauth">

<application>
<activity android:name=".activities.CustomTabsManagerActivity"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:launchMode="singleTask" />

<activity android:name=".activities.CustomTabsRedirectActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="${authRedirectScheme}"/>
</intent-filter>
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package com.amazonaws.mobileconnectors.cognitoauth;

import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
Expand Down Expand Up @@ -648,30 +649,26 @@ public Bundle getCustomTabExtras() {
* get tokens from the authentication code. <i>Uri</i> is the redirect uri with the
* authentication code.
* </p>
* @param activity Activity to launch custom tabs from and to listen for the intent completions.
*/
public void getSession() {
this.user.getSession(true);
public void getSession(final Activity activity) {
this.user.getSession(true, activity);
}

/**
* Use this method to get tokens for a user, the tokens are returned though the callback.
* {@link AuthHandler#onSuccess(AuthUserSession)}.
* {@link AuthHandler#onSuccess(AuthUserSession)}. If the tokens are not available, it will not
* launch the browser to re-authenticate.
* <p>
* If a username is available, this method looks for valid cached tokens on the device.
* If the cached token have expired and the refresh token (if available) is used to get new
* tokens.
* If valid tokens are not available locally or if the username is not set, Cognito Auth's
* web interface is launched on Chrome Custom Tabs. The user credentials will be required to
* authenticate.
* <b>Note</b>: This SDK uses OAuth Code-Grant flow with PKCE, for authentication. To get
* tokens after successful user authentication, the Amazom Cognito Auth returns the
* authentication code through the redirect uri. Call {@link Auth#getTokens(Uri)} to
* get tokens from the authentication code. <i>Uri</i> is the redirect uri with the
* authentication code.
* If valid tokens are not available locally or if the username is not set, the error callback
* will be invoked. It will not launch a sign in experience.
* </p>
*/
public void getSession(final boolean launchWebUIIfExpired) {
this.user.getSession(launchWebUIIfExpired);
public void getSessionWithoutWebUI() {
this.user.getSession(false, null);
}

/**
Expand Down Expand Up @@ -723,6 +720,13 @@ public void getTokens(final Uri uri) {
this.user.getTokens(uri);
}

/**
* Properly handles the event where a user cancels the auth flow before completing it.
*/
public void handleFlowCancelled() {
this.user.handleCustomTabsCancelled();
}

/**
* Set a username for the {@link Auth} instance.
* @param username Required: The username of the user in your Cognito User-Pool.
Expand Down
Loading

0 comments on commit a131321

Please sign in to comment.