Permalink
Browse files

WS

  • Loading branch information...
1 parent 9356a6b commit 12f9b0c0293470b3f2a12174d7fb79f2abc12db6 @stigi stigi committed Mar 29, 2012
Showing with 1,098 additions and 1,098 deletions.
  1. +1 −1 NXOAuth2Account+Private.h
  2. +2 −2 Sources/NSData+NXOAuth2.h
  3. +17 −17 Sources/NSData+NXOAuth2.m
  4. +2 −2 Sources/NSString+NXOAuth2.h
  5. +19 −19 Sources/NSString+NXOAuth2.m
  6. +2 −2 Sources/NSURL+NXOAuth2.h
  7. +20 −20 Sources/NSURL+NXOAuth2.m
  8. +2 −2 Sources/OAuth2Client/NXOAuth2.h
  9. +6 −6 Sources/OAuth2Client/NXOAuth2AccessToken.h
  10. +143 −143 Sources/OAuth2Client/NXOAuth2AccessToken.m
  11. +1 −1 Sources/OAuth2Client/NXOAuth2Account.h
  12. +7 −7 Sources/OAuth2Client/NXOAuth2Account.m
  13. +1 −1 Sources/OAuth2Client/NXOAuth2AccountStore.h
  14. +84 −84 Sources/OAuth2Client/NXOAuth2AccountStore.m
  15. +29 −29 Sources/OAuth2Client/NXOAuth2Client.h
  16. +195 −195 Sources/OAuth2Client/NXOAuth2Client.m
  17. +1 −1 Sources/OAuth2Client/NXOAuth2ClientDelegate.h
  18. +34 −34 Sources/OAuth2Client/NXOAuth2Connection.h
  19. +318 −318 Sources/OAuth2Client/NXOAuth2Connection.m
  20. +14 −14 Sources/OAuth2Client/NXOAuth2ConnectionDelegate.h
  21. +17 −17 Sources/OAuth2Client/NXOAuth2Constants.h
  22. +9 −9 Sources/OAuth2Client/NXOAuth2Constants.m
  23. +5 −5 Sources/OAuth2Client/NXOAuth2FileStreamWrapper.h
  24. +14 −14 Sources/OAuth2Client/NXOAuth2FileStreamWrapper.m
  25. +14 −14 Sources/OAuth2Client/NXOAuth2PostBodyPart.h
  26. +32 −32 Sources/OAuth2Client/NXOAuth2PostBodyPart.m
  27. +9 −9 Sources/OAuth2Client/NXOAuth2PostBodyStream.h
  28. +78 −78 Sources/OAuth2Client/NXOAuth2PostBodyStream.m
  29. +2 −2 Sources/OAuth2Client/NXOAuth2Request.h
  30. +17 −17 Sources/OAuth2Client/NXOAuth2Request.m
  31. +3 −3 Sources/OAuth2Client/NXOAuth2TrustDelegate.h
@@ -7,7 +7,7 @@
// Copyright 2011 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
@@ -4,10 +4,10 @@
//
// Created by Thomas Kollbach on 18.05.11
//
-// Copyright 2011 nxtbgthng. All rights reserved.
+// Copyright 2011 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
View
@@ -4,10 +4,10 @@
//
// Created by Thomas Kollbach on 18.05.11
//
-// Copyright 2011 nxtbgthng. All rights reserved.
+// Copyright 2011 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
@@ -23,25 +23,25 @@ @implementation NSData (NXOAuth2)
- (NSData *)nx_SHA1Digest;
{
- uint8_t digest[CC_SHA1_DIGEST_LENGTH];
- CC_SHA1(self.bytes, (CC_LONG)self.length, digest);
-
- return [NSData dataWithBytes:digest length:CC_SHA1_DIGEST_LENGTH];
+ uint8_t digest[CC_SHA1_DIGEST_LENGTH];
+ CC_SHA1(self.bytes, (CC_LONG)self.length, digest);
+
+ return [NSData dataWithBytes:digest length:CC_SHA1_DIGEST_LENGTH];
}
- (NSString *)nx_SHA1Hexdigest;
{
- NSData *binDigest = [self nx_SHA1Digest];
- uint8_t digest[CC_SHA1_DIGEST_LENGTH];
- [binDigest getBytes:digest length:CC_SHA1_DIGEST_LENGTH];
-
- NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2];
-
- for (NSUInteger i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) {
- [output appendFormat:@"%02x", digest[i]];
- }
-
- return [output copy];
+ NSData *binDigest = [self nx_SHA1Digest];
+ uint8_t digest[CC_SHA1_DIGEST_LENGTH];
+ [binDigest getBytes:digest length:CC_SHA1_DIGEST_LENGTH];
+
+ NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2];
+
+ for (NSUInteger i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) {
+ [output appendFormat:@"%02x", digest[i]];
+ }
+
+ return [output copy];
}
@@ -4,10 +4,10 @@
//
// Created by Ullrich Schäfer on 07.10.09.
//
-// Copyright 2010 nxtbgthng. All rights reserved.
+// Copyright 2010 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
@@ -4,10 +4,10 @@
//
// Created by Ullrich Schäfer on 07.10.09.
//
-// Copyright 2010 nxtbgthng. All rights reserved.
+// Copyright 2010 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
@@ -19,7 +19,7 @@ @implementation NSString (NXOAuth2)
+ (NSString *)nxoauth2_stringWithUUID;
{
__autoreleasing NSString *result;
- CFUUIDRef theUUID = CFUUIDCreate(kCFAllocatorDefault);
+ CFUUIDRef theUUID = CFUUIDCreate(kCFAllocatorDefault);
result = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, theUUID);
CFRelease(theUUID);
return result;
@@ -30,28 +30,28 @@ + (NSString *)nxoauth2_stringWithUUID;
+ (NSString *)nxoauth2_stringWithEncodedQueryParameters:(NSDictionary *)parameters;
{
-
- NSMutableArray *parameterPairs = [NSMutableArray array];
- for (NSString *key in [parameters allKeys]) {
- NSString *pair = [NSString stringWithFormat:@"%@=%@", [key nxoauth2_URLEncodedString], [[parameters objectForKey:key] nxoauth2_URLEncodedString]];
- [parameterPairs addObject:pair];
- }
- return [parameterPairs componentsJoinedByString:@"&"];
+
+ NSMutableArray *parameterPairs = [NSMutableArray array];
+ for (NSString *key in [parameters allKeys]) {
+ NSString *pair = [NSString stringWithFormat:@"%@=%@", [key nxoauth2_URLEncodedString], [[parameters objectForKey:key] nxoauth2_URLEncodedString]];
+ [parameterPairs addObject:pair];
+ }
+ return [parameterPairs componentsJoinedByString:@"&"];
}
- (NSDictionary *)nxoauth2_parametersFromEncodedQueryString;
{
- NSArray *encodedParameterPairs = [self componentsSeparatedByString:@"&"];
+ NSArray *encodedParameterPairs = [self componentsSeparatedByString:@"&"];
NSMutableDictionary *requestParameters = [NSMutableDictionary dictionary];
for (NSString *encodedPair in encodedParameterPairs) {
NSArray *encodedPairElements = [encodedPair componentsSeparatedByString:@"="];
- if (encodedPairElements.count == 2) {
- [requestParameters setValue:[[encodedPairElements objectAtIndex:1] nxoauth2_URLDecodedString]
- forKey:[[encodedPairElements objectAtIndex:0] nxoauth2_URLDecodedString]];
- }
+ if (encodedPairElements.count == 2) {
+ [requestParameters setValue:[[encodedPairElements objectAtIndex:1] nxoauth2_URLDecodedString]
+ forKey:[[encodedPairElements objectAtIndex:0] nxoauth2_URLDecodedString]];
+ }
}
- return requestParameters;
+ return requestParameters;
}
@@ -60,13 +60,13 @@ - (NSDictionary *)nxoauth2_parametersFromEncodedQueryString;
- (NSString *)nxoauth2_URLEncodedString;
{
- CFStringRef cfResult = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, //Allocator
+ CFStringRef cfResult = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, //Allocator
(__bridge CFStringRef)self, //Original String
NULL, //Characters to leave unescaped
(CFStringRef)@"!*'();:@&=+$,/?%#[]", //Legal Characters to be escaped
kCFStringEncodingUTF8); //Encoding
__autoreleasing NSString *result = (__bridge_transfer NSString *)cfResult;
- return result;
+ return result;
}
- (NSString *)nxoauth2_URLDecodedString;
@@ -76,7 +76,7 @@ - (NSString *)nxoauth2_URLDecodedString;
CFSTR(""),
kCFStringEncodingUTF8);
__autoreleasing NSString *result = (__bridge_transfer NSString *)cfResult;
- return result;
+ return result;
}
@end
View
@@ -4,10 +4,10 @@
//
// Created by Ullrich Schäfer on 07.10.09.
//
-// Copyright 2010 nxtbgthng. All rights reserved.
+// Copyright 2010 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
View
@@ -4,10 +4,10 @@
//
// Created by Ullrich Schäfer on 07.10.09.
//
-// Copyright 2010 nxtbgthng. All rights reserved.
+// Copyright 2010 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
@@ -19,32 +19,32 @@
@implementation NSURL (NXOAuth2)
- (NSURL *)nxoauth2_URLByAddingParameters:(NSDictionary *)parameterDictionary {
- if (!parameterDictionary || [parameterDictionary count] == 0) {
- return self;
- }
-
- NSString *newParameterString = [NSString nxoauth2_stringWithEncodedQueryParameters:parameterDictionary];
-
- NSString *absoluteString = [self absoluteString];
- if ([absoluteString rangeOfString:@"?"].location == NSNotFound) { // append parameters?
- absoluteString = [NSString stringWithFormat:@"%@?%@", absoluteString, newParameterString];
- } else {
- absoluteString = [NSString stringWithFormat:@"%@&%@", absoluteString, newParameterString];
- }
-
- return [NSURL URLWithString:absoluteString];
+ if (!parameterDictionary || [parameterDictionary count] == 0) {
+ return self;
+ }
+
+ NSString *newParameterString = [NSString nxoauth2_stringWithEncodedQueryParameters:parameterDictionary];
+
+ NSString *absoluteString = [self absoluteString];
+ if ([absoluteString rangeOfString:@"?"].location == NSNotFound) { // append parameters?
+ absoluteString = [NSString stringWithFormat:@"%@?%@", absoluteString, newParameterString];
+ } else {
+ absoluteString = [NSString stringWithFormat:@"%@&%@", absoluteString, newParameterString];
+ }
+
+ return [NSURL URLWithString:absoluteString];
}
- (NSString *)nxoauth2_valueForQueryParameterKey:(NSString *)key;
{
- NSString *queryString = [self query];
- NSDictionary *parameters = [queryString nxoauth2_parametersFromEncodedQueryString];
- return [parameters objectForKey:key];
+ NSString *queryString = [self query];
+ NSDictionary *parameters = [queryString nxoauth2_parametersFromEncodedQueryString];
+ return [parameters objectForKey:key];
}
- (NSURL *)nxoauth2_URLWithoutQueryString;
{
- return [NSURL URLWithString:[self nxoauth2_URLStringWithoutQueryString]];
+ return [NSURL URLWithString:[self nxoauth2_URLStringWithoutQueryString]];
}
- (NSString *)nxoauth2_URLStringWithoutQueryString;
@@ -4,10 +4,10 @@
//
// Created by Ullrich Schäfer on 13.09.10.
//
-// Copyright 2010 nxtbgthng. All rights reserved.
+// Copyright 2010 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
@@ -4,10 +4,10 @@
//
// Created by Ullrich Schäfer on 27.08.10.
//
-// Copyright 2010 nxtbgthng. All rights reserved.
+// Copyright 2010 nxtbgthng. All rights reserved.
//
// Licenced under the new BSD-licence.
-// See README.md in this repository for
+// See README.md in this repository for
// the full licence.
//
@@ -17,10 +17,10 @@
@interface NXOAuth2AccessToken : NSObject <NSCoding> {
@private
- NSString *accessToken;
- NSString *refreshToken;
- NSDate *expiresAt;
- NSSet *scope;
+ NSString *accessToken;
+ NSString *refreshToken;
+ NSDate *expiresAt;
+ NSSet *scope;
NSString *responseBody;
}
@property (nonatomic, readonly) NSString *accessToken;
Oops, something went wrong.

0 comments on commit 12f9b0c

Please sign in to comment.