Skip to content

Commit 5a91536

Browse files
Merge remote-tracking branch 'origin/develop' into main
2 parents 5984bb8 + 37772bd commit 5a91536

File tree

155 files changed

+14527
-1835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+14527
-1835
lines changed

.gitignore

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,7 @@ captures/
3636

3737
# IntelliJ
3838
*.iml
39-
.idea/workspace.xml
40-
.idea/tasks.xml
41-
.idea/gradle.xml
42-
.idea/assetWizardSettings.xml
43-
.idea/dictionaries
44-
.idea/libraries
45-
.idea/caches
46-
.idea/codeStyles
47-
.idea/misc.xml
39+
.idea
4840

4941
# Keystore files
5042
# Uncomment the following line if you do not want to check your keystore files in.

.idea/modules.xml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.idea/runConfigurations.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

aws-android-sdk-auth-core/src/main/java/com/amazonaws/mobile/auth/core/IdentityManager.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ public IdentityManager(final Context context,
223223
final AWSConfiguration awsConfiguration) {
224224
this.appContext = context.getApplicationContext();
225225
this.awsConfiguration = awsConfiguration;
226-
this.clientConfiguration = new ClientConfiguration().withUserAgent(awsConfiguration.getUserAgent());
226+
this.clientConfiguration = new ClientConfiguration()
227+
.withUserAgent(awsConfiguration.getUserAgent())
228+
.withUserAgentOverride(awsConfiguration.getUserAgentOverride());
227229
this.credentialsProviderHolder = new AWSCredentialsProviderHolder();
228230
createCredentialsProvider(this.appContext, this.clientConfiguration);
229231
this.awsKeyValueStore = new AWSKeyValueStore(appContext, SHARED_PREF_NAME, isPersistenceEnabled);
@@ -905,7 +907,6 @@ public void login(final Context context,
905907
*/
906908
private void createCredentialsProvider(final Context context,
907909
final ClientConfiguration clientConfiguration) {
908-
909910
Log.d(LOG_TAG, "Creating the Cognito Caching Credentials Provider "
910911
+ "with a refreshing Cognito Identity Provider.");
911912

@@ -929,9 +930,16 @@ private void createCredentialsProvider(final Context context,
929930
new AWSRefreshingCognitoIdentityProvider(null, poolId,
930931
clientConfiguration, cognitoIdentityRegion);
931932

932-
final CognitoCachingCredentialsProvider cognitoCachingCredentialsProvider = new CognitoCachingCredentialsProvider(context, refreshingCredentialsProvider,
933-
cognitoIdentityRegion, clientConfiguration);
933+
final CognitoCachingCredentialsProvider cognitoCachingCredentialsProvider =
934+
new CognitoCachingCredentialsProvider(
935+
context,
936+
refreshingCredentialsProvider,
937+
cognitoIdentityRegion,
938+
clientConfiguration);
934939
cognitoCachingCredentialsProvider.setPersistenceEnabled(isPersistenceEnabled);
940+
if (clientConfiguration.getUserAgentOverride() != null) {
941+
cognitoCachingCredentialsProvider.setUserAgentOverride(clientConfiguration.getUserAgentOverride());
942+
}
935943
credentialsProviderHolder.setUnderlyingProvider(cognitoCachingCredentialsProvider);
936944
}
937945

aws-android-sdk-auth-google/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ android {
1414

1515
dependencies {
1616
api project(':aws-android-sdk-auth-core')
17-
api 'com.google.android.gms:play-services-auth:18.0.0'
17+
api 'com.google.android.gms:play-services-auth:18.1.0'
1818
implementation 'androidx.annotation:annotation:1.1.0'
1919
implementation 'androidx.appcompat:appcompat:1.1.0'
2020
}

aws-android-sdk-cognitoidentityprovider/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ android {
1010
versionCode 1
1111
versionName '1.0'
1212
}
13+
14+
testOptions.unitTests.includeAndroidResources = true
1315
}
1416

1517
dependencies {
1618
api project(':aws-android-sdk-core')
1719
implementation 'com.amazonaws:aws-android-sdk-cognitoidentityprovider-asf:1.0.0'
18-
}
1920

21+
testImplementation 'junit:junit:4.13'
22+
testImplementation 'org.mockito:mockito-core:1.10.19'
23+
testImplementation 'org.robolectric:robolectric:4.3.1'
24+
testImplementation 'androidx.test:core:1.2.0'
25+
}

aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/CognitoUserPool.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public CognitoUserPool(Context context, AWSConfiguration awsConfiguration) {
189189

190190
final ClientConfiguration clientConfig = new ClientConfiguration();
191191
clientConfig.setUserAgent(awsConfiguration.getUserAgent());
192+
clientConfig.setUserAgentOverride(awsConfiguration.getUserAgentOverride());
192193
this.client = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), clientConfig);
193194
this.client.setRegion(com.amazonaws.regions.Region.getRegion(Regions.fromName(userPoolConfiguration.getString("Region"))));
194195
} catch (Exception e) {

aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/continuations/AuthenticationContinuation.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler;
2525

2626
import java.util.Collections;
27+
import java.util.HashMap;
2728
import java.util.Map;
2829

2930
/**
@@ -47,17 +48,10 @@ public class AuthenticationContinuation implements CognitoIdentityProviderContin
4748
private final Context context;
4849
private final AuthenticationHandler callback;
4950
private final boolean runInBackground;
51+
private final Map<String, String> clientMetadata;
5052

5153
private AuthenticationDetails authenticationDetails = null;
52-
private Map<String, String> clientMetadata;
5354

54-
/**
55-
* Constructs a new continuation in the authentication process.
56-
*
57-
* @param user
58-
* @param runInBackground
59-
* @param callback
60-
*/
6155
/**
6256
* Constructs a new continuation in the authentication process.
6357
*
@@ -74,7 +68,7 @@ public AuthenticationContinuation(CognitoUser user,
7468
this.context = context;
7569
this.runInBackground = runInBackground;
7670
this.callback = callback;
77-
this.clientMetadata = Collections.emptyMap();
71+
this.clientMetadata = new HashMap<>();
7872
}
7973

8074
/**
@@ -84,8 +78,9 @@ public AuthenticationContinuation(CognitoUser user,
8478
* </p>
8579
* @return ClientMetadata
8680
*/
81+
@SuppressWarnings("unused")
8782
public Map<String, String> getClientMetaData() {
88-
return clientMetadata;
83+
return Collections.unmodifiableMap(clientMetadata);
8984
}
9085

9186
/**
@@ -94,14 +89,17 @@ public Map<String, String> getClientMetaData() {
9489
*/
9590
public void setClientMetaData(Map<String, String> clientMetadata) {
9691
this.clientMetadata.clear();
97-
this.clientMetadata.putAll(clientMetadata);
92+
if (clientMetadata != null) {
93+
this.clientMetadata.putAll(clientMetadata);
94+
}
9895
}
9996

10097
/**
10198
* Returns the parameters required for this continuation.
10299
*
103100
* @return
104101
*/
102+
@SuppressWarnings("JavaDoc")
105103
@Override
106104
public String getParameters() {
107105
return "AuthenticationDetails";

0 commit comments

Comments
 (0)