Skip to content

Commit

Permalink
merged dev and fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
paulkagiri committed Jun 9, 2021
2 parents 538e7e4 + 5f35764 commit f776087
Show file tree
Hide file tree
Showing 15 changed files with 1,122 additions and 69 deletions.
34 changes: 20 additions & 14 deletions adal/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
apply plugin: 'com.android.library'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'maven-publish'
plugins {
id 'com.microsoft.identity.buildsystem' version '0.1.0'
id 'com.android.library'
id 'pmd'
id 'checkstyle'
id 'maven-publish'
}

apply from: 'versioning/version_tasks.gradle'
apply plugin: 'maven'

def desugarCode = false

if(project.hasProperty("sugar")){
desugarCode = sugar.toBoolean()
}

buildSystem {
desugar = desugarCode
}

group = 'com.microsoft.aad'

Expand Down Expand Up @@ -31,14 +44,6 @@ allprojects {
}
}

buildscript {
repositories {
mavenCentral()
}
dependencies {
}
}

android {

compileOptions {
Expand Down Expand Up @@ -141,12 +146,13 @@ dependencies {

// 'local' flavor dependencies
localApi(project(":common")) {
transitive = false
transitive = true
}

snapshotApi(group: 'com.microsoft.identity', name: 'common', version: '3.2.0', changing: true)

// 'dist' flavor dependencies
//TODO: we will have to change transitive to true once common4j is published
distApi("com.microsoft.identity:common:3.2.0") {
transitive = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
Expand Down Expand Up @@ -122,7 +121,7 @@ public void testGetCurrentSignatureForPackage() throws NameNotFoundException,

MockedPackageInfo mockedPackageInfo = new MockedPackageInfo(new Signature[]{new Signature(mTestSignature)});
final PackageHelper packageHelper = (PackageHelper) getInstance(mockContext);
String actual = packageHelper.getCurrentSignatureForPackage(mockedPackageInfo);
String actual = packageHelper.getCurrentSignatureForPackage(mockedPackageInfo.packageName);

// assert
assertEquals("should be same info", mTestTag, actual);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,15 @@ public void onReceivedError(@NonNull final WebView view,
public void onReceivedError(@NonNull final WebView view,
@NonNull final WebResourceRequest request,
@NonNull WebResourceError error) {
sendErrorResponse(error.getErrorCode(), error.getDescription().toString());
final String methodName = "onReceivedError (23)";
final boolean isForMainFrame = request.isForMainFrame();

com.microsoft.identity.common.logging.Logger.warn(TAG + methodName, "WebResourceError - isForMainFrame? " + isForMainFrame);
com.microsoft.identity.common.logging.Logger.warnPII(TAG + methodName, "Failing url: " + request.getUrl());

if (isForMainFrame) {
sendErrorResponse(error.getErrorCode(), error.getDescription().toString());
}
}

private void sendErrorResponse(final int errorCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import com.microsoft.identity.common.adal.internal.cache.StorageHelper;
import com.microsoft.identity.common.adal.internal.util.StringExtensions;
import com.microsoft.identity.common.internal.cache.SharedPreferencesFileManager;
Expand All @@ -46,6 +47,8 @@
import java.util.Map.Entry;
import java.util.Set;

import static com.microsoft.aad.adal.ADALError.ARGUMENT_EXCEPTION;

/**
* Store/Retrieve TokenCacheItem from SharedPreferencesFileManager.
* SharedPreferencesFileManager saves items when it is committed in an atomic operation.
Expand Down Expand Up @@ -162,7 +165,11 @@ public TokenCacheItem getItem(String key) {
json = null != json ? json : "";
String decrypted = decrypt(key, json);
if (decrypted != null) {
return mGson.fromJson(decrypted, TokenCacheItem.class);
try {
return mGson.fromJson(decrypted, TokenCacheItem.class);
} catch (final JsonSyntaxException exception) {
Logger.e(TAG, "Fail to parse Json. ", exception.getMessage(), ARGUMENT_EXCEPTION, exception);
}
}
}

Expand Down Expand Up @@ -227,8 +234,12 @@ public Iterator<TokenCacheItem> getAll() {

final String decryptedValue = decrypt(tokenKey, tokenValue);
if (decryptedValue != null) {
final TokenCacheItem tokenCacheItem = mGson.fromJson(decryptedValue, TokenCacheItem.class);
tokens.add(tokenCacheItem);
try {
final TokenCacheItem tokenCacheItem = mGson.fromJson(decryptedValue, TokenCacheItem.class);
tokens.add(tokenCacheItem);
} catch (final JsonSyntaxException exception) {
Logger.e(TAG, "Fail to parse Json. ", exception.getMessage(), ARGUMENT_EXCEPTION, exception);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FileTokenCacheStore implements ITokenCacheStore {
*/
private static final long serialVersionUID = -8252291336171327870L;

private static final String TAG = null;
private static final String TAG = FileTokenCacheStore.class.getSimpleName();

private final File mFile;

Expand Down
43 changes: 0 additions & 43 deletions azure-pipelines.yml

This file was deleted.

25 changes: 25 additions & 0 deletions azure-pipelines/auth-client/instrumented-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# File: azure-pipelines\auth-client\instrumented-test.yml
# Description: Run instrumented test for ADAL in a docker container
name: Instrumented Tests

trigger:
- main

pool:
name: DockerBuildAgents

resources:
repositories:
- repository: common
type: github
name: AzureAD/microsoft-authentication-library-common-for-android
ref: dev
endpoint: ANDROID_GITHUB

jobs:
- job: instrumentedTest
displayName: Instrumented Test ADAL
workspace:
clean: all
steps:
- template: azure-pipelines/templates/steps/auth-client/docker-tasks.yml@common
39 changes: 39 additions & 0 deletions azure-pipelines/maven-release/adal-maven-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# File: azure-pipelines\maven-release\adal-maven-release.yml
# Description: Publish adal to maven central (sonatype)
# https://search.maven.org/search?q=g:com.microsoft.aad%20AND%20a:adal
# Variable 'AdalVersion' was defined in the Variables tab
# Variable: 'ENV_VSTS_MVN_ANDROIDADAL_USERNAME' was defined in the Variables tab
# Variable: 'mvnAccessToken' was defined in the Variables tab
# https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate
name: $(date:yyyyMMdd)$(rev:.r)

trigger: none
pr: none

resources:
repositories:
- repository: self
type: git
ref: master
- repository: common
type: github
name: AzureAD/microsoft-authentication-library-common-for-android
ref: pedroro/release-pipelines
endpoint: ANDROID_GITHUB

jobs:
- template: azure-pipelines/templates/steps/maven-release/maven-release-jobs.yml@common
parameters:
project: adal
projectVersion: $(AdalVersion)
checkoutSubmodules: recursive
envVstsMvnAndroidAccessTokenVar: ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN
gradleAssembleReleaseTask: adal:clean adal:assembleDist adal:javadocJar
gradleGeneratePomFiletask: adal:generatePomFileForAdalPublication
aarSourceFolder: C:\Temp\s\adal\outputs\aar
jarSourceFolder: C:\Temp\s\adal\outputs\jar
pomSourceFolder: C:\Temp\s\adal\publications\adal
gpgAar: true
gpgSourcesJar: true
gpgJavadocJar: true
gpgJar: false
52 changes: 52 additions & 0 deletions azure-pipelines/pull-request-validation/pr-adal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# File: azure-pipelines\pull-request-validation\pr-adal.yml
# Description: Assemble adal
# Variable: 'ENV_VSTS_MVN_ANDROIDADACCOUNTS_USERNAME' was defined in the Variables tab
# Variable: 'mvnAccessToken' was defined in the Variables tab
# https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate
name: $(date:yyyyMMdd)$(rev:.r)

trigger:
branches:
include:
- dev
- master
- release/*
batch: True

resources:
repositories:
- repository: common
type: github
name: AzureAD/microsoft-authentication-library-common-for-android
ref: dev
endpoint: ANDROID_GITHUB

jobs:
- job: Phase_1
displayName: Phase 1
cancelTimeoutInMinutes: 1
pool:
name: Hosted Windows 2019 with VS2019
steps:
- checkout: self
clean: true
submodules: recursive
persistCredentials: True
- template: azure-pipelines/templates/steps/credscan-policheck.yml@common
parameters:
policheckCmdLineArgsDir: adal
- template: azure-pipelines/templates/steps/automation-cert.yml@common
- task: Gradle@1
name: Gradle1
displayName: Assemble Release
inputs:
tasks: clean adal:assembleLocal
publishJUnitResults: false
jdkArchitecture: x86
sqAnalysisBreakBuildIfQualityGateFailed: false
- template: azure-pipelines/templates/steps/spotbugs.yml@common
parameters:
project: adal
- task: ComponentGovernanceComponentDetection@0
displayName: Component Detection
...
55 changes: 55 additions & 0 deletions azure-pipelines/vsts-releases/adal-vsts-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# File: azure-pipelines\vsts-releases\adal-vsts-release.yml
# Description: Publish adal to internal feed
# https://identitydivision.visualstudio.com/Engineering/_packaging?_a=package&feed=AndroidADAL&package=com.microsoft.aad%3Aadal&protocolType=maven
# Variable 'ENV_VSTS_MVN_ANDROIDADAL_USERNAME' was defined in the Variables tab
# Variable 'mvnAccessToken' was defined in the Variables tab
# https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate
name: $(date:yyyyMMdd)$(rev:.r)

trigger: none
pr: none

resources:
repositories:
- repository: self
type: git
ref: master
- repository: common
type: github
name: AzureAD/microsoft-authentication-library-common-for-android
ref: dev
endpoint: ANDROID_GITHUB

jobs:
- job: Phase_1
displayName: Phase 1
cancelTimeoutInMinutes: 1
pool:
name: Hosted Windows 2019 with VS2019
steps:
- checkout: self
clean: true
submodules: recursive
persistCredentials: True
- task: CmdLine@1
displayName: Set MVN Access Token in Environment
inputs:
filename: echo
arguments: '##vso[task.setvariable variable=ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN]$(mvnAccessToken)'
- template: azure-pipelines/templates/steps/credscan-policheck.yml@common
parameters:
policheckCmdLineArgsDir: adal
- task: Gradle@1
name: Gradle1
displayName: Assemble Release
inputs:
tasks: clean adal:assembleDist
publishJUnitResults: false
jdkArchitecture: x86
sqAnalysisBreakBuildIfQualityGateFailed: false
- task: Gradle@2
displayName: Publish to VSTS
inputs:
tasks: adal:publish
publishJUnitResults: false
...
4 changes: 3 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
v.Next
----------
- [PATCH] Fixes crash due to missing exception handling. (#1606)
- [PATCH] Adds API23 WebViewClient#onReceivedError overload (#1580)
- [PATCH] Fixes for MFA setup using Authenticator app.(#1579)
- [MINOR] Changes to Broker Validation to allow setting whether to trust debug brokers (prod brokers are always trusted).
- [PATCH] Replaced deprecated PackageInfo.versionCode with PackageInfoCompat.getLongVersionCode(packageInfo) (#1584)
- [PATCH] Fixes deprecated PackageInfo.signatures (#1587)
- [PATCH] Deprecated ADAL namespaced AuthenticationSettings#setSecretKey(), #getSecretKey() (#1586)
- Picks up [email protected]
- [PATCH] Disregard pageload errors for the non-primary frame during interactive auth (#1603)
- [PATCH] Updates Nimbus version 8.2 -> 9.9 (#1600)

Version 3.1.2
-------------
Expand Down
2 changes: 1 addition & 1 deletion common
Submodule common updated 312 files
Loading

0 comments on commit f776087

Please sign in to comment.