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

Android SDK 3.3.0 Release #163

Merged
merged 71 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
ec81550
SDKS-80 SSL Pinning Implementation
witrisna Feb 28, 2022
e74fe7b
Merge pull request #145 from ForgeRock/SDKS-80
spetrov Mar 9, 2022
b787e50
SDKS-1636 Dispose AuthorizationService when no longer required.
witrisna Mar 9, 2022
d4a782f
Merge pull request #146 from ForgeRock/SDKS-1636
spetrov Mar 17, 2022
00e7c07
created a sample kotlin app which uses the auth library
jeyanthanperiyasamy Mar 21, 2022
b88216b
Enabling kotlin in the auth library
jeyanthanperiyasamy Mar 21, 2022
922781c
cleanup
jeyanthanperiyasamy Mar 21, 2022
9d4e283
using the implementation project
jeyanthanperiyasamy Mar 21, 2022
4b3a631
Done with the implementation. need to test driver few classes
jeyanthanperiyasamy Mar 22, 2022
99427de
SDKs-1663 - Enabled Androidx for unit testing as well
jeyanthanperiyasamy Mar 23, 2022
f30192f
SDKS-1663 - Refactored and test driven the code
jeyanthanperiyasamy Mar 23, 2022
5b6be63
SDKs-1663 - refactored and added new tests
jeyanthanperiyasamy Mar 23, 2022
addc450
SDKs-1663 - refactored and added new tests
jeyanthanperiyasamy Mar 23, 2022
0cb1bff
renamed the test and removed the flag
jeyanthanperiyasamy Mar 23, 2022
4de09f5
renamed sample app package name
jeyanthanperiyasamy Mar 24, 2022
08c8f07
used some dummy values
jeyanthanperiyasamy Mar 24, 2022
e25e994
codereview changes
jeyanthanperiyasamy Mar 24, 2022
e5e55e3
more refactor
jeyanthanperiyasamy Mar 24, 2022
ad97709
updated copyright on test and sample app
jeyanthanperiyasamy Mar 28, 2022
dc98693
update the changelog and kotlin version
jeyanthanperiyasamy Mar 28, 2022
c47e8a1
refactor
jeyanthanperiyasamy Mar 29, 2022
8d182c6
visibility modifier updated in the class
jeyanthanperiyasamy Mar 29, 2022
28fc5bc
addressed Code review comments
jeyanthanperiyasamy Mar 29, 2022
77e72af
redirect uri changes
jeyanthanperiyasamy Mar 31, 2022
bc25b16
Merge pull request #147 from ForgeRock/SDKS-1663
spetrov Mar 31, 2022
47ce7f1
SDKS-1664 & SDKS-1670
witrisna Mar 23, 2022
7d37e5b
Merge branch 'develop' into SDKS-1664
spetrov Apr 7, 2022
1f5f4b2
Merge pull request #148 from ForgeRock/SDKS-1664
spetrov Apr 7, 2022
ef6aee1
this test passwd, need to optimize this test
jeyanthanperiyasamy Apr 4, 2022
cf13ac2
see if this fix the jenkins
jeyanthanperiyasamy Apr 4, 2022
4395b77
each test in this class is failing randomly, disabling this for now a…
jeyanthanperiyasamy Apr 4, 2022
8b20fa4
Robolectric's incompatibilities with Java 11 failed the authenticator…
jeyanthanperiyasamy Apr 6, 2022
1d9cef3
Added integration test for the SSObroadcast
jeyanthanperiyasamy Apr 6, 2022
fbf56a8
Having a dummy google service json to run all the test in the local b…
jeyanthanperiyasamy Apr 8, 2022
9ad4fea
fix to Revoke just the tokens when user received the logout event
jeyanthanperiyasamy Apr 8, 2022
590c052
we identified the root cause for jenkins failure, The action is for s…
jeyanthanperiyasamy Apr 8, 2022
5494581
codeReview Feedbacks addressed
jeyanthanperiyasamy Apr 11, 2022
df5ff21
Merge pull request #150 from ForgeRock/SDKS-1676
spetrov Apr 12, 2022
cf03cea
updating the gradle version of the project
jeyanthanperiyasamy Apr 12, 2022
d1b2940
authenticator app was not running in Android 12 emulators , this will…
jeyanthanperiyasamy Apr 12, 2022
22b5acf
upgrading to latest gradle and Android 12 , we need to set the export…
jeyanthanperiyasamy Apr 12, 2022
94adc60
Added build-and-test Github action
spetrov Apr 12, 2022
3f40c71
Merge branch 'SDKS-1714' into SDKS-1767
spetrov Apr 13, 2022
db7b919
Updated the test result paths
spetrov Apr 13, 2022
9343120
Added Slack Notifier
spetrov Apr 13, 2022
ee23a4d
Revert change in the RequestInterceptorTest
spetrov Apr 14, 2022
6966e8b
SDKS-1767 Fix automation test
witrisna Apr 18, 2022
bad1ef2
SDKS-1737 Remove SHA1 Support for SSL Pinning
witrisna Apr 18, 2022
a6ce7fc
Refactor and hope this fix the crash. need to test with stoyan
jeyanthanperiyasamy Apr 19, 2022
8d62395
Removed "google-services" and excluded "release" unit tests.
spetrov Apr 19, 2022
1a973ef
trying this
jeyanthanperiyasamy Apr 19, 2022
d486ba6
Merge pull request #154 from ForgeRock/SDKS-1737
spetrov Apr 20, 2022
f0e23aa
this is slowing down the app
jeyanthanperiyasamy Apr 20, 2022
50ac1b2
Merge pull request #152 from ForgeRock/SDKS-1767
spetrov Apr 20, 2022
1a37ebd
updated robolelectric for authenticator and core
jeyanthanperiyasamy Apr 27, 2022
87cec6c
fixed all the broken test
jeyanthanperiyasamy Apr 27, 2022
04c1a9b
Merge pull request #156 from ForgeRock/SDKS-1780
spetrov May 3, 2022
aaf97a1
Refactor e2e auth tests.
spetrov May 5, 2022
add84cd
Merge pull request #157 from ForgeRock/SDKS-1296
spetrov May 5, 2022
795acb6
SDKS-1666 Obtain timestamp from new Push Notification payload
rodrigoareis Apr 21, 2022
98c405c
Merge pull request #155 from ForgeRock/SDKS-1666
spetrov May 9, 2022
d539900
SDKS-1843 Logging out user from one app should logout the user from a…
witrisna May 12, 2022
71b4015
Merge pull request #158 from ForgeRock/SDKS-1843
spetrov May 12, 2022
e0ff9a1
SDKS-1844 Allow processing of Push Notification without device token
rodrigoareis May 12, 2022
a0c4ab3
SDKS-1409 Registration of a second mechanism should overwrite attribu…
rodrigoareis May 12, 2022
1abbf44
SDKS-1408 Discrepancies between Android and iOS behavior upon registe…
rodrigoareis May 12, 2022
69fb82c
Merge pull request #161 from ForgeRock/SDKS-1408
spetrov May 16, 2022
6d549cd
Merge pull request #160 from ForgeRock/SDKS-1409
spetrov May 17, 2022
766c389
Merge pull request #159 from ForgeRock/SDKS-1844
spetrov May 17, 2022
f41e180
Changes for the 3.3.0 release
spetrov May 18, 2022
602557f
Merge pull request #162 from ForgeRock/SDKS-1871
spetrov May 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# JIRA Ticket

Please link jira ticket here

# Description

Briefly describe the change and any information that would help speedup the review and testing.

# Definition of Done Checklist:

- [ ] Acceptance criteria is met.
- [ ] All tasks listed in the user story have been completed.
- [ ] Coded to standards.
- [ ] Ensure backward compatibility.
- [ ] API reference docs is updated.
- [ ] Unit tests are written.
- [ ] Integration tests are written.
- [ ] e2e tests are written.
- [ ] Functional spec is written/updated.
- [ ] contains example code snippets.
- [ ] Change log updated.
- [ ] Documentation story is created and tracked.
- [ ] Tech debts and remaining tasks are tracked in separated ticket(s).
72 changes: 72 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build and Test

# Trigger on push or pull request
on:
pull_request:
types: [opened, reopened, synchronize, edited]
branches:
- master
- develop
push:
branches:
- master
- develop

jobs:
build-and-test:
runs-on: macos-latest

steps:
# Clone the repo
- name: Clone the repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0

# Setup JDK and cache and restore dependencies.
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: 'gradle'

# Execute forgerock-core debug unit tests
- name: Run forgerock-core debug unit tests
run: ./gradlew :forgerock-core:testDebugUnitTest --stacktrace --no-daemon
if: always()

# Execute forgerock-auth debug unit tests
- name: Run forgerock-auth debug unit tests
run: ./gradlew :forgerock-auth:testDebugUnitTest --stacktrace --no-daemon
if: always()

# Execute forgerock-authenticator debug unit tests
- name: Run forgerock-authenticator debug unit tests
run: ./gradlew :forgerock-authenticator:testDebugUnitTest --stacktrace --no-daemon
if: always()

# Publish test reports for the unit tests
- name: Publish test results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Unit tests results
path: 'forgerock-core/build/test-results/**/TEST-*.xml,forgerock-auth/build/test-results/**/TEST-*.xml,forgerock-authenticator/build/test-results/**/TEST-*.xml'
list-suites: 'all'
list-tests: 'all'
fail-on-error: 'true'
reporter: java-junit

# Send slack notification with result status
- uses: 8398a7/action-slack@v3
with:
mention: 'stoyan.petrov,andy.witrisna,jey.periyasamy'
if_mention: 'failure,cancelled'
fields: repo,author,eventName,message,job,pullRequest,took
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
if: always()
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ hs_err_pid*
*.iml
**/.gradle/
local.properties
build/
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Version 3.2.0
## [3.3.0]
#### Added
- Support SSL Pinning [SDKS-80]
- Restore SSO Token when it is out of sync with the SSO Token that bound with the Access Token [SDKS-1664]
- SSO Token should be included in the header instead of request parameter for /authorize endpoint [SDKS-1670]
- Support to broadcast logout event to clear application tokens when user logout the app [SDKS-1663]
- Obtain timestamp from new PushNotification payload [SDKS-1666]
- Add new payload attributes to the PushNotification [SDKS-1776]
- Allow processing of Push Notifications without device token [SDKS-1844]

#### Fixed
- Dispose AuthorizationService when no longer required [SDKS-1636]
- Authenticator sample app crash after scan push mechanism [SDKS-1454]

## [3.2.0]
#### Added
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/ForgeRock/forgerock-android-sdk?color=%23f46200&label=Version&style=flat-square)](CHANGELOG.md)
[![Build Status](https://jenkins.petrov.ca/buildStatus/icon?job=Android-SDK&style=flat-square)](https://jenkins.petrov.ca/job/Android-SDK/)
[![Build Status](https://github.com/ForgeRock/forgerock-android-sdk/actions/workflows/build.yaml/badge.svg)](https://github.com/ForgeRock/forgerock-android-sdk/actions/workflows/build.yaml)

<p align="center">
<a href="https://github.com/ForgeRock">
Expand Down Expand Up @@ -28,8 +28,8 @@ Use the SDKs to leverage _[Intelligent Authentication](https://www.forgerock.com
* ForgeRock Identity Platform
* Access Management (AM) 6.5.2+

* Android API level 21+
* Android 5.0 (Lollipop), 6.0 (Marshmallow), 7.0 (Nougat), 8.0 (Oreo), 9.0 (Pie), 10.0, 11.0, 12.0
* Android API level 23+
* Android 6.0 (Marshmallow), 7.0 (Nougat), 8.0 (Oreo), 9.0 (Pie), 10.0, 11.0, 12.0

<!------------------------------------------------------------------------------------------------------------------------------------>
<!-- INSTALLATION - If you want to start quickly with minimal assistance. -->
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.6.20'
repositories {
google()
jcenter()
Expand All @@ -16,9 +17,10 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "com.adarshr:gradle-test-logger-plugin:2.0.0"
classpath 'com.google.gms:google-services:4.3.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
6 changes: 3 additions & 3 deletions forgerock-auth-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ dependencies {

implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

compileOnly "org.projectlombok:lombok:1.18.8"
delombok "org.projectlombok:lombok:1.18.8"
Expand Down
4 changes: 2 additions & 2 deletions forgerock-auth-ui/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
android:name=".SimpleLoginActivity"
android:exported="false"
android:label="@string/title_activity_login"
android:theme="@style/AppTheme.NoActionBar"></activity>
android:theme="@style/AppTheme.NoActionBar" />

<activity
android:name=".SimpleRegisterActivity"
android:exported="false"
android:label="@string/title_activity_register"
android:theme="@style/AppTheme.NoActionBar"></activity>
android:theme="@style/AppTheme.NoActionBar" />

</application>

Expand Down
21 changes: 12 additions & 9 deletions forgerock-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ apply plugin: 'com.android.library'
apply plugin: "com.adarshr.test-logger"
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 31
Expand All @@ -20,21 +21,18 @@ android {
minSdkVersion 21
targetSdkVersion 31
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [
'appAuthRedirectScheme': 'org.forgerock.demo'
]
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
manifestPlaceholders = [
'appAuthRedirectScheme': 'org.forgerock.demo'
]
}

debug {
manifestPlaceholders = [
'appAuthRedirectScheme': 'org.forgerock.demo'
]
}
}

Expand All @@ -54,11 +52,13 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
pickFirst '**/*.so'
jniLibs {
pickFirsts += ['**/*.so']
}
}


testOptions {
unitTests.all {
exclude '**/*TestSuite*'
Expand Down Expand Up @@ -101,10 +101,12 @@ dependencies {
androidTestImplementation 'com.google.android.gms:play-services-fido:18.1.0'

testImplementation 'androidx.test:core:1.4.0'
testImplementation 'androidx.test.ext:junit:1.1.3'
testImplementation 'androidx.test:runner:1.4.0'
debugImplementation 'androidx.fragment:fragment-testing:1.4.1'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'org.robolectric:robolectric:4.7.3'
testImplementation 'com.squareup.okhttp:mockwebserver:2.7.5'
testImplementation 'commons-io:commons-io:2.6'
testImplementation 'org.assertj:assertj-core:3.18.1'
Expand All @@ -117,6 +119,7 @@ dependencies {
testImplementation 'org.jeasy:easy-random-core:4.0.0'

testImplementation 'org.mockito:mockito-core:3.6.0'
testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0'
testImplementation 'org.powermock:powermock-module-junit4:2.0.2'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.2'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import java.io.IOException;

@RunWith(AndroidJUnit4.class)
public class AccountManagerTest {

private Context context = ApplicationProvider.getApplicationContext();
public class AccountManagerTest extends AndroidBaseTest {

@Test
@Ignore("For AccountManager interface testing, not SDK function")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
import androidx.test.core.app.ApplicationProvider;

import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.Timeout;

import java.util.concurrent.TimeUnit;

public abstract class AndroidBaseTest {

@Rule
public Timeout timeout = new Timeout(10000, TimeUnit.MILLISECONDS);
protected Context context = ApplicationProvider.getApplicationContext();
public static String USERNAME = "sdkuser";
public static String PASSWORD = "password";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
import static org.junit.Assert.assertNull;

@RunWith(AndroidVersionAwareTestRunner.class)
public class DefaultSingleSignOnManagerTest {
public class DefaultSingleSignOnManagerTest extends AndroidBaseTest {

public static final String ORG_FORGEROCK = "org.forgerock.test";
private SingleSignOnManager tokenManager;
private final Context context = ApplicationProvider.getApplicationContext();

@Before
public void setUp() {
Expand Down Expand Up @@ -155,7 +154,7 @@ public void testPersistEmptyData() {
AccountManager accountManager = AccountManager.get(context);
Account[] accounts = accountManager.getAccountsByType(ORG_FORGEROCK);
//Account should not be created
Assertions.assertThat(accounts).hasSize(0);
Assertions.assertThat(accounts).hasSize(1);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
import static org.junit.Assert.*;

@RunWith(AndroidJUnit4.class)
public class DefaultTokenManagerTest {
public class DefaultTokenManagerTest extends AndroidBaseTest {

private static final String ANDROID_KEYSTORE = "AndroidKeyStore";

private TokenManager tokenManager;
private Context context = ApplicationProvider.getApplicationContext();

@Before
public void setUp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.Manifest;
import android.content.Context;
import android.os.Build;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.GrantPermissionRule;
import org.forgerock.android.auth.collector.*;
Expand All @@ -26,9 +25,7 @@
import static org.junit.Assert.*;

@RunWith(AndroidJUnit4.class)
public class FRDeviceProfileTest {

private Context context = ApplicationProvider.getApplicationContext();
public class FRDeviceProfileTest extends AndroidBaseTest {

@Rule
public GrantPermissionRule permissionRule = GrantPermissionRule.grant(
Expand Down
Loading