From 34b723d77cc7f51fef05b45d48a6ac1b05c9f62e Mon Sep 17 00:00:00 2001 From: rotembr Date: Fri, 23 Aug 2019 17:38:39 +0300 Subject: [PATCH 1/6] Development (#183) * update login widget section in readme * changing initializer to public (#171) * Point to v4 (#173) * Update to point to v4 + iss and aud validation Adds azp and issuer validation for V4 * Issue 2439 (#174) Removed azp validation and updated tokens to v4 for tests * bump up version to 6.0.0 * Issue 3201 (#177) * update depandencies and fix warnings * bump up version * update xcode version * added a logout function in AppID class which wraps AppIDAuthorizationManager's logout. * added an example on logout in readme * deleted empty line * disabled a line in testRegisterOAuthClient2 where the test failed on an assertion because of a difference in map order * added slack link * restored deleted test line (#182) * fixed test testRegisterOAuthClient2, it was failing because of map elements' order * added some description to logout * update version to 6.0.2 --- IBMCloudAppID.podspec | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/IBMCloudAppID.podspec b/IBMCloudAppID.podspec index 9f85bd9..3a4f063 100755 --- a/IBMCloudAppID.podspec +++ b/IBMCloudAppID.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "IBMCloudAppID" - s.version = '6.0.1' + s.version = '6.0.2' s.summary = "AppID Swift SDK" s.homepage = "https://github.com/ibm-cloud-security/appid-clientsdk-swift" s.license = 'Apache License, Version 2.0' diff --git a/README.md b/README.md index b17634a..a73c336 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ This API can be used only when the user is logged in using Cloud Directory ident ``` ### Logout - +Call the logout function in order to clear the stored tokens. ```swift AppID.sharedInstance.logout() ``` From 10414a69dd8598698b8f94ad0df8a001696de079 Mon Sep 17 00:00:00 2001 From: Patrick Schumacher Date: Wed, 6 May 2020 11:33:17 +0200 Subject: [PATCH 2/6] fix not working url encoding function in Utils --- IBMCloudAppIDTests/UtilsTests.swift | 9 +++++++++ Source/IBMCloudAppID/internal/RegistrationManager.swift | 2 +- Source/IBMCloudAppID/internal/Utils.swift | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/IBMCloudAppIDTests/UtilsTests.swift b/IBMCloudAppIDTests/UtilsTests.swift index e175b16..76cdedd 100644 --- a/IBMCloudAppIDTests/UtilsTests.swift +++ b/IBMCloudAppIDTests/UtilsTests.swift @@ -72,6 +72,15 @@ class UtilsTest: XCTestCase { // XCTAssertEqual(dictionary[AppIDConstants.JSON_APPLICATION_VERSION_KEY] as? String, appIdentity.version) // XCTAssertEqual(dictionary[AppIDConstants.JSON_ENVIRONMENT_KEY] as? String, AppIDConstants.JSON_IOS_ENVIRONMENT_VALUE) // } + + func testURLEncoding() { + let strToEncode = "test+test@test.com" + let exceptedStr = "test%2Btest%40test.com" + + let resultStr = Utils.urlEncode(strToEncode) + XCTAssertEqual(resultStr, exceptedStr, "Could not url Encoded") + } + func testDecodeBase64WithString() { let str = "VGhpcyBpcyBhIFV0aWxzIHVuaXRUZXN0IHR+c/Q=" let strSafe = "VGhpcyBpcyBhIFV0aWxzIHVuaXRUZXN0IHR-c_Q=" diff --git a/Source/IBMCloudAppID/internal/RegistrationManager.swift b/Source/IBMCloudAppID/internal/RegistrationManager.swift index 1122859..7b0b860 100644 --- a/Source/IBMCloudAppID/internal/RegistrationManager.swift +++ b/Source/IBMCloudAppID/internal/RegistrationManager.swift @@ -76,7 +76,7 @@ internal class RegistrationManager { let request:Request = Request(url: Config.getServerUrl(appId: self.appId) + "/clients",method: HttpMethod.POST, headers: [Request.contentType : "application/json"], queryParameters: nil, timeout: 0) request.timeout = BMSClient.sharedInstance.requestTimeout - let registrationParamsAsData = try? Utils.urlEncode(Utils.JSONStringify(registrationParams as AnyObject)).data(using: .utf8) ?? Data() + let registrationParamsAsData = try? Utils.JSONStringify(registrationParams as AnyObject).data(using: .utf8) ?? Data() sendRequest(request: request, registrationParamsAsData: registrationParamsAsData, internalCallBack: internalCallBack) } diff --git a/Source/IBMCloudAppID/internal/Utils.swift b/Source/IBMCloudAppID/internal/Utils.swift index daccde2..563805b 100644 --- a/Source/IBMCloudAppID/internal/Utils.swift +++ b/Source/IBMCloudAppID/internal/Utils.swift @@ -226,10 +226,10 @@ public class Utils { internal static func urlEncode(_ str:String) -> String{ var encodedString = "" var unchangedCharacters = "" - let FORM_ENCODE_SET = " \"':;<=>@[]^`{}|/\\?#&!$(),~%" + let FORM_ENCODE_SET = " \"':;<=>@[]^`{}|/\\?#&!$(),~%+".unicodeScalars for element: Int in 0x20..<0x7f { - if !FORM_ENCODE_SET.contains(String(describing: UnicodeScalar(element))) { + if !FORM_ENCODE_SET.contains(UnicodeScalar(element)!) { unchangedCharacters += String(Character(UnicodeScalar(element)!)) } } From cdc3ad152e3733d35b4689a9c4659c7c9da1f659 Mon Sep 17 00:00:00 2001 From: TalAviel Date: Thu, 21 May 2020 16:35:16 -0500 Subject: [PATCH 3/6] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 703f04d..c01573b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ matrix: - osx_image: xcode10.2 install: - gem install jazzy - - gem install slather -v 2.4.5 + - gem install slather -v 2.4.7 before_script: - rm -rf ~/Library/Developer/Xcode/DerivedData script: From 13c1a47d67def71f3ec57deeebe2e944723a5901 Mon Sep 17 00:00:00 2001 From: TalAviel Date: Thu, 21 May 2020 17:16:09 -0500 Subject: [PATCH 4/6] Update Podfile --- Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Podfile b/Podfile index 3d2fe89..b622e2b 100644 --- a/Podfile +++ b/Podfile @@ -3,7 +3,7 @@ use_frameworks! def shared_pods platform :ios, '10.0' pod 'BMSCore', '~> 2.4.0' - pod 'JOSESwift', '~> 1.8.0' + pod 'JOSESwift', '~> 2.0.0' end target 'IBMCloudAppID' do From b4ad96d3acc906deace2fa5f91a1e98e4bf3d96c Mon Sep 17 00:00:00 2001 From: TalAviel Date: Thu, 21 May 2020 17:20:29 -0500 Subject: [PATCH 5/6] Update Podfile --- Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Podfile b/Podfile index b622e2b..bbc7c1d 100644 --- a/Podfile +++ b/Podfile @@ -3,7 +3,7 @@ use_frameworks! def shared_pods platform :ios, '10.0' pod 'BMSCore', '~> 2.4.0' - pod 'JOSESwift', '~> 2.0.0' + pod 'JOSESwift', '~> 2.1.0' end target 'IBMCloudAppID' do From 2789bcb50f95cf9f27b702bfa57c5ca2a238e52d Mon Sep 17 00:00:00 2001 From: Vishal Kaja Date: Thu, 21 May 2020 17:46:49 -0500 Subject: [PATCH 6/6] Update to xcode 11 to fix build issues --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c01573b..afaa477 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: objective-c matrix: include: - - osx_image: xcode10.2 + - osx_image: xcode11.4 install: - gem install jazzy - gem install slather -v 2.4.7