diff --git a/.travis.yml b/.travis.yml index 6230332..703f04d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: objective-c matrix: include: - - osx_image: xcode10 + - osx_image: xcode10.2 install: - gem install jazzy - gem install slather -v 2.4.5 diff --git a/IBMCloudAppID.podspec b/IBMCloudAppID.podspec index c20410d..9f85bd9 100755 --- a/IBMCloudAppID.podspec +++ b/IBMCloudAppID.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "IBMCloudAppID" - s.version = '6.0.0' + s.version = '6.0.1' 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/IBMCloudAppID.xcodeproj/project.pbxproj b/IBMCloudAppID.xcodeproj/project.pbxproj index 8c8dfea..a4865b4 100644 --- a/IBMCloudAppID.xcodeproj/project.pbxproj +++ b/IBMCloudAppID.xcodeproj/project.pbxproj @@ -15,7 +15,7 @@ 6749E62C81CCD62984862D58 /* Pods_IBMCloudAppID.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B1AE9343AB77B8B9C396E21 /* Pods_IBMCloudAppID.framework */; }; 9539BBDF532A13A970EB051F /* Pods_IBMCloudAppIDTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB32128A91C6C77CEBDAC128 /* Pods_IBMCloudAppIDTests.framework */; }; BDC0D53F1E5EF68300444F9E /* UserProfileManagerImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDC0D53E1E5EF68300444F9E /* UserProfileManagerImpl.swift */; }; - BDF5878B1E65736B00393C0C /* (null) in Sources */ = {isa = PBXBuildFile; }; + BDF5878B1E65736B00393C0C /* BuildFile in Sources */ = {isa = PBXBuildFile; }; BDF5878F1E66C55A00393C0C /* UserProfileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF5878E1E66C55A00393C0C /* UserProfileTests.swift */; }; EF3B3BE21E55C4E900DFFF13 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF3B3BE11E55C4E900DFFF13 /* AppDelegate.swift */; }; EF3B3BE41E55C4E900DFFF13 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF3B3BE31E55C4E900DFFF13 /* ViewController.swift */; }; @@ -555,7 +555,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-IBMCloudAppIDTests/Pods-IBMCloudAppIDTests-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-IBMCloudAppIDTests/Pods-IBMCloudAppIDTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/BMSAnalyticsAPI/BMSAnalyticsAPI.framework", "${BUILT_PRODUCTS_DIR}/BMSCore/BMSCore.framework", "${BUILT_PRODUCTS_DIR}/JOSESwift/JOSESwift.framework", @@ -568,7 +568,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-IBMCloudAppIDTests/Pods-IBMCloudAppIDTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-IBMCloudAppIDTests/Pods-IBMCloudAppIDTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -632,7 +632,7 @@ EF4994811E55F7BE008ACC27 /* SecurityUtilsTests.swift in Sources */, EF4994821E55F7BE008ACC27 /* AppIDTestConstants.swift in Sources */, EF4994831E55F7BE008ACC27 /* AppIDTests.swift in Sources */, - BDF5878B1E65736B00393C0C /* (null) in Sources */, + BDF5878B1E65736B00393C0C /* BuildFile in Sources */, EF4994841E55F7BE008ACC27 /* AuthorizationHeaderHelperTests.swift in Sources */, EF4994861E55F7BE008ACC27 /* PreferencesTests.swift in Sources */, EF4994871E55F7BE008ACC27 /* TokenManagerTests.swift in Sources */, diff --git a/Podfile b/Podfile index a0522ed..3d2fe89 100644 --- a/Podfile +++ b/Podfile @@ -2,8 +2,8 @@ use_frameworks! def shared_pods platform :ios, '10.0' - pod 'BMSCore', '~> 2.3.1' - pod 'JOSESwift', '~> 1.1.0' + pod 'BMSCore', '~> 2.4.0' + pod 'JOSESwift', '~> 1.8.0' end target 'IBMCloudAppID' do diff --git a/Source/IBMCloudAppID/api/AppID.swift b/Source/IBMCloudAppID/api/AppID.swift index f12f049..75d9272 100644 --- a/Source/IBMCloudAppID/api/AppID.swift +++ b/Source/IBMCloudAppID/api/AppID.swift @@ -76,12 +76,12 @@ public class AppID { tokenResponseDelegate: tokenResponseDelegate) } - @available(*, deprecated: 3.0, renamed: "signinAnonymously") + @available(swift, deprecated: 3.0, renamed: "signinAnonymously") public func loginAnonymously(accessTokenString:String? = nil, allowCreateNewAnonymousUsers: Bool = true, authorizationDelegate:AuthorizationDelegate) { self.signinAnonymously(accessTokenString: accessTokenString, allowCreateNewAnonymousUsers: allowCreateNewAnonymousUsers, authorizationDelegate: authorizationDelegate) } - @available(*, deprecated: 3.0, renamed: "signinWithResourceOwnerPassword") + @available(swift, deprecated: 3.0, renamed: "signinWithResourceOwnerPassword") public func obtainTokensWithROP(_ accessTokenString:String? = nil, username: String, password: String, tokenResponseDelegate:TokenResponseDelegate) { self.signinWithResourceOwnerPassword(accessTokenString, username: username, password: password, tokenResponseDelegate: tokenResponseDelegate) diff --git a/Source/IBMCloudAppID/internal/RegistrationManager.swift b/Source/IBMCloudAppID/internal/RegistrationManager.swift index 28e40b9..1122859 100644 --- a/Source/IBMCloudAppID/internal/RegistrationManager.swift +++ b/Source/IBMCloudAppID/internal/RegistrationManager.swift @@ -48,7 +48,7 @@ internal class RegistrationManager { internal func privateKeyExist() -> Bool { do { - try SecurityUtils.getKeyRefFromKeyChain(AppIDConstants.privateKeyIdentifier) + try _ = SecurityUtils.getKeyRefFromKeyChain(AppIDConstants.privateKeyIdentifier) return true } catch { return false diff --git a/Source/IBMCloudAppID/internal/TokenManager.swift b/Source/IBMCloudAppID/internal/TokenManager.swift index e8eb59c..f1bf9df 100644 --- a/Source/IBMCloudAppID/internal/TokenManager.swift +++ b/Source/IBMCloudAppID/internal/TokenManager.swift @@ -225,7 +225,8 @@ internal class TokenManager { public func validateToken(token: Token, key: SecKey, tokenResponseDelegate: TokenResponseDelegate, callback: @escaping () -> Void ) { - guard let jws = try? JWS(compactSerialization: token.raw), let _ = try? jws.validate(with: key), + let verifier = Verifier(verifyingAlgorithm: .RS256, publicKey: key)! + guard let jws = try? JWS(compactSerialization: token.raw), let _ = try? jws.validate(using: verifier), let clientId = registrationManager.getRegistrationDataString(name: AppIDConstants.client_id_String) else { tokenResponseDelegate.onAuthorizationFailure(error: .authorizationFailure("Token verification failed")) return