Skip to content

Commit

Permalink
Added forced Basic Authentication methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MKSG-MugunthKumar committed Dec 14, 2011
1 parent f899314 commit 0259e1a
Show file tree
Hide file tree
Showing 8 changed files with 391 additions and 1 deletion.
8 changes: 8 additions & 0 deletions MKNetworkKit-OSX/MKNetworkKit-OSX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
ABB5C2A6148B3B160056D3E9 /* MKNetworkOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = ABB5C297148B3B160056D3E9 /* MKNetworkOperation.m */; };
ABB5C2A7148B3B160056D3E9 /* Reachability.h in Headers */ = {isa = PBXBuildFile; fileRef = ABB5C299148B3B160056D3E9 /* Reachability.h */; };
ABB5C2A8148B3B160056D3E9 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = ABB5C29A148B3B160056D3E9 /* Reachability.m */; };
ABDC974A1498A8B60034CEBE /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDC97481498A8B60034CEBE /* NSData+Base64.h */; };
ABDC974B1498A8B60034CEBE /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = ABDC97491498A8B60034CEBE /* NSData+Base64.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -49,6 +51,8 @@
ABB5C297148B3B160056D3E9 /* MKNetworkOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MKNetworkOperation.m; path = ../../MKNetworkKit/MKNetworkOperation.m; sourceTree = "<group>"; };
ABB5C299148B3B160056D3E9 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; };
ABB5C29A148B3B160056D3E9 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
ABDC97481498A8B60034CEBE /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = "<group>"; };
ABDC97491498A8B60034CEBE /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -127,6 +131,8 @@
ABB5C28C148B3B160056D3E9 /* Categories */ = {
isa = PBXGroup;
children = (
ABDC97481498A8B60034CEBE /* NSData+Base64.h */,
ABDC97491498A8B60034CEBE /* NSData+Base64.m */,
AB3A309A148F0A4400D06246 /* NSDate+RFC1123.h */,
AB3A309B148F0A4400D06246 /* NSDate+RFC1123.m */,
ABB5C28D148B3B160056D3E9 /* NSDictionary+RequestEncoding.h */,
Expand Down Expand Up @@ -165,6 +171,7 @@
ABB5C2A7148B3B160056D3E9 /* Reachability.h in Headers */,
AB8AF0CA148B445200ECE140 /* NSAlert+MKNetworkKitAdditions.h in Headers */,
AB3A309C148F0A4400D06246 /* NSDate+RFC1123.h in Headers */,
ABDC974A1498A8B60034CEBE /* NSData+Base64.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -226,6 +233,7 @@
ABB5C2A8148B3B160056D3E9 /* Reachability.m in Sources */,
AB8AF0CB148B445200ECE140 /* NSAlert+MKNetworkKitAdditions.m in Sources */,
AB3A309D148F0A4400D06246 /* NSDate+RFC1123.m in Sources */,
ABDC974B1498A8B60034CEBE /* NSData+Base64.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
8 changes: 8 additions & 0 deletions MKNetworkKit-iOS/MKNetworkKit-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
ABB5C2C5148B3B360056D3E9 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = ABB5C2B7148B3B360056D3E9 /* Reachability.m */; };
ABB5C2CD148B40910056D3E9 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABB5C2CB148B40910056D3E9 /* SystemConfiguration.framework */; };
ABB5C2CE148B40910056D3E9 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABB5C2CC148B40910056D3E9 /* CFNetwork.framework */; };
ABDC97461498A6DE0034CEBE /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDC97441498A6DE0034CEBE /* NSData+Base64.h */; };
ABDC97471498A6DE0034CEBE /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = ABDC97451498A6DE0034CEBE /* NSData+Base64.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -50,6 +52,8 @@
ABB5C2B7148B3B360056D3E9 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
ABB5C2CB148B40910056D3E9 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
ABB5C2CC148B40910056D3E9 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
ABDC97441498A6DE0034CEBE /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = "<group>"; };
ABDC97451498A6DE0034CEBE /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -123,6 +127,8 @@
children = (
AB3A3096148F0A3B00D06246 /* NSDate+RFC1123.h */,
AB3A3097148F0A3B00D06246 /* NSDate+RFC1123.m */,
ABDC97441498A6DE0034CEBE /* NSData+Base64.h */,
ABDC97451498A6DE0034CEBE /* NSData+Base64.m */,
ABB5C2AA148B3B360056D3E9 /* NSDictionary+RequestEncoding.h */,
ABB5C2AB148B3B360056D3E9 /* NSDictionary+RequestEncoding.m */,
ABB5C2AC148B3B360056D3E9 /* NSString+MKNetworkKitAdditions.h */,
Expand Down Expand Up @@ -167,6 +173,7 @@
ABB5C2C2148B3B360056D3E9 /* MKNetworkOperation.h in Headers */,
ABB5C2C4148B3B360056D3E9 /* Reachability.h in Headers */,
AB3A3098148F0A3B00D06246 /* NSDate+RFC1123.h in Headers */,
ABDC97461498A6DE0034CEBE /* NSData+Base64.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -228,6 +235,7 @@
ABB5C2C3148B3B360056D3E9 /* MKNetworkOperation.m in Sources */,
ABB5C2C5148B3B360056D3E9 /* Reachability.m in Sources */,
AB3A3099148F0A3B00D06246 /* NSDate+RFC1123.m in Sources */,
ABDC97471498A6DE0034CEBE /* NSData+Base64.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
42 changes: 42 additions & 0 deletions MKNetworkKit/Categories/NSData+Base64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// NSData+Base64.h
// base64
//
// Created by Matt Gallagher on 2009/06/03.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software. Permission is granted to anyone to
// use this software for any purpose, including commercial applications, and to
// alter it and redistribute it freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source
// distribution.
//

#import <Foundation/Foundation.h>

void *NewBase64Decode(
const char *inputBuffer,
size_t length,
size_t *outputLength);

char *NewBase64Encode(
const void *inputBuffer,
size_t length,
bool separateLines,
size_t *outputLength);

@interface NSData (Base64)

+ (NSData *)dataFromBase64String:(NSString *)aString;
- (NSString *)base64EncodedString;

@end
Loading

0 comments on commit 0259e1a

Please sign in to comment.