From 3aad5537ac273c0c0a225bfe69ffe5772546f2df Mon Sep 17 00:00:00 2001 From: Jonas-Taha El Sesiy Date: Thu, 13 Apr 2017 22:14:13 -0500 Subject: [PATCH 1/4] Fix #22 #21 --- Example-iOS/Example-iOS.xcodeproj/project.pbxproj | 2 +- GTMAppAuth.podspec | 2 +- Source/GTMKeychain.h | 2 +- Source/GTMTVAuthorizationRequest.h | 1 - Source/GTMTVAuthorizationResponse.h | 2 +- Source/GTMTVAuthorizationResponse.m | 4 ++-- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Example-iOS/Example-iOS.xcodeproj/project.pbxproj b/Example-iOS/Example-iOS.xcodeproj/project.pbxproj index 3d65a013..54e1bba7 100644 --- a/Example-iOS/Example-iOS.xcodeproj/project.pbxproj +++ b/Example-iOS/Example-iOS.xcodeproj/project.pbxproj @@ -216,7 +216,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/GTMAppAuth.podspec b/GTMAppAuth.podspec index 8c1eeaa1..5770439d 100644 --- a/GTMAppAuth.podspec +++ b/GTMAppAuth.podspec @@ -43,5 +43,5 @@ requests with AppAuth. s.frameworks = 'Security', 'SystemConfiguration' s.dependency 'GTMSessionFetcher', '~> 1.1' - s.dependency 'AppAuth', '~> 0.7.0' + s.dependency 'AppAuth', '~> 0.9.0' end diff --git a/Source/GTMKeychain.h b/Source/GTMKeychain.h index f1dd6ba8..5b52d2fc 100644 --- a/Source/GTMKeychain.h +++ b/Source/GTMKeychain.h @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN /*! @brief Saves the password data to the keychain with the given identifier. @param keychainItemName Keychain name of the item. - @param passwordData Password data to save. + @param password Password data to save. @return YES when the password data was saved successfully. */ + (BOOL)savePasswordDataToKeychainForName:(NSString *)keychainItemName diff --git a/Source/GTMTVAuthorizationRequest.h b/Source/GTMTVAuthorizationRequest.h index eb355916..bbc163bf 100644 --- a/Source/GTMTVAuthorizationRequest.h +++ b/Source/GTMTVAuthorizationRequest.h @@ -34,7 +34,6 @@ NS_ASSUME_NONNULL_BEGIN @param clientID The client identifier. @param clientSecret The client secret. @param scopes An array of scopes to combine into a single scope string per the OAuth2 spec. - @param TVAuthorizationURL The TV & limited input device authorization endpoint URL. @param additionalParameters The client's additional authorization parameters. */ - (instancetype) diff --git a/Source/GTMTVAuthorizationResponse.h b/Source/GTMTVAuthorizationResponse.h index 5f7a76a7..c29c1dc2 100644 --- a/Source/GTMTVAuthorizationResponse.h +++ b/Source/GTMTVAuthorizationResponse.h @@ -69,7 +69,7 @@ extern NSString *const GTMTVDeviceTokenGrantType; properties are populated. Non-normative parameters are placed in the @c #additionalParameters dictionary. */ -- (nullable instancetype)initWithRequest:(GTMTVAuthorizationRequest *)request +- (instancetype)initWithRequest:(GTMTVAuthorizationRequest *)request parameters:(NSDictionary *> *)parameters NS_DESIGNATED_INITIALIZER; diff --git a/Source/GTMTVAuthorizationResponse.m b/Source/GTMTVAuthorizationResponse.m index 399bb890..36c2630a 100644 --- a/Source/GTMTVAuthorizationResponse.m +++ b/Source/GTMTVAuthorizationResponse.m @@ -99,10 +99,10 @@ @implementation GTMTVAuthorizationResponse #pragma mark - Initializers -- (nullable instancetype)init +- (instancetype)init OID_UNAVAILABLE_USE_INITIALIZER(@selector(initWithRequest:parameters:)); -- (nullable instancetype)initWithRequest:(GTMTVAuthorizationRequest *)request +- (instancetype)initWithRequest:(GTMTVAuthorizationRequest *)request parameters:(NSDictionary *> *)parameters { self = [super initWithRequest:request parameters:parameters]; return self; From 8b76e30af306555365f3ab41bbcb2484b495cfa1 Mon Sep 17 00:00:00 2001 From: Jonas-Taha El Sesiy Date: Thu, 13 Apr 2017 22:20:38 -0500 Subject: [PATCH 2/4] Revert Example-iOS project changes --- Example-iOS/Example-iOS.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example-iOS/Example-iOS.xcodeproj/project.pbxproj b/Example-iOS/Example-iOS.xcodeproj/project.pbxproj index 54e1bba7..3d65a013 100644 --- a/Example-iOS/Example-iOS.xcodeproj/project.pbxproj +++ b/Example-iOS/Example-iOS.xcodeproj/project.pbxproj @@ -216,7 +216,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ From 4b8194a3818c7ccda60a303e847f1dbf4aea9ed4 Mon Sep 17 00:00:00 2001 From: Jonas-Taha El Sesiy Date: Mon, 1 May 2017 23:38:57 +0200 Subject: [PATCH 3/4] Update imports --- Source/GTMTVAuthorizationRequest.h | 2 +- Source/GTMTVAuthorizationResponse.h | 2 +- Source/GTMTVServiceConfiguration.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/GTMTVAuthorizationRequest.h b/Source/GTMTVAuthorizationRequest.h index bbc163bf..ca888bfc 100644 --- a/Source/GTMTVAuthorizationRequest.h +++ b/Source/GTMTVAuthorizationRequest.h @@ -18,7 +18,7 @@ #import -#import "OIDAuthorizationRequest.h" +#import @class GTMTVServiceConfiguration; diff --git a/Source/GTMTVAuthorizationResponse.h b/Source/GTMTVAuthorizationResponse.h index c29c1dc2..40b92168 100644 --- a/Source/GTMTVAuthorizationResponse.h +++ b/Source/GTMTVAuthorizationResponse.h @@ -18,7 +18,7 @@ #import -#import "OIDAuthorizationResponse.h" +#import @class GTMTVAuthorizationRequest; @class OIDTokenRequest; diff --git a/Source/GTMTVServiceConfiguration.h b/Source/GTMTVServiceConfiguration.h index 85eb9b0f..bee871b0 100644 --- a/Source/GTMTVServiceConfiguration.h +++ b/Source/GTMTVServiceConfiguration.h @@ -16,7 +16,7 @@ limitations under the License. */ -#import "OIDServiceConfiguration.h" +#import NS_ASSUME_NONNULL_BEGIN From 5eb5c8726dce73efd4427fb41ffe7a407e7fc4d9 Mon Sep 17 00:00:00 2001 From: Jonas-Taha El Sesiy Date: Tue, 11 Jul 2017 20:33:56 +0200 Subject: [PATCH 4/4] Resolve conflicts --- GTMAppAuth.podspec | 3 ++- Source/GTMKeychain.h | 2 +- .../GTMOAuth2KeychainCompatibility.m | 2 +- Source/GTMTVAuthorizationRequest.h | 6 +++++- Source/GTMTVAuthorizationRequest.m | 7 ++++++- Source/GTMTVAuthorizationResponse.h | 6 +++++- Source/GTMTVAuthorizationResponse.m | 10 ++++++++-- Source/GTMTVAuthorizationService.m | 11 ++++++++--- Source/GTMTVServiceConfiguration.h | 6 +++++- Source/GTMTVServiceConfiguration.m | 8 ++++++-- 10 files changed, 47 insertions(+), 14 deletions(-) diff --git a/GTMAppAuth.podspec b/GTMAppAuth.podspec index 5770439d..814b1b6d 100644 --- a/GTMAppAuth.podspec +++ b/GTMAppAuth.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "GTMAppAuth" - s.version = "0.5.1" + s.version = "0.6.1" s.summary = "Authorize GTM Session Fetcher requests with AppAuth via GTMAppAuth" s.description = <<-DESC @@ -22,6 +22,7 @@ requests with AppAuth. s.homepage = "https://github.com/google/GTMAppAuth" s.license = "Apache License, Version 2.0" s.authors = { "William Denniss" => "wdenniss@google.com", + "Zsika Phillip" => "zsika@google.com", } s.source = { :git => "https://github.com/google/GTMAppAuth.git", :tag => s.version } diff --git a/Source/GTMKeychain.h b/Source/GTMKeychain.h index 5b52d2fc..e2b8a58c 100644 --- a/Source/GTMKeychain.h +++ b/Source/GTMKeychain.h @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @return YES when the password data was saved successfully. */ + (BOOL)savePasswordDataToKeychainForName:(NSString *)keychainItemName - passwordData:(NSData *)password; + passwordData:(NSData *)passwordData; /*! @brief Loads the password data from the keychain with the given identifier. @param keychainItemName Keychain name of the item. diff --git a/Source/GTMOAuth2KeychainCompatibility/GTMOAuth2KeychainCompatibility.m b/Source/GTMOAuth2KeychainCompatibility/GTMOAuth2KeychainCompatibility.m index 2f71adc0..5f8e2828 100644 --- a/Source/GTMOAuth2KeychainCompatibility/GTMOAuth2KeychainCompatibility.m +++ b/Source/GTMOAuth2KeychainCompatibility/GTMOAuth2KeychainCompatibility.m @@ -114,7 +114,7 @@ + (GTMAppAuthFetcherAuthorization *)authorizeFromPersistenceString:(NSString *)p clientSecret:clientSecret scope:dict[kOAuth2ScopeKey] redirectURL:redirectURI - responseType:@"token" + responseType:OIDResponseTypeCode state:nil codeVerifier:nil codeChallenge:nil diff --git a/Source/GTMTVAuthorizationRequest.h b/Source/GTMTVAuthorizationRequest.h index ca888bfc..27f7b85f 100644 --- a/Source/GTMTVAuthorizationRequest.h +++ b/Source/GTMTVAuthorizationRequest.h @@ -18,7 +18,11 @@ #import -#import +#ifndef GTMAPPAUTH_USER_IMPORTS +#import +#else // GTMAPPAUTH_USER_IMPORTS +#import "AppAuth.h" +#endif // GTMAPPAUTH_USER_IMPORTS @class GTMTVServiceConfiguration; diff --git a/Source/GTMTVAuthorizationRequest.m b/Source/GTMTVAuthorizationRequest.m index f00d8d55..1b4102e8 100644 --- a/Source/GTMTVAuthorizationRequest.m +++ b/Source/GTMTVAuthorizationRequest.m @@ -18,8 +18,13 @@ #import "GTMTVAuthorizationRequest.h" -#import "OIDScopeUtilities.h" +#ifndef GTMAPPAUTH_USER_IMPORTS +#import +#import +#else // GTMAPPAUTH_USER_IMPORTS +#import "AppAuth.h" #import "OIDURLQueryComponent.h" +#endif // GTMAPPAUTH_USER_IMPORTS #import "GTMTVServiceConfiguration.h" @implementation GTMTVAuthorizationRequest diff --git a/Source/GTMTVAuthorizationResponse.h b/Source/GTMTVAuthorizationResponse.h index 40b92168..12880f5d 100644 --- a/Source/GTMTVAuthorizationResponse.h +++ b/Source/GTMTVAuthorizationResponse.h @@ -18,7 +18,11 @@ #import -#import +#ifndef GTMAPPAUTH_USER_IMPORTS +#import +#else // GTMAPPAUTH_USER_IMPORTS +#import "AppAuth.h" +#endif // GTMAPPAUTH_USER_IMPORTS @class GTMTVAuthorizationRequest; @class OIDTokenRequest; diff --git a/Source/GTMTVAuthorizationResponse.m b/Source/GTMTVAuthorizationResponse.m index 36c2630a..2ec769eb 100644 --- a/Source/GTMTVAuthorizationResponse.m +++ b/Source/GTMTVAuthorizationResponse.m @@ -19,10 +19,16 @@ #import "GTMTVAuthorizationResponse.h" #import "GTMTVAuthorizationRequest.h" +#ifndef GTMAPPAUTH_USER_IMPORTS +#import +#import +#import +#else // GTMAPPAUTH_USER_IMPORTS +#import "AppAuth.h" #import "OIDDefines.h" -#import "OIDError.h" #import "OIDFieldMapping.h" -#import "OIDTokenRequest.h" +#endif // GTMAPPAUTH_USER_IMPORTS + NSString *const GTMTVDeviceTokenGrantType = @"http://oauth.net/grant_type/device/1.0"; diff --git a/Source/GTMTVAuthorizationService.m b/Source/GTMTVAuthorizationService.m index d91804c6..e311a271 100644 --- a/Source/GTMTVAuthorizationService.m +++ b/Source/GTMTVAuthorizationService.m @@ -18,11 +18,16 @@ #import "GTMTVAuthorizationService.h" -#import "OIDAuthState.h" -#import "OIDAuthorizationService.h" +#ifndef GTMAPPAUTH_USER_IMPORTS +#import +#import +#import +#else // GTMAPPAUTH_USER_IMPORTS +#import "AppAuth.h" #import "OIDDefines.h" -#import "OIDErrorUtilities.h" #import "OIDURLQueryComponent.h" +#endif // GTMAPPAUTH_USER_IMPORTS + #import "GTMAppAuthFetcherAuthorization.h" #import "GTMTVAuthorizationRequest.h" #import "GTMTVAuthorizationResponse.h" diff --git a/Source/GTMTVServiceConfiguration.h b/Source/GTMTVServiceConfiguration.h index bee871b0..78045b92 100644 --- a/Source/GTMTVServiceConfiguration.h +++ b/Source/GTMTVServiceConfiguration.h @@ -16,7 +16,11 @@ limitations under the License. */ -#import +#ifndef GTMAPPAUTH_USER_IMPORTS +#import +#else // GTMAPPAUTH_USER_IMPORTS +#import "AppAuth.h" +#endif // GTMAPPAUTH_USER_IMPORTS NS_ASSUME_NONNULL_BEGIN diff --git a/Source/GTMTVServiceConfiguration.m b/Source/GTMTVServiceConfiguration.m index 2f8937ab..560bec2e 100644 --- a/Source/GTMTVServiceConfiguration.m +++ b/Source/GTMTVServiceConfiguration.m @@ -18,9 +18,13 @@ #import "GTMTVServiceConfiguration.h" +#ifndef GTMAPPAUTH_USER_IMPORTS +#import +#import +#else // GTMAPPAUTH_USER_IMPORTS +#import "AppAuth.h" #import "OIDDefines.h" -#import "OIDErrorUtilities.h" -#import "OIDServiceDiscovery.h" +#endif // GTMAPPAUTH_USER_IMPORTS /*! @brief The key for the @c TVAuthorizationEndpoint property. */