Skip to content

Commit 091acaf

Browse files
author
Yosuke Matsuda
committed
The AWS Mobile SDK for iOS v2 Developer Preview 4.
1 parent b92ec00 commit 091acaf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+689
-323
lines changed

AWSCore/Authentication/AWSSignature.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ - (NSString *)signRequestV4:(NSURLRequest *)request{
287287

288288
NSString *dateStamp = [xAmzDate az_stringValue:AZDateShortDateFormat1];
289289

290-
NSString *path = [request.URL.path az_stringWithURLEncodingExceptSlash];
290+
NSString *path = [request.URL.path az_stringWithURLEncodingPath];
291291
if (path.length == 0) {
292292
path = [NSString stringWithFormat:@"/"];
293293
}

AWSCore/MobileAnalytics/ThirdParty/gzip/AIDataGZIP.h

-46
This file was deleted.

AWSCore/MobileAnalytics/ThirdParty/gzip/AIDataGZIP.m

-126
This file was deleted.

AWSCore/MobileAnalytics/core/http/AWSMobileAnalyticsDefaultHttpClient.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#import "AZCategory.h"
1919
#import "AWSMobileAnalyticsInstanceIdInterceptor.h"
2020
#import "AWSMobileAnalyticsClientContextInterceptor.h"
21-
#import "AIDataGZIP.h"
21+
#import "GZIP.h"
2222
#import "AWSMobileAnalyticsDefaultSessionClient.h"
2323
#import "AZLogging.h"
2424

@@ -102,7 +102,7 @@ -(void) addInterceptor: (id<AWSMobileAnalyticsInterceptor>) theInterceptor
102102

103103
//adapt the body
104104
if ([theRequest postBody]) {
105-
NSData *unzippedBody = [AIDataGZIP gunzippedData:[theRequest postBody]];
105+
NSData *unzippedBody = [[theRequest postBody] gunzippedData];
106106
NSArray *sourceEventsArray = [NSJSONSerialization JSONObjectWithData:unzippedBody options:kNilOptions error:NULL];
107107
NSAssert([sourceEventsArray isKindOfClass:[NSArray class]] , @"invalid postBody: postBody should be an array");
108108

AWSCore/MobileAnalytics/core/io/AWSMobileAnalyticsWriter.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#import <objc/runtime.h>
2020
#import <CommonCrypto/CommonCryptor.h>
2121
#import <CommonCrypto/CommonDigest.h>
22-
#import "AIDataGZIP.h"
22+
#import "GZIP.h"
2323
#import "AWSMobileAnalyticsBase64Utils.h"
2424

2525
@interface AWSMobileAnalyticsWriter()

AWSCore/MobileAnalytics/core/system/AWSMobileAnalyticsIOSPreferences.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515

1616
#import "AWSMobileAnalyticsIOSPreferences.h"
17-
#import "AIDataGZIP.h"
17+
#import "GZIP.h"
1818
#import "AZLogging.h"
1919

2020
NSString * const AIPreferencesFilename = @"preferences";

AWSCore/MobileAnalytics/delivery/AWSMobileAnalyticsERSRequestBuilder.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#import "AWSMobileAnalyticsERSRequestBuilder.h"
1717
#import "AWSMobileAnalyticsConstants.h"
1818
#import "AWSMobileAnalyticsConfigurationKeys.h"
19-
#import "AIDataGZIP.h"
19+
#import "GZIP.h"
2020
#import "AWSMobileAnalyticsSerializable.h"
2121
#import "AWSMobileAnalyticsSerializerFactory.h"
2222

@@ -76,7 +76,7 @@ - (id)initWithConfiguration:(id<AWSMobileAnalyticsConfiguration>)configuration
7676
NSData* jsonData = [self createBodyFromObjects:theObjects];
7777

7878
// compress the string and set the compressed header
79-
NSData* compressedBody = [AIDataGZIP gzippedData:jsonData];
79+
NSData* compressedBody = [jsonData gzippedData];
8080
[request setPostBody:compressedBody];
8181
[request addHeader:@"gzip" forName:CONTENT_ENCODING_KEY];
8282

AWSCore/Networking/AWSNetworking.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ - (NSString *)userAgent {
8585
NSString *systemName = [[[UIDevice currentDevice] systemName] stringByReplacingOccurrencesOfString:@" " withString:@"-"];
8686
NSString *systemVersion = [[UIDevice currentDevice] systemVersion];
8787
NSString *localeIdentifier = [[NSLocale currentLocale] localeIdentifier];
88-
_userAgent = [NSString stringWithFormat:@"aws-sdk-iOS/%@ %@/%@ %@", @"2.0.4", systemName, systemVersion, localeIdentifier];
88+
_userAgent = [NSString stringWithFormat:@"aws-sdk-iOS/%@ %@/%@ %@", @"2.0.5", systemName, systemVersion, localeIdentifier];
8989
});
9090

9191
return _userAgent;

AWSCore/STS/AWSSTS.m

+5-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#import "AWSURLResponseSerialization.h"
2525
#import "AWSURLRequestRetryHandler.h"
2626

27+
NSString *const AWSSTSDefinitionFileName = @"sts-2011-06-15";
28+
2729
@interface AWSSTSResponseSerializer : AWSXMLResponseSerializer
2830

2931
@property (nonatomic, assign) Class outputClass;
@@ -200,13 +202,12 @@ - (BFTask *)invokeRequest:(AWSRequest *)request
200202
}
201203
networkingRequest.HTTPMethod = HTTPMethod;
202204

203-
AWSQueryStringRequestSerializer *requestSerializer = [AWSQueryStringRequestSerializer new];
204-
requestSerializer.additionalParameters = @{@"Action" : operationName,
205-
@"Version" : @"2011-06-15"};
205+
AWSQueryStringRequestSerializer *requestSerializer = [AWSQueryStringRequestSerializer serializerWithResource:AWSSTSDefinitionFileName
206+
actionName:operationName];
206207
networkingRequest.requestSerializer = requestSerializer;
207208

208209
networkingRequest.responseSerializer = [AWSSTSResponseSerializer serializerWithOutputClass:outputClass
209-
resource:@"sts-2011-06-15"
210+
resource:AWSSTSDefinitionFileName
210211
actionName:operationName];
211212

212213
return [self.networking sendRequest:networkingRequest];

AWSCore/Serialization/AWSSerialization.h

+23-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ typedef NS_ENUM(NSInteger, AWSXMLParserErrorType) {
4747
AWSXMLParserInvalidXMLValue,
4848
};
4949

50+
//defined domain for errors from AWSRuntime.
51+
FOUNDATION_EXPORT NSString *const AWSQueryParamBuilderErrorDomain;
52+
53+
/* NSError codes in AWSErrorDomain. */
54+
typedef NS_ENUM(NSInteger, AWSQueryParamBuilderErrorType) {
55+
AWSQueryParamBuilderUnknownError,
56+
AWSQueryParamBuilderDefinitionFileIsEmpty,
57+
AWSQueryParamBuilderUndefinedActionRule,
58+
AWSQueryParamBuilderInternalError,
59+
};
60+
5061
@interface AWSJSONDictionary : NSDictionary
5162

5263
- (instancetype)initWithDictionary:(NSDictionary *)otherDictionary
@@ -72,9 +83,20 @@ typedef NS_ENUM(NSInteger, AWSXMLParserErrorType) {
7283

7384
@interface AWSXMLParser : NSObject
7485

75-
+ (NSMutableDictionary *)dictionaryForXMLData:(NSData *)data
86+
+ (AWSXMLParser *)sharedInstance;
87+
88+
- (NSMutableDictionary *)dictionaryForXMLData:(NSData *)data
7689
actionName:(NSString *)actionName
7790
serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
7891
error:(NSError *__autoreleasing *)error;
7992

8093
@end
94+
95+
@interface AWSQueryParamBuilder : NSObject
96+
97+
+ (NSDictionary *)buildFormattedParams:(NSDictionary *)params
98+
actionName:(NSString *)actionName
99+
serviceDefinitionRule:(NSDictionary *)serviceDefinitionRule
100+
error:(NSError *__autoreleasing *)error;
101+
102+
@end

0 commit comments

Comments
 (0)