From 3fc597c59066683ebb124621d0aa4dc10e573fdc Mon Sep 17 00:00:00 2001 From: Matthias Steeger Date: Thu, 11 Sep 2014 10:23:34 +0200 Subject: [PATCH 1/7] add of possibility to set oauth_verifier parameter into authorization string --- OAuthCore.h | 4 +++- OAuthCore.m | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OAuthCore.h b/OAuthCore.h index b972be1..3f7d34c 100644 --- a/OAuthCore.h +++ b/OAuthCore.h @@ -13,7 +13,8 @@ extern NSString *OAuthorizationHeader(NSURL *url, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, - NSString *_oAuthTokenSecret); + NSString *_oAuthTokenSecret + NSString *_verifier); extern NSString *OAuthorizationHeaderWithCallback(NSURL *url, NSString *method, @@ -22,4 +23,5 @@ extern NSString *OAuthorizationHeaderWithCallback(NSURL *url, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret, + NSString *_verifier, NSString *_oAuthCallback); diff --git a/OAuthCore.m b/OAuthCore.m index b89015f..dcfc78e 100644 --- a/OAuthCore.m +++ b/OAuthCore.m @@ -27,11 +27,11 @@ static NSInteger SortParameter(NSString *key1, NSString *key2, void *context) { return [NSData dataWithBytes:buf length:CC_SHA1_DIGEST_LENGTH]; } -NSString *OAuthorizationHeader(NSURL *url, NSString *method, NSData *body, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret) { - return OAuthorizationHeaderWithCallback(url, method, body, _oAuthConsumerKey, _oAuthConsumerSecret, _oAuthToken, _oAuthTokenSecret, nil); +NSString *OAuthorizationHeader(NSURL *url, NSString *method, NSData *body, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret, NSString *_verifier) { + return OAuthorizationHeaderWithCallback(url, method, body, _oAuthConsumerKey, _oAuthConsumerSecret, _oAuthToken, _oAuthTokenSecret, _verifier, nil); } -NSString *OAuthorizationHeaderWithCallback(NSURL *url, NSString *method, NSData *body, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret, NSString *_oAuthCallback) { +NSString *OAuthorizationHeaderWithCallback(NSURL *url, NSString *method, NSData *body, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, NSString *_oAuthTokenSecret, NSString *_verifier, NSString *_oAuthCallback) { NSString *_oAuthNonce = [NSString ab_GUID]; NSString *_oAuthTimestamp = [NSString stringWithFormat:@"%d", (int)[[NSDate date] timeIntervalSince1970]]; NSString *_oAuthSignatureMethod = @"HMAC-SHA1"; @@ -47,6 +47,8 @@ static NSInteger SortParameter(NSString *key1, NSString *key2, void *context) { [oAuthAuthorizationParameters setObject:_oAuthToken forKey:@"oauth_token"]; if (_oAuthCallback) [oAuthAuthorizationParameters setObject:_oAuthCallback forKey:@"oauth_callback"]; + if ( _verifier ) + [oAuthAuthorizationParameters setObject:_verifier forKey:@"oauth_verifier"]; // get query and body parameters NSDictionary *additionalQueryParameters = [NSURL ab_parseURLQueryString:[url query]]; From efd92fe2a017c924c1df1a8a8797d81bcaeb7b5c Mon Sep 17 00:00:00 2001 From: Matthias Steeger Date: Thu, 11 Sep 2014 10:44:34 +0200 Subject: [PATCH 2/7] add of local podspec --- OAuthCore.podspec | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 OAuthCore.podspec diff --git a/OAuthCore.podspec b/OAuthCore.podspec new file mode 100644 index 0000000..9d2151d --- /dev/null +++ b/OAuthCore.podspec @@ -0,0 +1,27 @@ +{ + "name": "OAuthCore", + "version": "0.0.1", + "license": "Copyright (C) 2012 Loren Brichter", + "summary": "Simple function to sign OAuth requests.", + "homepage": "https://github.com/atebits/OAuthCore", + "authors": { + "Loren Brichter": "" + }, + "source": { + "git": "https://github.com/atebits/OAuthCore.git", + "commit": "08727c23ae3ce27f9ec2c008d0bc1fbcc0ada20b" + }, + "platforms": { + "ios": null + }, + "source_files": [ + "OAuthCore.{h,m}", + "OAuth+Additions.{h,m}" + ], + "dependencies": { + "NSData+Base64": [ + + ] + }, + "requires_arc": false +} From 8ce43a8987deb72c507c0692c6da9364b51eaa80 Mon Sep 17 00:00:00 2001 From: Matthias Steeger Date: Thu, 11 Sep 2014 10:48:21 +0200 Subject: [PATCH 3/7] rename podspec to podspec.json --- OAuthCore.podspec => OAuthCore.podspec.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename OAuthCore.podspec => OAuthCore.podspec.json (100%) diff --git a/OAuthCore.podspec b/OAuthCore.podspec.json similarity index 100% rename from OAuthCore.podspec rename to OAuthCore.podspec.json From f8c9e3bf6431eb3939663edf2d8b4a0139de3736 Mon Sep 17 00:00:00 2001 From: Matthias Steeger Date: Thu, 11 Sep 2014 11:40:23 +0200 Subject: [PATCH 4/7] ruby DSL podspec --- OAuthCore.podspec | 15 +++++++++++++++ OAuthCore.podspec.json | 27 --------------------------- 2 files changed, 15 insertions(+), 27 deletions(-) create mode 100644 OAuthCore.podspec delete mode 100644 OAuthCore.podspec.json diff --git a/OAuthCore.podspec b/OAuthCore.podspec new file mode 100644 index 0000000..0528030 --- /dev/null +++ b/OAuthCore.podspec @@ -0,0 +1,15 @@ +Pod::Spec.new do |s| + s.name = "OAuthCore" + s.version = "0.0.1" + s.homepage = "https://github.com/atebits/OAuthCore" + s.summary = "<<-DESC + Simple function to sign OAuth requests. + DESC" + + s.authors = "Loren Brichter" + s.requires_arc = false + s.platforms = :ios + s.license = "Copyright (C) 2012 Loren Brichter" + s.source = {:git => 'https://github.com/atebits/OAuthCore.git', :commit => "08727c23ae3ce27f9ec2c008d0bc1fbcc0ada20b"} + s.source_files = "OAuthCore.{h,m}", "OAuth+Additions.{h,m}", "NSData+Base64.{h,m}" +end \ No newline at end of file diff --git a/OAuthCore.podspec.json b/OAuthCore.podspec.json deleted file mode 100644 index 9d2151d..0000000 --- a/OAuthCore.podspec.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "OAuthCore", - "version": "0.0.1", - "license": "Copyright (C) 2012 Loren Brichter", - "summary": "Simple function to sign OAuth requests.", - "homepage": "https://github.com/atebits/OAuthCore", - "authors": { - "Loren Brichter": "" - }, - "source": { - "git": "https://github.com/atebits/OAuthCore.git", - "commit": "08727c23ae3ce27f9ec2c008d0bc1fbcc0ada20b" - }, - "platforms": { - "ios": null - }, - "source_files": [ - "OAuthCore.{h,m}", - "OAuth+Additions.{h,m}" - ], - "dependencies": { - "NSData+Base64": [ - - ] - }, - "requires_arc": false -} From e67a8947624ad0915d90a1d36e8dda16e57541f5 Mon Sep 17 00:00:00 2001 From: Matthias Steeger Date: Thu, 11 Sep 2014 11:50:28 +0200 Subject: [PATCH 5/7] use of base64 pod as dependency --- OAuthCore.podspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OAuthCore.podspec b/OAuthCore.podspec index 0528030..bfe87c6 100644 --- a/OAuthCore.podspec +++ b/OAuthCore.podspec @@ -11,5 +11,6 @@ Pod::Spec.new do |s| s.platforms = :ios s.license = "Copyright (C) 2012 Loren Brichter" s.source = {:git => 'https://github.com/atebits/OAuthCore.git', :commit => "08727c23ae3ce27f9ec2c008d0bc1fbcc0ada20b"} - s.source_files = "OAuthCore.{h,m}", "OAuth+Additions.{h,m}", "NSData+Base64.{h,m}" + s.source_files = "OAuthCore.{h,m}", "OAuth+Additions.{h,m}" + s.dependency "NSData+Base64" end \ No newline at end of file From 6c7de80fc62048660175b004902eb98f1fa334b5 Mon Sep 17 00:00:00 2001 From: Matthias Steeger Date: Thu, 11 Sep 2014 11:58:13 +0200 Subject: [PATCH 6/7] fix of missing comma :( --- OAuthCore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OAuthCore.h b/OAuthCore.h index 3f7d34c..7690481 100644 --- a/OAuthCore.h +++ b/OAuthCore.h @@ -13,7 +13,7 @@ extern NSString *OAuthorizationHeader(NSURL *url, NSString *_oAuthConsumerKey, NSString *_oAuthConsumerSecret, NSString *_oAuthToken, - NSString *_oAuthTokenSecret + NSString *_oAuthTokenSecret, NSString *_verifier); extern NSString *OAuthorizationHeaderWithCallback(NSURL *url, From 50b8afe949e90374100a0cf675c911f0d59e2fd3 Mon Sep 17 00:00:00 2001 From: Iulia Rasinar Date: Thu, 15 Sep 2016 17:17:41 +0200 Subject: [PATCH 7/7] updated podspec file --- OAuthCore.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OAuthCore.podspec b/OAuthCore.podspec index bfe87c6..0e3c507 100644 --- a/OAuthCore.podspec +++ b/OAuthCore.podspec @@ -8,9 +8,9 @@ Pod::Spec.new do |s| s.authors = "Loren Brichter" s.requires_arc = false - s.platforms = :ios + s.platform = :ios s.license = "Copyright (C) 2012 Loren Brichter" s.source = {:git => 'https://github.com/atebits/OAuthCore.git', :commit => "08727c23ae3ce27f9ec2c008d0bc1fbcc0ada20b"} s.source_files = "OAuthCore.{h,m}", "OAuth+Additions.{h,m}" s.dependency "NSData+Base64" -end \ No newline at end of file +end