Skip to content

Commit

Permalink
Version 2 of the AWS Mobile SDK for iOS 2.0.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yosuke Matsuda committed Sep 16, 2014
1 parent 825c3cd commit da7dd32
Show file tree
Hide file tree
Showing 88 changed files with 1,506 additions and 545 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ credentials.json
Pods
Podfile.lock
Documentation
Scripts/build.sh
Scripts/gcovr
Scripts/jenkins.py
Scripts/ocunit2junit
2 changes: 1 addition & 1 deletion AWSCore/AWSCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
#import "AWSLogging.h"

#import "STS.h"
#import "CognitoIdentityService.h"
#import "CognitoIdentity.h"
#import "MobileAnalytics.h"
14 changes: 7 additions & 7 deletions AWSCore/Authentication/AWSCredentialsProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ @interface AWSCognitoCredentialsProvider()
@property (nonatomic, strong) NSString *identityPoolId;
@property (nonatomic, strong) NSString *authRoleArn;
@property (nonatomic, strong) NSString *unAuthRoleArn;
@property (nonatomic, strong) AWSCognitoIdentityService *cib;
@property (nonatomic, strong) AWSCognitoIdentity *cib;
@property (nonatomic, strong) AWSSTS *sts;
@property (nonatomic, strong) UICKeyChainStore *keychain;

Expand Down Expand Up @@ -266,7 +266,7 @@ - (instancetype)initWithRegionType:(AWSRegionType)regionType
AWSServiceConfiguration *configuration = [AWSServiceConfiguration configurationWithRegion:regionType
credentialsProvider:credentialsProvider];

_cib = [[AWSCognitoIdentityService new] initWithConfiguration:configuration];
_cib = [[AWSCognitoIdentity new] initWithConfiguration:configuration];
_sts = [[AWSSTS new] initWithConfiguration:configuration];
}

Expand All @@ -280,7 +280,7 @@ - (BFTask *)refresh {
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
return [self getIdentityId];
}] continueWithSuccessBlock:^id(BFTask *task) {
AWSCognitoIdentityServiceGetOpenIdTokenInput *getTokenInput = [AWSCognitoIdentityServiceGetOpenIdTokenInput new];
AWSCognitoIdentityGetOpenIdTokenInput *getTokenInput = [AWSCognitoIdentityGetOpenIdTokenInput new];
getTokenInput.identityId = self.identityId;
getTokenInput.logins = self.logins;

Expand All @@ -301,7 +301,7 @@ - (BFTask *)refresh {
AWSLogVerbose(@"Retrying GetOpenIdToken");

// retry get token
AWSCognitoIdentityServiceGetOpenIdTokenInput *tokenRetry = [AWSCognitoIdentityServiceGetOpenIdTokenInput new];
AWSCognitoIdentityGetOpenIdTokenInput *tokenRetry = [AWSCognitoIdentityGetOpenIdTokenInput new];
tokenRetry.identityId = self.identityId;
tokenRetry.logins = self.logins;

Expand All @@ -311,7 +311,7 @@ - (BFTask *)refresh {
return task;
}];
}] continueWithSuccessBlock:^id(BFTask *task) {
AWSCognitoIdentityServiceGetOpenIdTokenResponse *getTokenResponse = task.result;
AWSCognitoIdentityGetOpenIdTokenResponse *getTokenResponse = task.result;
self.openIdToken = getTokenResponse.token;
NSString *identityIdFromToken = getTokenResponse.identityId;

Expand Down Expand Up @@ -371,7 +371,7 @@ - (BFTask *)getIdentityId {
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);

if (!self.identityId) {
AWSCognitoIdentityServiceGetIdInput *getIdInput = [AWSCognitoIdentityServiceGetIdInput new];
AWSCognitoIdentityGetIdInput *getIdInput = [AWSCognitoIdentityGetIdInput new];
getIdInput.accountId = self.accountId;
getIdInput.identityPoolId = self.identityPoolId;
getIdInput.logins = self.logins;
Expand All @@ -380,7 +380,7 @@ - (BFTask *)getIdentityId {
if (task.error) {
AWSLogError(@"GetId failed. Error is [%@]", task.error);
} else {
AWSCognitoIdentityServiceGetIdResponse *getIdResponse = task.result;
AWSCognitoIdentityGetIdResponse *getIdResponse = task.result;
[self postIdentityIdChangedNotification:getIdResponse.identityId];
self.keychain[@"identityId"] = getIdResponse.identityId;
[self.keychain synchronize];
Expand Down
2 changes: 2 additions & 0 deletions AWSCore/Authentication/AWSSignature.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonHMAC.h>
#import "AWSNetworking.h"

@class AWSEndpoint;
Expand All @@ -26,6 +27,7 @@
+ (NSString *)hashString:(NSString *)stringToHash;
+ (NSData *)hash:(NSData *)dataToHash;
+ (NSString *)hexEncode:(NSString *)string;
+ (NSString *)HMACSign:(NSData *)data withKey:(NSString *)key usingAlgorithm:(CCHmacAlgorithm)algorithm;

@end

Expand Down
51 changes: 51 additions & 0 deletions AWSCore/CognitoIdentity/AWSCognitoIdentity.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

#import <Foundation/Foundation.h>
#import "AWSService.h"
#import "AWSCognitoIdentityModel.h"

@class BFTask;

/**
*
*/
@interface AWSCognitoIdentity : AWSService

@property (nonatomic, strong, readonly) AWSServiceConfiguration *configuration;

+ (instancetype)defaultCognitoIdentity;

- (instancetype)initWithConfiguration:(AWSServiceConfiguration *)configuration;

- (BFTask *)createIdentityPool:(AWSCognitoIdentityCreateIdentityPoolInput *)request;

- (BFTask *)deleteIdentityPool:(AWSCognitoIdentityDeleteIdentityPoolInput *)request;

- (BFTask *)describeIdentityPool:(AWSCognitoIdentityDescribeIdentityPoolInput *)request;

- (BFTask *)getId:(AWSCognitoIdentityGetIdInput *)request;

- (BFTask *)getOpenIdToken:(AWSCognitoIdentityGetOpenIdTokenInput *)request;

- (BFTask *)listIdentities:(AWSCognitoIdentityListIdentitiesInput *)request;

- (BFTask *)listIdentityPools:(AWSCognitoIdentityListIdentityPoolsInput *)request;

- (BFTask *)unlinkIdentity:(AWSCognitoIdentityUnlinkIdentityInput *)request;

- (BFTask *)updateIdentityPool:(AWSCognitoIdentityIdentityPool *)request;

@end
Loading

0 comments on commit da7dd32

Please sign in to comment.