diff --git a/NXOAuth2Account+Private.h b/NXOAuth2Account+Private.h index b512ff38..6c7863d2 100644 --- a/NXOAuth2Account+Private.h +++ b/NXOAuth2Account+Private.h @@ -11,14 +11,20 @@ // the full licence. // -#import "NXOAuth2Account.h" +#import + +@protocol NXApplication; @interface NXOAuth2Account (Private) +@property (nonatomic, readonly) id application; + - (instancetype)initAccountWithOAuthClient:(NXOAuth2Client *)oauthClient - accountType:(NSString *)accountType; + accountType:(NSString *)accountType + application:(id)app; - (instancetype)initAccountWithAccessToken:(NXOAuth2AccessToken *)accessToken - accountType:(NSString *)accountType; + accountType:(NSString *)accountType + application:(id)app /*NS_DESIGNATED_INITIALIZER*/ NS_REQUIRES_SUPER; @end diff --git a/OAuth2Client.xcodeproj/project.pbxproj b/OAuth2Client.xcodeproj/project.pbxproj index 9b1d5d82..a269a8f9 100644 --- a/OAuth2Client.xcodeproj/project.pbxproj +++ b/OAuth2Client.xcodeproj/project.pbxproj @@ -7,57 +7,61 @@ objects = { /* Begin PBXBuildFile section */ + 7E13366C1A7FF2050038FEBB /* NXApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E13366B1A7FF2050038FEBB /* NXApplication.h */; }; + 7E769DDB1A7F792D00FC887B /* NSData+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E769DDA1A7F792D00FC887B /* NSData+NXOAuth2.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7E769DDE1A7F794700FC887B /* NSString+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E769DDD1A7F794700FC887B /* NSString+NXOAuth2.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7E769DE01A7F795900FC887B /* NSURL+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E769DDF1A7F795900FC887B /* NSURL+NXOAuth2.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7E769DE21A7F7A1500FC887B /* NXOAuth2Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DE11A7F7A1500FC887B /* NXOAuth2Constants.m */; }; + 7E769DE31A7F7A1500FC887B /* NXOAuth2Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DE11A7F7A1500FC887B /* NXOAuth2Constants.m */; }; + 7E769DE51A7F7A2100FC887B /* NXOAuth2AccountStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DE41A7F7A2100FC887B /* NXOAuth2AccountStore.m */; }; + 7E769DE61A7F7A2100FC887B /* NXOAuth2AccountStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DE41A7F7A2100FC887B /* NXOAuth2AccountStore.m */; }; + 7E769DE81A7F7A2A00FC887B /* NXOAuth2Account.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DE71A7F7A2A00FC887B /* NXOAuth2Account.m */; }; + 7E769DE91A7F7A2A00FC887B /* NXOAuth2Account.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DE71A7F7A2A00FC887B /* NXOAuth2Account.m */; }; + 7E769DEB1A7F7A3100FC887B /* NXOAuth2Request.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DEA1A7F7A3100FC887B /* NXOAuth2Request.m */; }; + 7E769DEC1A7F7A3100FC887B /* NXOAuth2Request.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DEA1A7F7A3100FC887B /* NXOAuth2Request.m */; }; + 7E769DEE1A7F7A4E00FC887B /* NXOAuth2Client.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DED1A7F7A4E00FC887B /* NXOAuth2Client.m */; }; + 7E769DEF1A7F7A4E00FC887B /* NXOAuth2Client.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DED1A7F7A4E00FC887B /* NXOAuth2Client.m */; }; + 7E769DF11A7F7A5700FC887B /* NXOAuth2AccessToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DF01A7F7A5700FC887B /* NXOAuth2AccessToken.m */; }; + 7E769DF21A7F7A5700FC887B /* NXOAuth2AccessToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DF01A7F7A5700FC887B /* NXOAuth2AccessToken.m */; }; + 7E769DF41A7F7A6B00FC887B /* NXOAuth2Connection.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DF31A7F7A6B00FC887B /* NXOAuth2Connection.m */; }; + 7E769DF51A7F7A6B00FC887B /* NXOAuth2Connection.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DF31A7F7A6B00FC887B /* NXOAuth2Connection.m */; }; + 7E769DF71A7F7A7800FC887B /* NXOAuth2PostBodyStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DF61A7F7A7800FC887B /* NXOAuth2PostBodyStream.m */; }; + 7E769DF81A7F7A7800FC887B /* NXOAuth2PostBodyStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DF61A7F7A7800FC887B /* NXOAuth2PostBodyStream.m */; }; + 7E769DFA1A7F7A8300FC887B /* NXOAuth2PostBodyPart.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DF91A7F7A8300FC887B /* NXOAuth2PostBodyPart.m */; }; + 7E769DFB1A7F7A8300FC887B /* NXOAuth2PostBodyPart.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DF91A7F7A8300FC887B /* NXOAuth2PostBodyPart.m */; }; + 7E769DFD1A7F7A8A00FC887B /* NXOAuth2PostBodyPart.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E769DFC1A7F7A8A00FC887B /* NXOAuth2PostBodyPart.h */; }; + 7E769DFE1A7F7A8A00FC887B /* NXOAuth2PostBodyPart.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E769DFC1A7F7A8A00FC887B /* NXOAuth2PostBodyPart.h */; }; + 7E769E001A7F7A9E00FC887B /* NXOAuth2FileStreamWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DFF1A7F7A9E00FC887B /* NXOAuth2FileStreamWrapper.m */; }; + 7E769E011A7F7A9E00FC887B /* NXOAuth2FileStreamWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E769DFF1A7F7A9E00FC887B /* NXOAuth2FileStreamWrapper.m */; }; + 7E769E031A7F7D4700FC887B /* NXOAuth2RequestCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E769E021A7F7D4700FC887B /* NXOAuth2RequestCallbacks.h */; settings = {ATTRIBUTES = (Public, ); }; }; 824D5A6E123F68A8001177D5 /* NXOAuth2ClientDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 824D5A6D123F68A8001177D5 /* NXOAuth2ClientDelegate.h */; settings = {ATTRIBUTES = (); }; }; 9404FAC2123E3A6900397DD1 /* NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 9404FAC1123E3A6900397DD1 /* NXOAuth2.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9404FAC3123E3A6900397DD1 /* NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 9404FAC1123E3A6900397DD1 /* NXOAuth2.h */; settings = {ATTRIBUTES = (); }; }; 9429B3AA12267A3100D31807 /* NXOAuth2Client.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B3A812267A3100D31807 /* NXOAuth2Client.h */; settings = {ATTRIBUTES = (); }; }; - 9429B3AB12267A3100D31807 /* NXOAuth2Client.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B3A912267A3100D31807 /* NXOAuth2Client.m */; }; 9429B4D91226987D00D31807 /* NXOAuth2AccessToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B4D71226987D00D31807 /* NXOAuth2AccessToken.h */; settings = {ATTRIBUTES = (); }; }; - 9429B4DA1226987D00D31807 /* NXOAuth2AccessToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B4D81226987D00D31807 /* NXOAuth2AccessToken.m */; }; 9429B5181226CB5800D31807 /* NXOAuth2Connection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B5161226CB5800D31807 /* NXOAuth2Connection.h */; settings = {ATTRIBUTES = (); }; }; - 9429B5191226CB5800D31807 /* NXOAuth2Connection.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B5171226CB5800D31807 /* NXOAuth2Connection.m */; }; 9429B5341226D7A600D31807 /* NXOAuth2Constants.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B5321226D7A600D31807 /* NXOAuth2Constants.h */; settings = {ATTRIBUTES = (); }; }; - 9429B5351226D7A600D31807 /* NXOAuth2Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B5331226D7A600D31807 /* NXOAuth2Constants.m */; }; 9429B5AE1227C9D100D31807 /* NXOAuth2PostBodyStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B5AC1227C9D100D31807 /* NXOAuth2PostBodyStream.h */; settings = {ATTRIBUTES = (); }; }; - 9429B5AF1227C9D100D31807 /* NXOAuth2PostBodyStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B5AD1227C9D100D31807 /* NXOAuth2PostBodyStream.m */; }; - 9429B5CC1227CCBB00D31807 /* NXOAuth2PostBodyPart.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B5CA1227CCBB00D31807 /* NXOAuth2PostBodyPart.h */; settings = {ATTRIBUTES = (); }; }; - 9429B5CD1227CCBB00D31807 /* NXOAuth2PostBodyPart.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B5CB1227CCBB00D31807 /* NXOAuth2PostBodyPart.m */; }; 9429B6041227CF7700D31807 /* NXOAuth2FileStreamWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B6021227CF7700D31807 /* NXOAuth2FileStreamWrapper.h */; settings = {ATTRIBUTES = (); }; }; - 9429B6051227CF7700D31807 /* NXOAuth2FileStreamWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B6031227CF7700D31807 /* NXOAuth2FileStreamWrapper.m */; }; 9429C47B1227FEA700D31807 /* NXOAuth2ConnectionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429C47A1227FEA700D31807 /* NXOAuth2ConnectionDelegate.h */; settings = {ATTRIBUTES = (); }; }; - 9429C49B1228023D00D31807 /* NSString+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429C4971228023D00D31807 /* NSString+NXOAuth2.h */; settings = {ATTRIBUTES = (); }; }; 9429C49C1228023D00D31807 /* NSString+NXOAuth2.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429C4981228023D00D31807 /* NSString+NXOAuth2.m */; }; - 9429C49D1228023D00D31807 /* NSURL+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429C4991228023D00D31807 /* NSURL+NXOAuth2.h */; settings = {ATTRIBUTES = (); }; }; 9429C49E1228023D00D31807 /* NSURL+NXOAuth2.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429C49A1228023D00D31807 /* NSURL+NXOAuth2.m */; }; - 942FFCE812315EED00E6C65E /* NSString+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429C4971228023D00D31807 /* NSString+NXOAuth2.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 942FFCE912315EED00E6C65E /* NSURL+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429C4991228023D00D31807 /* NSURL+NXOAuth2.h */; settings = {ATTRIBUTES = (Public, ); }; }; 942FFCEA12315EED00E6C65E /* NXOAuth2AccessToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B4D71226987D00D31807 /* NXOAuth2AccessToken.h */; settings = {ATTRIBUTES = (Public, ); }; }; 942FFCEB12315EED00E6C65E /* NXOAuth2Client.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B3A812267A3100D31807 /* NXOAuth2Client.h */; settings = {ATTRIBUTES = (Public, ); }; }; 942FFCEC12315EED00E6C65E /* NXOAuth2Connection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B5161226CB5800D31807 /* NXOAuth2Connection.h */; settings = {ATTRIBUTES = (Public, ); }; }; 942FFCED12315EED00E6C65E /* NXOAuth2ConnectionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429C47A1227FEA700D31807 /* NXOAuth2ConnectionDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 942FFCEE12315EED00E6C65E /* NXOAuth2Constants.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B5321226D7A600D31807 /* NXOAuth2Constants.h */; settings = {ATTRIBUTES = (Public, ); }; }; 942FFCEF12315EED00E6C65E /* NXOAuth2FileStreamWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B6021227CF7700D31807 /* NXOAuth2FileStreamWrapper.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 942FFCF012315EED00E6C65E /* NXOAuth2PostBodyPart.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B5CA1227CCBB00D31807 /* NXOAuth2PostBodyPart.h */; settings = {ATTRIBUTES = (); }; }; 942FFCF112315EED00E6C65E /* NXOAuth2PostBodyStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 9429B5AC1227C9D100D31807 /* NXOAuth2PostBodyStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; 942FFCF312315EED00E6C65E /* OAuth2Client_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* OAuth2Client_Prefix.pch */; }; 942FFCF512315EF500E6C65E /* NSString+NXOAuth2.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429C4981228023D00D31807 /* NSString+NXOAuth2.m */; }; 942FFCF612315EF500E6C65E /* NSURL+NXOAuth2.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429C49A1228023D00D31807 /* NSURL+NXOAuth2.m */; }; - 942FFCF712315EF500E6C65E /* NXOAuth2AccessToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B4D81226987D00D31807 /* NXOAuth2AccessToken.m */; }; - 942FFCF812315EF500E6C65E /* NXOAuth2Client.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B3A912267A3100D31807 /* NXOAuth2Client.m */; }; - 942FFCF912315EF500E6C65E /* NXOAuth2Connection.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B5171226CB5800D31807 /* NXOAuth2Connection.m */; }; - 942FFCFA12315EF500E6C65E /* NXOAuth2Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B5331226D7A600D31807 /* NXOAuth2Constants.m */; }; - 942FFCFB12315EF500E6C65E /* NXOAuth2FileStreamWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B6031227CF7700D31807 /* NXOAuth2FileStreamWrapper.m */; }; - 942FFCFC12315EF500E6C65E /* NXOAuth2PostBodyPart.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B5CB1227CCBB00D31807 /* NXOAuth2PostBodyPart.m */; }; - 942FFCFD12315EF500E6C65E /* NXOAuth2PostBodyStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 9429B5AD1227C9D100D31807 /* NXOAuth2PostBodyStream.m */; }; 942FFCFE12315EFC00E6C65E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; }; 942FFD7E12315EFF00E6C65E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94E5AC92122C097B00C7021A /* Security.framework */; }; 945A500D123F7BAE00A6F2EB /* NXOAuth2ClientDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 824D5A6D123F68A8001177D5 /* NXOAuth2ClientDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94B6CE7219C1D3E400AA859B /* NXOAuth2PostBodyStreamSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 94B6CE7119C1D3E400AA859B /* NXOAuth2PostBodyStreamSpec.m */; }; - 94B6CE8119C1EECC00AA859B /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 94B6CE8019C1EECC00AA859B /* Info.plist */; }; 94CCDD2219C1F29E00F9F148 /* libOAuth2Client.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2AAC07E0554694100DB518D /* libOAuth2Client.a */; }; 94E5AC93122C097B00C7021A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94E5AC92122C097B00C7021A /* Security.framework */; }; - 99D8A7F913852C6E00E3073C /* NSData+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 99D8A7F713852C6E00E3073C /* NSData+NXOAuth2.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 99D8A7FA13852C6E00E3073C /* NSData+NXOAuth2.h in Headers */ = {isa = PBXBuildFile; fileRef = 99D8A7F713852C6E00E3073C /* NSData+NXOAuth2.h */; }; 99D8A7FF13852D3600E3073C /* NSData+NXOAuth2.m in Sources */ = {isa = PBXBuildFile; fileRef = 99D8A7FE13852D3600E3073C /* NSData+NXOAuth2.m */; }; 99D8A80013852D3600E3073C /* NSData+NXOAuth2.m in Sources */ = {isa = PBXBuildFile; fileRef = 99D8A7FE13852D3600E3073C /* NSData+NXOAuth2.m */; }; 99F08DEA138BE8CE002A5401 /* NXOAuth2TrustDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 99F08DE9138BE8CE002A5401 /* NXOAuth2TrustDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -69,42 +73,41 @@ F6525B4613D593C900ACAE8F /* NXOAuth2Account+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = F6525B4313D593C900ACAE8F /* NXOAuth2Account+Private.h */; }; F65713CE13CC87FD00C8A33A /* NXOAuth2AccountStore.h in Headers */ = {isa = PBXBuildFile; fileRef = F65713CC13CC87FD00C8A33A /* NXOAuth2AccountStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; F65713CF13CC87FD00C8A33A /* NXOAuth2AccountStore.h in Headers */ = {isa = PBXBuildFile; fileRef = F65713CC13CC87FD00C8A33A /* NXOAuth2AccountStore.h */; }; - F65713D013CC87FD00C8A33A /* NXOAuth2AccountStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F65713CD13CC87FD00C8A33A /* NXOAuth2AccountStore.m */; }; - F65713D113CC87FD00C8A33A /* NXOAuth2AccountStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F65713CD13CC87FD00C8A33A /* NXOAuth2AccountStore.m */; }; F68B9A0913CDA5BC001CA749 /* NXOAuth2Request.h in Headers */ = {isa = PBXBuildFile; fileRef = F68B9A0613CDA5BC001CA749 /* NXOAuth2Request.h */; }; F6B39C7013CC8A3200B43FE0 /* NXOAuth2Account.h in Headers */ = {isa = PBXBuildFile; fileRef = F6B39C6E13CC8A3200B43FE0 /* NXOAuth2Account.h */; settings = {ATTRIBUTES = (Public, ); }; }; F6B39C7113CC8A3200B43FE0 /* NXOAuth2Account.h in Headers */ = {isa = PBXBuildFile; fileRef = F6B39C6E13CC8A3200B43FE0 /* NXOAuth2Account.h */; }; - F6B39C7213CC8A3200B43FE0 /* NXOAuth2Account.m in Sources */ = {isa = PBXBuildFile; fileRef = F6B39C6F13CC8A3200B43FE0 /* NXOAuth2Account.m */; }; - F6B39C7313CC8A3200B43FE0 /* NXOAuth2Account.m in Sources */ = {isa = PBXBuildFile; fileRef = F6B39C6F13CC8A3200B43FE0 /* NXOAuth2Account.m */; }; - F6B39C7813CC980500B43FE0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6B39C7713CC980500B43FE0 /* UIKit.framework */; }; F6B39C7A13CC981400B43FE0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6B39C7913CC981400B43FE0 /* Cocoa.framework */; }; - F6CEFD8F13CDDE6C00F19E55 /* NXOAuth2Request.m in Sources */ = {isa = PBXBuildFile; fileRef = F6CEFD8D13CDD83B00F19E55 /* NXOAuth2Request.m */; }; F6F2746913CEF9250090EA04 /* NXOAuth2Request.h in Headers */ = {isa = PBXBuildFile; fileRef = F68B9A0613CDA5BC001CA749 /* NXOAuth2Request.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F6F2746A13CEF9280090EA04 /* NXOAuth2Request.m in Sources */ = {isa = PBXBuildFile; fileRef = F6CEFD8D13CDD83B00F19E55 /* NXOAuth2Request.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 7E13366B1A7FF2050038FEBB /* NXApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXApplication.h; sourceTree = ""; }; + 7E769DDA1A7F792D00FC887B /* NSData+NXOAuth2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+NXOAuth2.h"; path = "OAuth2Client/NSData+NXOAuth2.h"; sourceTree = SOURCE_ROOT; }; + 7E769DDD1A7F794700FC887B /* NSString+NXOAuth2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+NXOAuth2.h"; path = "OAuth2Client/NSString+NXOAuth2.h"; sourceTree = SOURCE_ROOT; }; + 7E769DDF1A7F795900FC887B /* NSURL+NXOAuth2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSURL+NXOAuth2.h"; path = "OAuth2Client/NSURL+NXOAuth2.h"; sourceTree = SOURCE_ROOT; }; + 7E769DE11A7F7A1500FC887B /* NXOAuth2Constants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2Constants.m; path = Sources/OAuth2Client/NXOAuth2Constants.m; sourceTree = SOURCE_ROOT; }; + 7E769DE41A7F7A2100FC887B /* NXOAuth2AccountStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2AccountStore.m; path = Sources/OAuth2Client/NXOAuth2AccountStore.m; sourceTree = SOURCE_ROOT; }; + 7E769DE71A7F7A2A00FC887B /* NXOAuth2Account.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2Account.m; path = Sources/OAuth2Client/NXOAuth2Account.m; sourceTree = SOURCE_ROOT; }; + 7E769DEA1A7F7A3100FC887B /* NXOAuth2Request.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2Request.m; path = Sources/OAuth2Client/NXOAuth2Request.m; sourceTree = SOURCE_ROOT; }; + 7E769DED1A7F7A4E00FC887B /* NXOAuth2Client.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2Client.m; path = Sources/OAuth2Client/NXOAuth2Client.m; sourceTree = SOURCE_ROOT; }; + 7E769DF01A7F7A5700FC887B /* NXOAuth2AccessToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2AccessToken.m; path = Sources/OAuth2Client/NXOAuth2AccessToken.m; sourceTree = SOURCE_ROOT; }; + 7E769DF31A7F7A6B00FC887B /* NXOAuth2Connection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2Connection.m; path = Sources/OAuth2Client/NXOAuth2Connection.m; sourceTree = SOURCE_ROOT; }; + 7E769DF61A7F7A7800FC887B /* NXOAuth2PostBodyStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2PostBodyStream.m; path = Sources/OAuth2Client/NXOAuth2PostBodyStream.m; sourceTree = SOURCE_ROOT; }; + 7E769DF91A7F7A8300FC887B /* NXOAuth2PostBodyPart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2PostBodyPart.m; path = Sources/OAuth2Client/NXOAuth2PostBodyPart.m; sourceTree = SOURCE_ROOT; }; + 7E769DFC1A7F7A8A00FC887B /* NXOAuth2PostBodyPart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NXOAuth2PostBodyPart.h; path = Sources/OAuth2Client/NXOAuth2PostBodyPart.h; sourceTree = SOURCE_ROOT; }; + 7E769DFF1A7F7A9E00FC887B /* NXOAuth2FileStreamWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NXOAuth2FileStreamWrapper.m; path = Sources/OAuth2Client/NXOAuth2FileStreamWrapper.m; sourceTree = SOURCE_ROOT; }; + 7E769E021A7F7D4700FC887B /* NXOAuth2RequestCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2RequestCallbacks.h; sourceTree = ""; }; 824D5A6D123F68A8001177D5 /* NXOAuth2ClientDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2ClientDelegate.h; sourceTree = ""; }; 83DD991B6049465CB61E135B /* Pods-OAuth2ClientTests.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OAuth2ClientTests.xcconfig"; path = "Pods/Pods-OAuth2ClientTests.xcconfig"; sourceTree = ""; }; 9404FAC1123E3A6900397DD1 /* NXOAuth2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2.h; sourceTree = ""; }; 9429B3A812267A3100D31807 /* NXOAuth2Client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2Client.h; sourceTree = ""; }; - 9429B3A912267A3100D31807 /* NXOAuth2Client.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2Client.m; sourceTree = ""; }; 9429B4D71226987D00D31807 /* NXOAuth2AccessToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2AccessToken.h; sourceTree = ""; }; - 9429B4D81226987D00D31807 /* NXOAuth2AccessToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2AccessToken.m; sourceTree = ""; }; 9429B5161226CB5800D31807 /* NXOAuth2Connection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2Connection.h; sourceTree = ""; wrapsLines = 0; }; - 9429B5171226CB5800D31807 /* NXOAuth2Connection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2Connection.m; sourceTree = ""; }; 9429B5321226D7A600D31807 /* NXOAuth2Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2Constants.h; sourceTree = ""; }; - 9429B5331226D7A600D31807 /* NXOAuth2Constants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2Constants.m; sourceTree = ""; }; 9429B5AC1227C9D100D31807 /* NXOAuth2PostBodyStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2PostBodyStream.h; sourceTree = ""; }; - 9429B5AD1227C9D100D31807 /* NXOAuth2PostBodyStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2PostBodyStream.m; sourceTree = ""; }; - 9429B5CA1227CCBB00D31807 /* NXOAuth2PostBodyPart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2PostBodyPart.h; sourceTree = ""; }; - 9429B5CB1227CCBB00D31807 /* NXOAuth2PostBodyPart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2PostBodyPart.m; sourceTree = ""; }; 9429B6021227CF7700D31807 /* NXOAuth2FileStreamWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2FileStreamWrapper.h; sourceTree = ""; }; - 9429B6031227CF7700D31807 /* NXOAuth2FileStreamWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2FileStreamWrapper.m; sourceTree = ""; }; 9429C47A1227FEA700D31807 /* NXOAuth2ConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2ConnectionDelegate.h; sourceTree = ""; }; - 9429C4971228023D00D31807 /* NSString+NXOAuth2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+NXOAuth2.h"; sourceTree = ""; }; 9429C4981228023D00D31807 /* NSString+NXOAuth2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+NXOAuth2.m"; sourceTree = ""; }; - 9429C4991228023D00D31807 /* NSURL+NXOAuth2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+NXOAuth2.h"; sourceTree = ""; }; 9429C49A1228023D00D31807 /* NSURL+NXOAuth2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+NXOAuth2.m"; sourceTree = ""; }; 942FFCD612315E0A00E6C65E /* OAuth2Client.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OAuth2Client.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 94B6CE6619C1D0A200AA859B /* OAuth2ClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OAuth2ClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -113,7 +116,6 @@ 94B6CE8019C1EECC00AA859B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 94E5AC92122C097B00C7021A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 94E5B276122D457400C7021A /* OAuth2Client.framework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "OAuth2Client.framework-Info.plist"; sourceTree = ""; }; - 99D8A7F713852C6E00E3073C /* NSData+NXOAuth2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+NXOAuth2.h"; sourceTree = ""; }; 99D8A7FE13852D3600E3073C /* NSData+NXOAuth2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+NXOAuth2.m"; sourceTree = ""; }; 99F08DE9138BE8CE002A5401 /* NXOAuth2TrustDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2TrustDelegate.h; sourceTree = ""; }; AA747D9E0F9514B9006C5449 /* OAuth2Client_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAuth2Client_Prefix.pch; sourceTree = ""; }; @@ -122,13 +124,9 @@ D2AAC07E0554694100DB518D /* libOAuth2Client.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libOAuth2Client.a; sourceTree = BUILT_PRODUCTS_DIR; }; F6525B4313D593C900ACAE8F /* NXOAuth2Account+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NXOAuth2Account+Private.h"; sourceTree = SOURCE_ROOT; }; F65713CC13CC87FD00C8A33A /* NXOAuth2AccountStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2AccountStore.h; sourceTree = ""; }; - F65713CD13CC87FD00C8A33A /* NXOAuth2AccountStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2AccountStore.m; sourceTree = ""; }; F68B9A0613CDA5BC001CA749 /* NXOAuth2Request.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2Request.h; sourceTree = ""; }; F6B39C6E13CC8A3200B43FE0 /* NXOAuth2Account.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NXOAuth2Account.h; sourceTree = ""; }; - F6B39C6F13CC8A3200B43FE0 /* NXOAuth2Account.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2Account.m; sourceTree = ""; }; - F6B39C7713CC980500B43FE0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; F6B39C7913CC981400B43FE0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - F6CEFD8D13CDD83B00F19E55 /* NXOAuth2Request.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NXOAuth2Request.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -155,7 +153,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F6B39C7813CC980500B43FE0 /* UIKit.framework in Frameworks */, AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */, 94E5AC93122C097B00C7021A /* Security.framework in Frameworks */, ); @@ -191,7 +188,6 @@ isa = PBXGroup; children = ( F6B39C7913CC981400B43FE0 /* Cocoa.framework */, - F6B39C7713CC980500B43FE0 /* UIKit.framework */, AACBBE490F95108600F1A2B1 /* Foundation.framework */, 94E5AC92122C097B00C7021A /* Security.framework */, B9E2089E9E7941B7AF3D27AA /* libPods-OAuth2ClientTests.a */, @@ -214,18 +210,20 @@ children = ( F6E1A11313D7128100B6DAC3 /* Private */, 9404FAC1123E3A6900397DD1 /* NXOAuth2.h */, + 7E13366B1A7FF2050038FEBB /* NXApplication.h */, 9429B5321226D7A600D31807 /* NXOAuth2Constants.h */, - 9429B5331226D7A600D31807 /* NXOAuth2Constants.m */, + 7E769DE11A7F7A1500FC887B /* NXOAuth2Constants.m */, F65713CC13CC87FD00C8A33A /* NXOAuth2AccountStore.h */, - F65713CD13CC87FD00C8A33A /* NXOAuth2AccountStore.m */, + 7E769DE41A7F7A2100FC887B /* NXOAuth2AccountStore.m */, F6B39C6E13CC8A3200B43FE0 /* NXOAuth2Account.h */, - F6B39C6F13CC8A3200B43FE0 /* NXOAuth2Account.m */, + 7E769DE71A7F7A2A00FC887B /* NXOAuth2Account.m */, F68B9A0613CDA5BC001CA749 /* NXOAuth2Request.h */, - F6CEFD8D13CDD83B00F19E55 /* NXOAuth2Request.m */, + 7E769DEA1A7F7A3100FC887B /* NXOAuth2Request.m */, F6F2746B13CF0A440090EA04 /* Client */, 9429B5AB1227C9BD00D31807 /* Connection */, ); - path = OAuth2Client; + name = OAuth2Client; + path = ../OAuth2Client; sourceTree = ""; }; 9429B5AB1227C9BD00D31807 /* Connection */ = { @@ -234,13 +232,14 @@ 99F08DE9138BE8CE002A5401 /* NXOAuth2TrustDelegate.h */, 9429C47A1227FEA700D31807 /* NXOAuth2ConnectionDelegate.h */, 9429B5161226CB5800D31807 /* NXOAuth2Connection.h */, - 9429B5171226CB5800D31807 /* NXOAuth2Connection.m */, + 7E769DF31A7F7A6B00FC887B /* NXOAuth2Connection.m */, 9429B5AC1227C9D100D31807 /* NXOAuth2PostBodyStream.h */, - 9429B5AD1227C9D100D31807 /* NXOAuth2PostBodyStream.m */, - 9429B5CA1227CCBB00D31807 /* NXOAuth2PostBodyPart.h */, - 9429B5CB1227CCBB00D31807 /* NXOAuth2PostBodyPart.m */, + 7E769DF61A7F7A7800FC887B /* NXOAuth2PostBodyStream.m */, + 7E769DFC1A7F7A8A00FC887B /* NXOAuth2PostBodyPart.h */, + 7E769DF91A7F7A8300FC887B /* NXOAuth2PostBodyPart.m */, 9429B6021227CF7700D31807 /* NXOAuth2FileStreamWrapper.h */, - 9429B6031227CF7700D31807 /* NXOAuth2FileStreamWrapper.m */, + 7E769DFF1A7F7A9E00FC887B /* NXOAuth2FileStreamWrapper.m */, + 7E769E021A7F7D4700FC887B /* NXOAuth2RequestCallbacks.h */, ); name = Connection; sourceTree = ""; @@ -248,11 +247,11 @@ 9429C491122801F300D31807 /* CocoaAdditions */ = { isa = PBXGroup; children = ( - 99D8A7F713852C6E00E3073C /* NSData+NXOAuth2.h */, + 7E769DDA1A7F792D00FC887B /* NSData+NXOAuth2.h */, 99D8A7FE13852D3600E3073C /* NSData+NXOAuth2.m */, - 9429C4971228023D00D31807 /* NSString+NXOAuth2.h */, + 7E769DDD1A7F794700FC887B /* NSString+NXOAuth2.h */, 9429C4981228023D00D31807 /* NSString+NXOAuth2.m */, - 9429C4991228023D00D31807 /* NSURL+NXOAuth2.h */, + 7E769DDF1A7F795900FC887B /* NSURL+NXOAuth2.h */, 9429C49A1228023D00D31807 /* NSURL+NXOAuth2.m */, ); name = CocoaAdditions; @@ -289,9 +288,9 @@ children = ( 824D5A6D123F68A8001177D5 /* NXOAuth2ClientDelegate.h */, 9429B3A812267A3100D31807 /* NXOAuth2Client.h */, - 9429B3A912267A3100D31807 /* NXOAuth2Client.m */, + 7E769DED1A7F7A4E00FC887B /* NXOAuth2Client.m */, 9429B4D71226987D00D31807 /* NXOAuth2AccessToken.h */, - 9429B4D81226987D00D31807 /* NXOAuth2AccessToken.m */, + 7E769DF01A7F7A5700FC887B /* NXOAuth2AccessToken.m */, ); name = Client; sourceTree = ""; @@ -304,20 +303,22 @@ buildActionMask = 2147483647; files = ( 945A500D123F7BAE00A6F2EB /* NXOAuth2ClientDelegate.h in Headers */, - 942FFCE812315EED00E6C65E /* NSString+NXOAuth2.h in Headers */, - 942FFCE912315EED00E6C65E /* NSURL+NXOAuth2.h in Headers */, 942FFCEA12315EED00E6C65E /* NXOAuth2AccessToken.h in Headers */, 942FFCEB12315EED00E6C65E /* NXOAuth2Client.h in Headers */, + 7E13366C1A7FF2050038FEBB /* NXApplication.h in Headers */, + 7E769DDE1A7F794700FC887B /* NSString+NXOAuth2.h in Headers */, 942FFCEC12315EED00E6C65E /* NXOAuth2Connection.h in Headers */, + 7E769DE01A7F795900FC887B /* NSURL+NXOAuth2.h in Headers */, + 7E769E031A7F7D4700FC887B /* NXOAuth2RequestCallbacks.h in Headers */, 942FFCED12315EED00E6C65E /* NXOAuth2ConnectionDelegate.h in Headers */, 942FFCEE12315EED00E6C65E /* NXOAuth2Constants.h in Headers */, 942FFCEF12315EED00E6C65E /* NXOAuth2FileStreamWrapper.h in Headers */, - 942FFCF012315EED00E6C65E /* NXOAuth2PostBodyPart.h in Headers */, + 7E769DDB1A7F792D00FC887B /* NSData+NXOAuth2.h in Headers */, 942FFCF112315EED00E6C65E /* NXOAuth2PostBodyStream.h in Headers */, + 7E769DFD1A7F7A8A00FC887B /* NXOAuth2PostBodyPart.h in Headers */, 99F08DEA138BE8CE002A5401 /* NXOAuth2TrustDelegate.h in Headers */, 942FFCF312315EED00E6C65E /* OAuth2Client_Prefix.pch in Headers */, 9404FAC2123E3A6900397DD1 /* NXOAuth2.h in Headers */, - 99D8A7F913852C6E00E3073C /* NSData+NXOAuth2.h in Headers */, F65713CE13CC87FD00C8A33A /* NXOAuth2AccountStore.h in Headers */, F6B39C7013CC8A3200B43FE0 /* NXOAuth2Account.h in Headers */, F6F2746913CEF9250090EA04 /* NXOAuth2Request.h in Headers */, @@ -330,7 +331,6 @@ buildActionMask = 2147483647; files = ( AA747D9F0F9514B9006C5449 /* OAuth2Client_Prefix.pch in Headers */, - 9429B5CC1227CCBB00D31807 /* NXOAuth2PostBodyPart.h in Headers */, 9429B3AA12267A3100D31807 /* NXOAuth2Client.h in Headers */, 9429B4D91226987D00D31807 /* NXOAuth2AccessToken.h in Headers */, 9429B5181226CB5800D31807 /* NXOAuth2Connection.h in Headers */, @@ -338,15 +338,13 @@ 9429B5AE1227C9D100D31807 /* NXOAuth2PostBodyStream.h in Headers */, 9429B6041227CF7700D31807 /* NXOAuth2FileStreamWrapper.h in Headers */, 9429C47B1227FEA700D31807 /* NXOAuth2ConnectionDelegate.h in Headers */, - 9429C49B1228023D00D31807 /* NSString+NXOAuth2.h in Headers */, - 9429C49D1228023D00D31807 /* NSURL+NXOAuth2.h in Headers */, 9404FAC3123E3A6900397DD1 /* NXOAuth2.h in Headers */, 824D5A6E123F68A8001177D5 /* NXOAuth2ClientDelegate.h in Headers */, - 99D8A7FA13852C6E00E3073C /* NSData+NXOAuth2.h in Headers */, 99F08DEB138BE8CE002A5401 /* NXOAuth2TrustDelegate.h in Headers */, F65713CF13CC87FD00C8A33A /* NXOAuth2AccountStore.h in Headers */, F6B39C7113CC8A3200B43FE0 /* NXOAuth2Account.h in Headers */, F68B9A0913CDA5BC001CA749 /* NXOAuth2Request.h in Headers */, + 7E769DFE1A7F7A8A00FC887B /* NXOAuth2PostBodyPart.h in Headers */, F6525B4613D593C900ACAE8F /* NXOAuth2Account+Private.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -414,7 +412,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0610; ORGANIZATIONNAME = nxtbgthng; TargetAttributes = { 94B6CE6519C1D0A200AA859B = { @@ -456,7 +454,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 94B6CE8119C1EECC00AA859B /* Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -502,17 +499,17 @@ files = ( 942FFCF512315EF500E6C65E /* NSString+NXOAuth2.m in Sources */, 942FFCF612315EF500E6C65E /* NSURL+NXOAuth2.m in Sources */, - 942FFCF712315EF500E6C65E /* NXOAuth2AccessToken.m in Sources */, - 942FFCF812315EF500E6C65E /* NXOAuth2Client.m in Sources */, - 942FFCF912315EF500E6C65E /* NXOAuth2Connection.m in Sources */, - 942FFCFA12315EF500E6C65E /* NXOAuth2Constants.m in Sources */, - 942FFCFB12315EF500E6C65E /* NXOAuth2FileStreamWrapper.m in Sources */, - 942FFCFC12315EF500E6C65E /* NXOAuth2PostBodyPart.m in Sources */, - 942FFCFD12315EF500E6C65E /* NXOAuth2PostBodyStream.m in Sources */, + 7E769DF41A7F7A6B00FC887B /* NXOAuth2Connection.m in Sources */, + 7E769DE81A7F7A2A00FC887B /* NXOAuth2Account.m in Sources */, + 7E769DF71A7F7A7800FC887B /* NXOAuth2PostBodyStream.m in Sources */, + 7E769DFA1A7F7A8300FC887B /* NXOAuth2PostBodyPart.m in Sources */, + 7E769DEB1A7F7A3100FC887B /* NXOAuth2Request.m in Sources */, + 7E769E001A7F7A9E00FC887B /* NXOAuth2FileStreamWrapper.m in Sources */, + 7E769DEE1A7F7A4E00FC887B /* NXOAuth2Client.m in Sources */, + 7E769DE51A7F7A2100FC887B /* NXOAuth2AccountStore.m in Sources */, 99D8A7FF13852D3600E3073C /* NSData+NXOAuth2.m in Sources */, - F65713D013CC87FD00C8A33A /* NXOAuth2AccountStore.m in Sources */, - F6B39C7213CC8A3200B43FE0 /* NXOAuth2Account.m in Sources */, - F6F2746A13CEF9280090EA04 /* NXOAuth2Request.m in Sources */, + 7E769DF11A7F7A5700FC887B /* NXOAuth2AccessToken.m in Sources */, + 7E769DE21A7F7A1500FC887B /* NXOAuth2Constants.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -528,19 +525,19 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9429B3AB12267A3100D31807 /* NXOAuth2Client.m in Sources */, - 9429B4DA1226987D00D31807 /* NXOAuth2AccessToken.m in Sources */, - 9429B5191226CB5800D31807 /* NXOAuth2Connection.m in Sources */, - 9429B5351226D7A600D31807 /* NXOAuth2Constants.m in Sources */, - 9429B5AF1227C9D100D31807 /* NXOAuth2PostBodyStream.m in Sources */, - 9429B5CD1227CCBB00D31807 /* NXOAuth2PostBodyPart.m in Sources */, - 9429B6051227CF7700D31807 /* NXOAuth2FileStreamWrapper.m in Sources */, + 7E769DE91A7F7A2A00FC887B /* NXOAuth2Account.m in Sources */, + 7E769DF51A7F7A6B00FC887B /* NXOAuth2Connection.m in Sources */, + 7E769DEC1A7F7A3100FC887B /* NXOAuth2Request.m in Sources */, + 7E769DF81A7F7A7800FC887B /* NXOAuth2PostBodyStream.m in Sources */, + 7E769DFB1A7F7A8300FC887B /* NXOAuth2PostBodyPart.m in Sources */, + 7E769DEF1A7F7A4E00FC887B /* NXOAuth2Client.m in Sources */, + 7E769E011A7F7A9E00FC887B /* NXOAuth2FileStreamWrapper.m in Sources */, + 7E769DE61A7F7A2100FC887B /* NXOAuth2AccountStore.m in Sources */, 9429C49C1228023D00D31807 /* NSString+NXOAuth2.m in Sources */, 9429C49E1228023D00D31807 /* NSURL+NXOAuth2.m in Sources */, 99D8A80013852D3600E3073C /* NSData+NXOAuth2.m in Sources */, - F65713D113CC87FD00C8A33A /* NXOAuth2AccountStore.m in Sources */, - F6B39C7313CC8A3200B43FE0 /* NXOAuth2Account.m in Sources */, - F6CEFD8F13CDDE6C00F19E55 /* NXOAuth2Request.m in Sources */, + 7E769DF21A7F7A5700FC887B /* NXOAuth2AccessToken.m in Sources */, + 7E769DE31A7F7A1500FC887B /* NXOAuth2Constants.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -551,7 +548,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; DSTROOT = /tmp/OAuth2Client.dst; @@ -574,7 +570,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; DSTROOT = /tmp/OAuth2Client.dst; GCC_MODEL_TUNING = G5; @@ -593,10 +588,32 @@ 1DEB922308733DC00010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; @@ -607,9 +624,31 @@ 1DEB922408733DC00010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -621,7 +660,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; @@ -651,7 +689,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; diff --git a/Sources/NSData+NXOAuth2.h b/OAuth2Client/NSData+NXOAuth2.h similarity index 100% rename from Sources/NSData+NXOAuth2.h rename to OAuth2Client/NSData+NXOAuth2.h diff --git a/Sources/NSString+NXOAuth2.h b/OAuth2Client/NSString+NXOAuth2.h similarity index 100% rename from Sources/NSString+NXOAuth2.h rename to OAuth2Client/NSString+NXOAuth2.h diff --git a/Sources/NSURL+NXOAuth2.h b/OAuth2Client/NSURL+NXOAuth2.h similarity index 100% rename from Sources/NSURL+NXOAuth2.h rename to OAuth2Client/NSURL+NXOAuth2.h diff --git a/OAuth2Client/NXApplication.h b/OAuth2Client/NXApplication.h new file mode 100644 index 00000000..e8e080a8 --- /dev/null +++ b/OAuth2Client/NXApplication.h @@ -0,0 +1,15 @@ +// +// NXApplication.h +// OAuth2Client +// +// Created by Oleksandr Dodatko on 2/2/15. +// Copyright (c) 2015 nxtbgthng. All rights reserved. +// + +#import + +@protocol NXApplication + +-(BOOL)openURL:(NSURL*)url; + +@end diff --git a/OAuth2Client/NXOAuth2.h b/OAuth2Client/NXOAuth2.h new file mode 100644 index 00000000..8927af0f --- /dev/null +++ b/OAuth2Client/NXOAuth2.h @@ -0,0 +1,33 @@ +// +// NXOAuth2.h +// OAuth2Client +// +// Created by Ullrich Schäfer on 13.09.10. +// +// Copyright 2010 nxtbgthng. All rights reserved. +// +// Licenced under the new BSD-licence. +// See README.md in this repository for +// the full licence. +// + + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#pragma mark Helpers + +#import +#import +#import diff --git a/Sources/OAuth2Client/NXOAuth2AccessToken.h b/OAuth2Client/NXOAuth2AccessToken.h similarity index 100% rename from Sources/OAuth2Client/NXOAuth2AccessToken.h rename to OAuth2Client/NXOAuth2AccessToken.h diff --git a/Sources/OAuth2Client/NXOAuth2Account.h b/OAuth2Client/NXOAuth2Account.h similarity index 100% rename from Sources/OAuth2Client/NXOAuth2Account.h rename to OAuth2Client/NXOAuth2Account.h diff --git a/Sources/OAuth2Client/NXOAuth2AccountStore.h b/OAuth2Client/NXOAuth2AccountStore.h similarity index 94% rename from Sources/OAuth2Client/NXOAuth2AccountStore.h rename to OAuth2Client/NXOAuth2AccountStore.h index 0a5bc74a..0fd3e5ad 100644 --- a/Sources/OAuth2Client/NXOAuth2AccountStore.h +++ b/OAuth2Client/NXOAuth2AccountStore.h @@ -13,10 +13,11 @@ #import -#import "NXOAuth2TrustDelegate.h" @class NXOAuth2Account; @class NXOAuth2Connection; +@protocol NXApplication; + #pragma mark Notifications @@ -75,7 +76,13 @@ typedef void(^NXOAuth2PreparedAuthorizationURLHandler)(NSURL *preparedURL); NSMutableDictionary *trustedCertificatesHandler; } -+ (instancetype)sharedStore; ++(instancetype)sharedStoreForApplication:(id)uiApplication; +-(instancetype)init NS_UNAVAILABLE; ++(instancetype)new NS_UNAVAILABLE; + +// Private API +//-(instancetype)initWithApplication:(id)uiApplication NS_DESIGNATED_INITIALIZER NS_REQUIRES_SUPER __attribute((nonnull)); + #pragma mark Accessors diff --git a/Sources/OAuth2Client/NXOAuth2Client.h b/OAuth2Client/NXOAuth2Client.h similarity index 97% rename from Sources/OAuth2Client/NXOAuth2Client.h rename to OAuth2Client/NXOAuth2Client.h index c9b3e3de..164f66a1 100644 --- a/Sources/OAuth2Client/NXOAuth2Client.h +++ b/OAuth2Client/NXOAuth2Client.h @@ -12,14 +12,14 @@ // #import - -#import "NXOAuth2ClientDelegate.h" -#import "NXOAuth2ConnectionDelegate.h" +#import extern NSString * const NXOAuth2ClientConnectionContextTokenRequest; extern NSString * const NXOAuth2ClientConnectionContextTokenRefresh; -@class NXOAuth2Connection, NXOAuth2AccessToken; +@class NXOAuth2Connection; +@class NXOAuth2AccessToken; +@protocol NXOAuth2ClientDelegate; /*! * The OAuth 2.0 client diff --git a/Sources/OAuth2Client/NXOAuth2ClientDelegate.h b/OAuth2Client/NXOAuth2ClientDelegate.h similarity index 93% rename from Sources/OAuth2Client/NXOAuth2ClientDelegate.h rename to OAuth2Client/NXOAuth2ClientDelegate.h index dad896bd..1bb546bc 100644 --- a/Sources/OAuth2Client/NXOAuth2ClientDelegate.h +++ b/OAuth2Client/NXOAuth2ClientDelegate.h @@ -11,8 +11,8 @@ // the full licence. // -#import "NXOAuth2Constants.h" -#import "NXOAuth2TrustDelegate.h" + +#import @class NXOAuth2Client; diff --git a/Sources/OAuth2Client/NXOAuth2Connection.h b/OAuth2Client/NXOAuth2Connection.h similarity index 81% rename from Sources/OAuth2Client/NXOAuth2Connection.h rename to OAuth2Client/NXOAuth2Connection.h index c29feb54..a173f271 100644 --- a/Sources/OAuth2Client/NXOAuth2Connection.h +++ b/OAuth2Client/NXOAuth2Connection.h @@ -12,8 +12,8 @@ // #import +#import -#import "NXOAuth2Constants.h" @class NXOAuth2Client; @protocol NXOAuth2ConnectionDelegate; @@ -46,10 +46,6 @@ extern NSString * const NXOAuth2ConnectionDidStartNotification; extern NSString * const NXOAuth2ConnectionDidEndNotification; -typedef void(^NXOAuth2ConnectionResponseHandler)(NSURLResponse *response, NSData *responseData, NSError *error); -typedef void(^NXOAuth2ConnectionSendingProgressHandler)(unsigned long long bytesSend, unsigned long long bytesTotal); - - @interface NXOAuth2Connection : NSObject { @private NSURLConnection *connection; @@ -87,11 +83,11 @@ typedef void(^NXOAuth2ConnectionSendingProgressHandler)(unsigned long long bytes @property (nonatomic, strong) NSDictionary *userInfo; @property (nonatomic, strong, readonly) NXOAuth2Client *client; -- (instancetype) initWithRequest:(NSMutableURLRequest *)request - requestParameters:(NSDictionary *)requestParameters - oauthClient:(NXOAuth2Client *)client - sendingProgressHandler:(NXOAuth2ConnectionSendingProgressHandler)sendingProgressHandler - responseHandler:(NXOAuth2ConnectionResponseHandler)responseHandler; +- (instancetype)initWithRequest:(NSMutableURLRequest *)request + requestParameters:(NSDictionary *)requestParameters + oauthClient:(NXOAuth2Client *)client + sendingProgressHandler:(NXOAuth2ConnectionSendingProgressHandler)sendingProgressHandler + responseHandler:(NXOAuth2ConnectionResponseHandler)responseHandler; - (instancetype)initWithRequest:(NSMutableURLRequest *)request requestParameters:(NSDictionary *)requestParameters diff --git a/Sources/OAuth2Client/NXOAuth2ConnectionDelegate.h b/OAuth2Client/NXOAuth2ConnectionDelegate.h similarity index 95% rename from Sources/OAuth2Client/NXOAuth2ConnectionDelegate.h rename to OAuth2Client/NXOAuth2ConnectionDelegate.h index ae5724e2..55764067 100644 --- a/Sources/OAuth2Client/NXOAuth2ConnectionDelegate.h +++ b/OAuth2Client/NXOAuth2ConnectionDelegate.h @@ -11,8 +11,9 @@ // the full licence. // -#import "NXOAuth2Constants.h" -#import "NXOAuth2TrustDelegate.h" + +#import +#import @class NXOAuth2Connection; diff --git a/Sources/OAuth2Client/NXOAuth2Constants.h b/OAuth2Client/NXOAuth2Constants.h similarity index 100% rename from Sources/OAuth2Client/NXOAuth2Constants.h rename to OAuth2Client/NXOAuth2Constants.h diff --git a/Sources/OAuth2Client/NXOAuth2FileStreamWrapper.h b/OAuth2Client/NXOAuth2FileStreamWrapper.h similarity index 100% rename from Sources/OAuth2Client/NXOAuth2FileStreamWrapper.h rename to OAuth2Client/NXOAuth2FileStreamWrapper.h diff --git a/Sources/OAuth2Client/NXOAuth2PostBodyStream.h b/OAuth2Client/NXOAuth2PostBodyStream.h similarity index 85% rename from Sources/OAuth2Client/NXOAuth2PostBodyStream.h rename to OAuth2Client/NXOAuth2PostBodyStream.h index c08ea013..fabe5601 100644 --- a/Sources/OAuth2Client/NXOAuth2PostBodyStream.h +++ b/OAuth2Client/NXOAuth2PostBodyStream.h @@ -27,8 +27,8 @@ - (instancetype)initWithParameters:(NSDictionary *)postParameters; -@property (readonly) NSString *boundary; -@property (readonly) unsigned long long length; +@property (readonly, nonatomic) NSString *boundary; +@property (readonly, nonatomic) unsigned long long length; @end diff --git a/Sources/OAuth2Client/NXOAuth2Request.h b/OAuth2Client/NXOAuth2Request.h similarity index 95% rename from Sources/OAuth2Client/NXOAuth2Request.h rename to OAuth2Client/NXOAuth2Request.h index aa601af5..3facc7d7 100644 --- a/Sources/OAuth2Client/NXOAuth2Request.h +++ b/OAuth2Client/NXOAuth2Request.h @@ -12,10 +12,10 @@ // #import - -#import "NXOAuth2Connection.h" +#import @class NXOAuth2Account; +@class NXOAuth2Connection; @interface NXOAuth2Request : NSObject { @private diff --git a/OAuth2Client/NXOAuth2RequestCallbacks.h b/OAuth2Client/NXOAuth2RequestCallbacks.h new file mode 100644 index 00000000..b81f5883 --- /dev/null +++ b/OAuth2Client/NXOAuth2RequestCallbacks.h @@ -0,0 +1,19 @@ +// +// NXOAuth2RequestCallbacks.h +// OAuth2Client +// +// Created by Oleksandr Dodatko on 2/2/15. +// Copyright (c) 2015 nxtbgthng. All rights reserved. +// + +#ifndef OAuth2Client_NXOAuth2RequestCallbacks_h +#define OAuth2Client_NXOAuth2RequestCallbacks_h + + +#import + +typedef void(^NXOAuth2ConnectionResponseHandler)(NSURLResponse *response, NSData *responseData, NSError *error); +typedef void(^NXOAuth2ConnectionSendingProgressHandler)(unsigned long long bytesSend, unsigned long long bytesTotal); + + +#endif diff --git a/Sources/OAuth2Client/NXOAuth2TrustDelegate.h b/OAuth2Client/NXOAuth2TrustDelegate.h similarity index 100% rename from Sources/OAuth2Client/NXOAuth2TrustDelegate.h rename to OAuth2Client/NXOAuth2TrustDelegate.h diff --git a/Sources/OAuth2Client/NXOAuth2.h b/Sources/OAuth2Client/NXOAuth2.h deleted file mode 100644 index 77a6bb1a..00000000 --- a/Sources/OAuth2Client/NXOAuth2.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// NXOAuth2.h -// OAuth2Client -// -// Created by Ullrich Schäfer on 13.09.10. -// -// Copyright 2010 nxtbgthng. All rights reserved. -// -// Licenced under the new BSD-licence. -// See README.md in this repository for -// the full licence. -// - -#import "NXOAuth2Client.h" -#import "NXOAuth2ClientDelegate.h" -#import "NXOAuth2AccessToken.h" -#import "NXOAuth2Connection.h" -#import "NXOAuth2ConnectionDelegate.h" -#import "NXOAuth2TrustDelegate.h" -#import "NXOAuth2Constants.h" -#import "NXOAuth2FileStreamWrapper.h" -#import "NXOAuth2PostBodyStream.h" -#import "NXOAuth2AccountStore.h" -#import "NXOAuth2Account.h" -#import "NXOAuth2Request.h" - -#pragma mark Helpers - -#import "NSURL+NXOAuth2.h" -#import "NSString+NXOAuth2.h" -#import "NSData+NXOAuth2.h" diff --git a/Sources/OAuth2Client/NXOAuth2AccessToken.m b/Sources/OAuth2Client/NXOAuth2AccessToken.m index aefe1c9d..0cb0711b 100644 --- a/Sources/OAuth2Client/NXOAuth2AccessToken.m +++ b/Sources/OAuth2Client/NXOAuth2AccessToken.m @@ -32,7 +32,9 @@ + (instancetype)tokenWithResponseBody:(NSString *)theResponseBody tokenType:(NSS if (jsonSerializationClass) { NSError *error = nil; NSData *data = [theResponseBody dataUsingEncoding:NSUTF8StringEncoding]; - jsonDict = [jsonSerializationClass JSONObjectWithData:data options:0 error:&error]; + jsonDict = [jsonSerializationClass JSONObjectWithData:data + options:(NSJSONReadingOptions)0 + error:&error]; } else { // do we really need a JSON dependency? We can easily split this up ourselfs NSString *normalizedResponseBody = [[[theResponseBody stringByReplacingOccurrencesOfString:@"{" withString:@""] diff --git a/Sources/OAuth2Client/NXOAuth2Account.m b/Sources/OAuth2Client/NXOAuth2Account.m index fb23df9f..59e16152 100644 --- a/Sources/OAuth2Client/NXOAuth2Account.m +++ b/Sources/OAuth2Client/NXOAuth2Account.m @@ -33,6 +33,9 @@ #pragma mark - @interface NXOAuth2Account () + +@property (nonatomic, readwrite) id application; + @end #pragma mark - @@ -41,20 +44,34 @@ @implementation NXOAuth2Account (Private) #pragma mark Lifecycle -- (instancetype)initAccountWithOAuthClient:(NXOAuth2Client *)anOAuthClient accountType:(NSString *)anAccountType; +-(void)dealloc +{ + if (self == self->oauthClient.delegate) + { + self->oauthClient.delegate = nil; + } +} + +- (instancetype)initAccountWithOAuthClient:(NXOAuth2Client *)anOAuthClient + accountType:(NSString *)anAccountType + application:(id)app { self = [self initAccountWithAccessToken:anOAuthClient.accessToken - accountType:anAccountType]; + accountType:anAccountType + application: app]; if (self) { oauthClient = anOAuthClient; } return self; } -- (instancetype)initAccountWithAccessToken:(NXOAuth2AccessToken *)anAccessToken accountType:(NSString *)anAccountType; +- (instancetype)initAccountWithAccessToken:(NXOAuth2AccessToken *)anAccessToken + accountType:(NSString *)anAccountType + application:(id)app { self = [super init]; - if (self) { + if (nil != self) { + self.application = app; accountType = anAccountType; accessToken = anAccessToken; oauthClient.delegate = self; @@ -79,11 +96,21 @@ @implementation NXOAuth2Account #pragma mark Accessors -- (NXOAuth2Client *)oauthClient; +-(NXOAuth2AccountStore*)sharedAccountStore +{ + id app = self.application; + NXOAuth2AccountStore* accountStore = [NXOAuth2AccountStore sharedStoreForApplication: app]; + + return accountStore; +} + +-(NXOAuth2Client *)oauthClient { @synchronized (oauthClient) { if (oauthClient == nil) { - NSDictionary *configuration = [[NXOAuth2AccountStore sharedStore] configurationForAccountType:self.accountType]; + + NXOAuth2AccountStore* accountStore = [self sharedAccountStore]; + NSDictionary *configuration = [accountStore configurationForAccountType:self.accountType]; NSString *clientID = [configuration objectForKey:kNXOAuth2AccountStoreConfigurationClientID]; NSString *clientSecret = [configuration objectForKey:kNXOAuth2AccountStoreConfigurationSecret]; @@ -137,7 +164,7 @@ - (NSString *)description; -(NXOAuth2TrustMode)connection:(NXOAuth2Connection *)connection trustModeForHostname:(NSString *)hostname; { - NXOAuth2TrustModeHandler handler = [[NXOAuth2AccountStore sharedStore] trustModeHandlerForAccountType:self.accountType]; + NXOAuth2TrustModeHandler handler = [[self sharedAccountStore] trustModeHandlerForAccountType:self.accountType]; if (handler) { return handler(connection, hostname); } else { @@ -147,7 +174,7 @@ -(NXOAuth2TrustMode)connection:(NXOAuth2Connection *)connection trustModeForHost -(NSArray *)connection:(NXOAuth2Connection *)connection trustedCertificatesForHostname:(NSString *)hostname; { - NXOAuth2TrustedCertificatesHandler handler = [[NXOAuth2AccountStore sharedStore] trustedCertificatesHandlerForAccountType:self.accountType]; + NXOAuth2TrustedCertificatesHandler handler = [[self sharedAccountStore] trustedCertificatesHandlerForAccountType:self.accountType]; return handler(hostname); } diff --git a/Sources/OAuth2Client/NXOAuth2AccountStore.m b/Sources/OAuth2Client/NXOAuth2AccountStore.m index b36a9de1..caf70c5a 100644 --- a/Sources/OAuth2Client/NXOAuth2AccountStore.m +++ b/Sources/OAuth2Client/NXOAuth2AccountStore.m @@ -11,18 +11,16 @@ // the full licence. // -#if TARGET_OS_IPHONE -#import -#else -#import -#endif #import "NXOAuth2Client.h" +#import "NXOAuth2ClientDelegate.h" + #import "NXOAuth2Connection.h" #import "NXOAuth2Account.h" #import "NXOAuth2Account+Private.h" +#import "NXApplication.h" #import "NXOAuth2AccountStore.h" @@ -55,6 +53,9 @@ @interface NXOAuth2AccountStore () + +-(instancetype)initWithApplication:(id)uiApplication; + @property (nonatomic, strong, readwrite) NSMutableDictionary *pendingOAuthClients; @property (nonatomic, strong, readwrite) NSMutableDictionary *accountsDict; @@ -84,50 +85,72 @@ + (void)removeFromDefaultKeychain; @implementation NXOAuth2AccountStore +{ + id _uiApplication; +} #pragma mark Lifecycle -+ (instancetype)sharedStore; ++ (instancetype)sharedStoreForApplication:(id)uiApplication { static NXOAuth2AccountStore *shared; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - shared = [NXOAuth2AccountStore new]; + shared = [[NXOAuth2AccountStore alloc] initWithApplication: uiApplication]; }); return shared; } -- (instancetype)init; + +-(instancetype)initWithApplication:(id)uiApplication { + if (nil == uiApplication) + { + return nil; + } + self = [super init]; - if (self) { - self.pendingOAuthClients = [NSMutableDictionary dictionary]; - self.accountsDict = [NSMutableDictionary dictionaryWithDictionary:[NXOAuth2AccountStore accountsFromDefaultKeychain]]; - self.configurations = [NSMutableDictionary dictionary]; - self.trustModeHandler = [NSMutableDictionary dictionary]; - self.trustedCertificatesHandler = [NSMutableDictionary dictionary]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(accountDidChangeUserData:) - name:NXOAuth2AccountDidChangeUserDataNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(accountDidChangeAccessToken:) - name:NXOAuth2AccountDidChangeAccessTokenNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(accountDidLoseAccessToken:) - name:NXOAuth2AccountDidLoseAccessTokenNotification - object:nil]; + if (nil == self) + { + return nil; } + + self->_uiApplication = uiApplication; + + self.pendingOAuthClients = [NSMutableDictionary dictionary]; + self.accountsDict = [NSMutableDictionary dictionaryWithDictionary:[NXOAuth2AccountStore accountsFromDefaultKeychain]]; + self.configurations = [NSMutableDictionary dictionary]; + self.trustModeHandler = [NSMutableDictionary dictionary]; + self.trustedCertificatesHandler = [NSMutableDictionary dictionary]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(accountDidChangeUserData:) + name:NXOAuth2AccountDidChangeUserDataNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(accountDidChangeAccessToken:) + name:NXOAuth2AccountDidChangeAccessTokenNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(accountDidLoseAccessToken:) + name:NXOAuth2AccountDidLoseAccessTokenNotification + object:nil]; + return self; } - (void)dealloc; { [[NSNotificationCenter defaultCenter] removeObserver:self]; + + NSArray* pendingClients = [self.pendingOAuthClients allValues]; + [self.pendingOAuthClients removeAllObjects]; + for (NXOAuth2Client* singleClient in pendingClients) + { + singleClient.delegate = nil; + } } @@ -471,11 +494,9 @@ - (void)oauthClientNeedsAuthentication:(NXOAuth2Client *)client; NSURL *redirectURL = [configuration objectForKey:kNXOAuth2AccountStoreConfigurationRedirectURL]; NSURL *preparedURL = [client authorizationURLWithRedirectURL:redirectURL]; -#if TARGET_OS_IPHONE - [[UIApplication sharedApplication] openURL:preparedURL]; -#else - [[NSWorkspace sharedWorkspace] openURL:preparedURL]; -#endif + + NSParameterAssert(nil != self->_uiApplication); + [self->_uiApplication openURL: preparedURL]; } - (void)oauthClientDidGetAccessToken:(NXOAuth2Client *)client; @@ -486,7 +507,9 @@ - (void)oauthClientDidGetAccessToken:(NXOAuth2Client *)client; [self.pendingOAuthClients removeObjectForKey:accountType]; } - NXOAuth2Account *account = [[NXOAuth2Account alloc] initAccountWithOAuthClient:client accountType:accountType]; + NXOAuth2Account *account = [[NXOAuth2Account alloc] initAccountWithOAuthClient:client + accountType:accountType + application:self->_uiApplication]; [self addAccount:account]; } diff --git a/Sources/OAuth2Client/NXOAuth2Client.m b/Sources/OAuth2Client/NXOAuth2Client.m index dd3843e2..4efbfe48 100644 --- a/Sources/OAuth2Client/NXOAuth2Client.m +++ b/Sources/OAuth2Client/NXOAuth2Client.m @@ -11,13 +11,17 @@ // the full licence. // +#import "NXOAuth2Client.h" +#import "NXOAuth2ClientDelegate.h" + + #import "NXOAuth2Connection.h" #import "NXOAuth2ConnectionDelegate.h" #import "NXOAuth2AccessToken.h" #import "NSURL+NXOAuth2.h" -#import "NXOAuth2Client.h" + NSString * const NXOAuth2ClientConnectionContextTokenRequest = @"tokenRequest"; @@ -107,6 +111,10 @@ - (instancetype)initWithClientID:(NSString *)aClientId - (void)dealloc; { + if (self == authConnection.delegate) + { + authConnection.delegate = nil; + } [authConnection cancel]; } diff --git a/Sources/OAuth2Client/NXOAuth2Connection.m b/Sources/OAuth2Client/NXOAuth2Connection.m index ef2d2a9f..431c16d3 100644 --- a/Sources/OAuth2Client/NXOAuth2Connection.m +++ b/Sources/OAuth2Client/NXOAuth2Connection.m @@ -538,13 +538,21 @@ - (NSURLRequest *)connection:(NSURLConnection *)aConnection willSendRequest:(NSU return mutableRequest; } -- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; +- (void)connection:(NSURLConnection *)connection + didSendBodyData:(NSInteger)bytesWritten + totalBytesWritten:(NSInteger)totalBytesWritten +totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; { + unsigned long long castedTotalBytes = (unsigned long long)totalBytesWritten; + unsigned long long castedExpectedBytes = (unsigned long long)totalBytesExpectedToWrite; + if ([delegate respondsToSelector:@selector(oauthConnection:didSendBytes:ofTotal:)]) { - [delegate oauthConnection:self didSendBytes:totalBytesWritten ofTotal:totalBytesExpectedToWrite]; + [delegate oauthConnection:self + didSendBytes:castedTotalBytes + ofTotal:castedExpectedBytes]; } - if (sendingProgressHandler) sendingProgressHandler(totalBytesWritten, totalBytesExpectedToWrite); + if (sendingProgressHandler) sendingProgressHandler(castedTotalBytes, castedExpectedBytes); } - (NSInputStream *)connection:(NSURLConnection *)connection needNewBodyStream:(NSURLRequest *)aRequest; diff --git a/Sources/OAuth2Client/NXOAuth2PostBodyStream.m b/Sources/OAuth2Client/NXOAuth2PostBodyStream.m index 92855402..6b3046ff 100644 --- a/Sources/OAuth2Client/NXOAuth2PostBodyStream.m +++ b/Sources/OAuth2Client/NXOAuth2PostBodyStream.m @@ -29,18 +29,26 @@ @implementation NXOAuth2PostBodyStream - (instancetype)initWithParameters:(NSDictionary *)postParameters; { self = [self init]; - if (self) { - srandom(time(NULL)); - boundary = [[NSString alloc] initWithFormat:@"------------nx-oauth2%d", rand()]; - numBytesTotal = 0; - streamIndex = 0; - - if (postParameters) { - contentStreams = [self streamsForParameters:postParameters contentLength:&numBytesTotal]; - } else { - contentStreams = [[NSArray alloc] init]; - } + if (nil == self) { + return nil; } + + + time_t nowTime = time(NULL); + unsigned seed = (unsigned)nowTime; + srandom(seed); + + boundary = [[NSString alloc] initWithFormat:@"------------nx-oauth2%d", rand()]; + numBytesTotal = 0; + streamIndex = 0; + + if (postParameters) { + contentStreams = [self streamsForParameters:postParameters contentLength:&numBytesTotal]; + } else { + contentStreams = [[NSArray alloc] init]; + } + + return self; } @@ -88,7 +96,7 @@ - (NSArray *)streamsForParameters:(NSDictionary *)parameters contentLength:(unsi NSData *delimiterData = [delimiter dataUsingEncoding:NSUTF8StringEncoding]; NSData *contentHeaderData = [[part contentHeaders] dataUsingEncoding:NSUTF8StringEncoding]; - int dataLength = delimiterData.length + contentHeaderData.length; + NSUInteger dataLength = delimiterData.length + contentHeaderData.length; NSMutableData *headerData = [NSMutableData dataWithCapacity: dataLength]; [headerData appendData:delimiterData]; [headerData appendData:contentHeaderData]; @@ -144,9 +152,12 @@ - (BOOL)hasBytesAvailable; - (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len; { if (currentStream == nil) + { return 0; + } - int result = [currentStream read:buffer maxLength:len]; + NSInteger result = [currentStream read:buffer + maxLength:len]; if (result == 0) { if (streamIndex < contentStreams.count - 1) { diff --git a/Sources/OAuth2Client/NXOAuth2Request.m b/Sources/OAuth2Client/NXOAuth2Request.m index ad8564bd..521b545f 100644 --- a/Sources/OAuth2Client/NXOAuth2Request.m +++ b/Sources/OAuth2Client/NXOAuth2Request.m @@ -75,6 +75,14 @@ - (instancetype)initWithResource:(NSURL *)aResource method:(NSString *)aMethod p #pragma mark Signed NSURLRequest +-(void)dealloc +{ + if (self == self.connection.delegate) + { + self.connection.delegate = nil; + } +} + - (NSURLRequest *)signedURLRequest; { NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.resource]; diff --git a/Sources/OAuth2Client_Prefix.pch b/Sources/OAuth2Client_Prefix.pch index cd5276b3..03f7285b 100644 --- a/Sources/OAuth2Client_Prefix.pch +++ b/Sources/OAuth2Client_Prefix.pch @@ -12,5 +12,6 @@ // #ifdef __OBJC__ +#import #import #endif