Skip to content

Commit

Permalink
Merge pull request #1347 from AzureAD/release/1.1.20
Browse files Browse the repository at this point in the history
Merge Release/1.1.20 into master
  • Loading branch information
ameyapat committed Jul 26, 2021
2 parents 681d34b + de66524 commit 7b27561
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 63 deletions.
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.1.20] - 2021-07-19
* Migrated PR validation pipeline from Travis to Azure DevOps

## [1.1.19] - 2021-06-14:
* Changed some of the logging levels from info to verbose per customer request
* Minimum Xcode version bumped to 12.2
Expand Down
2 changes: 1 addition & 1 deletion MSAL.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MSAL"
s.version = "1.1.19"
s.version = "1.1.20"
s.summary = "Microsoft Authentication Library (MSAL) Preview for iOS"
s.description = <<-DESC
The MSAL library preview for iOS gives your app the ability to begin using the Microsoft Cloud by supporting Microsoft Azure Active Directory and Microsoft Accounts in a converged experience using industry standard OAuth2 and OpenID Connect. The library also supports Microsoft Azure B2C for those using our hosted identity management service.
Expand Down
2 changes: 1 addition & 1 deletion MSAL/IdentityCore
Submodule IdentityCore updated 33 files
+0 −23 .travis.yml
+14 −14 IdentityCore/IdentityCore.xcodeproj/project.pbxproj
+1 −1 IdentityCore/src/MSIDBrokerConstants.h
+1 −0 IdentityCore/src/MSIDBrokerConstants.m
+6 −1 IdentityCore/src/MSIDError.h
+8 −8 IdentityCore/src/cache/key/MSIDDefaultAccountCacheQuery.m
+5 −1 IdentityCore/src/controllers/MSIDLocalInteractiveController.m
+3 −2 IdentityCore/src/controllers/broker/ios/MSIDBrokerInteractiveController.m
+11 −0 IdentityCore/src/oauth2/aad_base/MSIDAADWebviewFactory.m
+8 −0 IdentityCore/src/oauth2/token/MSIDPrimaryRefreshToken.m
+5 −5 IdentityCore/src/throttling/cache/MSIDLRUCache.m
+1 −1 IdentityCore/src/throttling/cache/MSIDThrottlingCacheRecord.h
+2 −2 IdentityCore/src/throttling/model/MSIDThrottlingModel429.h
+5 −5 IdentityCore/src/throttling/model/MSIDThrottlingModel429.m
+20 −8 IdentityCore/src/throttling/model/MSIDThrottlingModelFactory.m
+1 −1 IdentityCore/src/throttling/model/MSIDThrottlingModelNonRecoverableServerError.h
+15 −7 IdentityCore/src/throttling/model/MSIDThrottlingModelNonRecoverableServerError.m
+1 −1 IdentityCore/src/util/ios/UIApplication+MSIDExtensions.h
+1 −1 IdentityCore/src/util/ios/UIApplication+MSIDExtensions.m
+1 −1 IdentityCore/src/webview/background/ios/MSIDBackgroundTaskManager.m
+9 −0 IdentityCore/src/webview/embeddedWebview/MSIDOAuth2EmbeddedWebviewController.m
+21 −2 IdentityCore/tests/MSIDAADWebviewFactoryTests.m
+17 −4 IdentityCore/tests/MSIDAccountCredentialsCacheTests.m
+6 −2 IdentityCore/tests/MSIDLRUCacheTest.m
+34 −0 IdentityCore/tests/MSIDPrimaryRefreshTokenTests.m
+3 −1 IdentityCore/tests/mac/MSIDMacKeychainTokenCacheTests.m
+2 −2 IdentityCore/tests/throttling/MSIDThrottlingModel429Test.m
+41 −17 IdentityCore/tests/throttling/MSIDThrottlingModelNonRecoverableServerError.m
+81 −0 azure_pipelines/pr-validation.yml
+13 −5 build.py
+5 −0 changelog.txt
+2 −2 device_guids.py
+0 −8 print_logs.sh
2 changes: 1 addition & 1 deletion MSAL/resources/ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.19</string>
<string>1.1.20</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion MSAL/resources/mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.19</string>
<string>1.1.20</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion MSAL/src/MSAL_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#define MSAL_VER_HIGH 1
#define MSAL_VER_LOW 1
#define MSAL_VER_PATCH 19
#define MSAL_VER_PATCH 20

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ You can also use Git Submodule or check out the latest release and use as framew
1. Register your app in the [Azure portal](https://aka.ms/MobileAppReg)
2. Make sure you register a redirect URI for your application. It should be in the following format:
`msauth.[BUNDLE_ID]://auth`
`msauth.$(PRODUCT_BUNDLE_IDENTIFIER)://auth`
3. Add a new keychain group to your project Capabilities. Keychain group should be `com.microsoft.adalcache` on iOS and `com.microsoft.identity.universalstorage` on macOS.
Expand All @@ -136,15 +136,15 @@ See more information about [keychain groups](https://docs.microsoft.com/en-us/az
#### iOS only steps:
1. Add your application's redirect URI scheme to your `Info.plist` file, it will be in the format of `msauth.[BUNDLE_ID]`
1. Add your application's redirect URI scheme to your `Info.plist` file
```xml
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>msauth.[BUNDLE_ID]</string>
<string>msauth.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>
Expand Down
75 changes: 75 additions & 0 deletions azure_pipelines/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Pipeline will be triggered for PR & any updates on the PR on all branches
pr:
autoCancel: true
branches:
include:
- '*'
drafts: true

# Not triggering for CI since it is triggered for PRs
trigger: none

# Define parallel jobs that run build script for specified targets
jobs:
- job: 'Validate_Pull_Request'
strategy:
maxParallel: 2
matrix:
IOS_FRAMEWORK:
target: "iosFramework iosTestApp sampleIosApp sampleIosAppSwift"
MAC_FRAMEWORK:
target: "macFramework"
displayName: Validate Pull Request
pool:
vmImage: 'macOS-latest'
timeOutInMinutes: 30

steps:
- task: CmdLine@2
displayName: Installing dependencies
inputs:
script: |
gem install xcpretty slather -N
failOnStderr: true
- checkout: self
clean: true
submodules: true
fetchDepth: 1
persistCredentials: false
- task: Bash@3
displayName: Removing any lingering codecov files. These can cause issues when the xcode version changes
inputs:
targetType: 'inline'
script: |
find . -name "*.gcda" -print0 | xargs -0 rm
- task: Bash@3
displayName: Run Build script & check for Errors
inputs:
targetType: 'inline'
script: |
{ output=$(./build.py --target $(target) 2>&1 1>&3-) ;} 3>&1
final_status=$(<./build/status.txt)
echo "FINAL STATUS = ${final_status}"
echo "POSSIBLE ERRORS: ${output}"
if [ $final_status != "0" ]; then
echo "Build & Testing Failed! \n ${output}" >&2
fi
failOnStderr: true
- task: Bash@3
condition: always()
displayName: Cleanup
inputs:
targetType: 'inline'
script: |
rm -rf ./build/status.txt
- task: PublishTestResults@2
condition: always()
displayName: Publish Test Report
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '$(Agent.BuildDirectory)/s/build/reports/*'
failTaskOnFailedTests: true
testRunTitle: 'Test Run - $(target)'


4 changes: 4 additions & 0 deletions azure_pipelines/spm-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ jobs:
$(Build.ArtifactStagingDirectory)/*.tar.gz
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'issueBased'
- task: Bash@3
displayName: Build MSAL docs via Jazzy
inputs:
filePath: 'build_docs.sh'
- task: Bash@3
displayName: Push pod to Cocoapods
inputs:
Expand Down
28 changes: 21 additions & 7 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,42 +60,48 @@ class ColorValues:
"operations" : [ "build", "test", "codecov" ],
"min_warn_codecov" : 70.0,
"platform" : "iOS",
"target" : "iosFramework"
},
{
"name" : "iOS Test App",
"scheme" : "MSAL Test App (iOS)",
"operations" : [ "build" ],
"platform" : "iOS",
"target" : "iosTestApp"

},
{
"name" : "Sample iOS App",
"scheme" : "SampleAppiOS",
"workspace" : "Samples/ios/SampleApp.xcworkspace",
"operations" : [ "build" ],
"platform" : "iOS",
"target" : "sampleIosApp"
},
{
"name" : "Sample iOS App-iOS",
"scheme" : "SampleAppiOS-Swift",
"workspace" : "Samples/ios/SampleApp.xcworkspace",
"operations" : [ "build" ],
"platform" : "iOS",
"target" : "sampleIosAppSwift"
},
{
"name" : "Mac Framework",
"scheme" : "MSAL (Mac Framework)",
"operations" : [ "build", "test", "codecov" ],
"min_warn_codecov" : 70.0,
"platform" : "Mac"
"platform" : "Mac",
"target" : "macFramework"
},
]

def print_operation_start(name, operation) :
print ColorValues.HDR + "Beginning " + name + " [" + operation + "]" + ColorValues.END
print "travis_fold:start:" + (name + "_" + operation).replace(" ", "_")
print "##[group]" + (name + "_" + operation).replace(" ", "_")

def print_operation_end(name, operation, exit_code, start_time) :
print "travis_fold:end:" + (name + "_" + operation).replace(" ", "_")
print "##[endgroup]" + (name + "_" + operation).replace(" ", "_")

end_time = timer()

Expand Down Expand Up @@ -161,6 +167,8 @@ def xcodebuild_command(self, operation, xcpretty) :

if (xcpretty) :
command += " | xcpretty"
if (xcpretty and operation == "test") :
command += " --report junit --output ./build/reports/'" + target.name + ".xml'"

return command

Expand All @@ -174,7 +182,7 @@ def get_build_settings(self) :

print "Retrieving Build Settings for " + self.name
if (show_build_settings) :
print "travis_fold:start:" + (self.name + "_settings").replace(" ", "_")
print "##[group]" + (self.name + "_settings").replace(" ", "_")

command = self.xcodebuild_command(None, False)
command += " -showBuildSettings"
Expand All @@ -185,7 +193,7 @@ def get_build_settings(self) :
settings_blob = subprocess.check_output(command, shell=True)
if (show_build_settings) :
print settings_blob
print "travis_fold:end:" + (self.name + "_settings").replace(" ", "_")
print "##[endgroup]" + (self.name + "_settings").replace(" ", "_")

settings_blob = settings_blob.decode("utf-8")
settings_blob = settings_blob.split("\n")
Expand Down Expand Up @@ -429,5 +437,11 @@ def launch_simulator() :
script_end_time = timer()

print "Total running time: " + "{0:.2f}".format(script_end_time - script_start_time) + " seconds"

sys.exit(final_status)
# xcodebuild seems to log in stderr instead of stdout. Catching final_status in text file to capture exit code and determine if build failed
# Similar issue : (see https://developer.apple.com/forums/thread/663959)
if (not os.path.exists("./build")) :
os.makedirs("./build")
os.chdir(r'./build')
status_file = open("status.txt", "w")
status_file.write(str(final_status))
sys.exit(final_status)
21 changes: 9 additions & 12 deletions build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/bin/bash
gem install jazzy
echo -e "Copying MSAL public files"
mkdir docs.temp
mkdir docs.temp/MSAL
cp `find MSAL/src/public` docs.temp/MSAL
cp README.md docs.temp/
cd docs.temp
echo -e "Generating MSAL documentation"
jazzy --objc --umbrella-header MSAL/MSAL.h --framework-root . --sdk iphonesimulator --author Microsoft\ Corporation --author_url https://aka.ms/azuread --github_url https://github.com/AzureAD/microsoft-authentication-library-for-objc --theme fullwidth

if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]
then
gem install jazzy
echo -e "Copying MSAL public files"
mkdir docs.temp
mkdir docs.temp/MSAL
cp `find MSAL/src/public` docs.temp/MSAL
cp README.md docs.temp/
cd docs.temp
echo -e "Generating MSAL documentation"
jazzy --objc --umbrella-header MSAL/MSAL.h --framework-root . --sdk iphonesimulator --author Microsoft\ Corporation --author_url https://aka.ms/azuread --github_url https://github.com/AzureAD/microsoft-authentication-library-for-objc --theme fullwidth
fi
4 changes: 2 additions & 2 deletions device_guids.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_guid_i(device) :
version_regex = re.compile("([0-9]+)\\.([0-9]+)(?:\\.([0-9]+))?")

command = "instruments -s devices"
print "travis_fold:start:Devices"
print "##[group]Devices"
p = subprocess.Popen(command, stdout = subprocess.PIPE, stderr = subprocess.PIPE, shell = True)

# Sometimes the hostname comes back with the proper casing, sometimes not. Using a
Expand Down Expand Up @@ -58,7 +58,7 @@ def get_guid_i(device) :
latest_os_device = match.group(2)
latest_os_version = version_tuple

print "travis_fold:end:Devices"
print "##[endgroup]Devices"

return latest_os_device

Expand Down

0 comments on commit 7b27561

Please sign in to comment.