Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

AWS SDK for iOS 1.3.0

  • Loading branch information...
commit 21701a32dd645d630c0e7846331a285f5ab41ada 1 parent f730a57
Kinney authored

Showing 1,003 changed files with 7,417 additions and 1,273 deletions. Show diff stats Hide diff stats

  1. +1 1  samples/AWSiOSDemoTVM/AWSiOSDemoTVM/Classes/AmazonClientManager.m
  2. +44 11 samples/AWSiOSDemoTVM/AWSiOSDemoTVM/Classes/TVMClient/AmazonKeyChainWrapper.m
  3. +4 4 samples/AWSiOSDemoTVM/AWSiOSDemoTVM/Classes/TVMClient/AmazonTVMClient.h
  4. +10 11 samples/AWSiOSDemoTVM/AWSiOSDemoTVM/Classes/TVMClient/AmazonTVMClient.m
  5. +1 1  samples/AWSiOSDemoTVMIdentity/AWSiOSDemoTVMIdentity/Classes/AmazonClientManager.m
  6. +44 11 samples/AWSiOSDemoTVMIdentity/AWSiOSDemoTVMIdentity/Classes/TVMClient/AmazonKeyChainWrapper.m
  7. +12 12 samples/AWSiOSDemoTVMIdentity/AWSiOSDemoTVMIdentity/Classes/TVMClient/AmazonTVMClient.m
  8. +32 0 samples/Locations2/Classes/AmazonClientManager.h
  9. +117 0 samples/Locations2/Classes/AmazonClientManager.m
  10. +41 0 samples/Locations2/Classes/AmazonKeyChainWrapper.h
  11. +221 0 samples/Locations2/Classes/AmazonKeyChainWrapper.m
  12. +37 0 samples/Locations2/Classes/AmazonTVMClient.h
  13. +140 0 samples/Locations2/Classes/AmazonTVMClient.m
  14. +28 0 samples/Locations2/Classes/Checkin.h
  15. +27 0 samples/Locations2/Classes/Checkin.m
  16. +31 0 samples/Locations2/Classes/CheckinsViewController.h
  17. +213 0 samples/Locations2/Classes/CheckinsViewController.m
  18. +36 0 samples/Locations2/Classes/Constants.h
  19. +20 0 samples/Locations2/Classes/Constants.m
  20. +30 0 samples/Locations2/Classes/Crypto.h
  21. +97 0 samples/Locations2/Classes/Crypto.m
  22. +31 0 samples/Locations2/Classes/GetTokenRequest.h
  23. +52 0 samples/Locations2/Classes/GetTokenRequest.m
  24. +33 0 samples/Locations2/Classes/GetTokenResponse.h
  25. +48 0 samples/Locations2/Classes/GetTokenResponse.m
  26. +25 0 samples/Locations2/Classes/GetTokenResponseHandler.h
  27. +59 0 samples/Locations2/Classes/GetTokenResponseHandler.m
  28. +24 0 samples/Locations2/Classes/JSONUtilities.h
  29. +39 0 samples/Locations2/Classes/JSONUtilities.m
  30. +36 0 samples/Locations2/Classes/Location.h
  31. +28 0 samples/Locations2/Classes/Location.m
  32. +35 0 samples/Locations2/Classes/LocationsAppDelegate.h
  33. +189 0 samples/Locations2/Classes/LocationsAppDelegate.m
  34. +31 0 samples/Locations2/Classes/RegisterDeviceRequest.h
  35. +47 0 samples/Locations2/Classes/RegisterDeviceRequest.m
  36. +24 0 samples/Locations2/Classes/Request.h
  37. +26 0 samples/Locations2/Classes/Request.m
  38. +32 0 samples/Locations2/Classes/RequestDelegate.h
  39. +85 0 samples/Locations2/Classes/RequestDelegate.m
  40. +30 0 samples/Locations2/Classes/Response.h
  41. +45 0 samples/Locations2/Classes/Response.m
  42. +24 0 samples/Locations2/Classes/ResponseHandler.h
  43. +27 0 samples/Locations2/Classes/ResponseHandler.m
  44. +30 0 samples/Locations2/Classes/RootViewController.h
  45. +342 0 samples/Locations2/Classes/RootViewController.m
  46. +27 0 samples/Locations2/Classes/Utilities.h
  47. +130 0 samples/Locations2/Classes/Utilities.m
  48. BIN  samples/Locations2/CoreData-Checkin.png
  49. BIN  samples/Locations2/CoreData-Location.png
  50. BIN  samples/Locations2/CoreData-Model.png
  51. +346 0 samples/Locations2/CoreData.html
  52. +39 0 samples/Locations2/Info.plist
  53. +462 0 samples/Locations2/Locations2.xcodeproj/project.pbxproj
  54. +26 0 samples/Locations2/Locations2_Prefix.pch
  55. +8 0 samples/Locations2/Model.xcdatamodeld/.xccurrentversion
  56. +20 0 samples/Locations2/Model.xcdatamodeld/Model.xcdatamodel/contents
  57. +192 0 samples/Locations2/en.lproj/MainWindow.xib
  58. BIN  samples/Locations2/images/Icon-72.png
  59. BIN  samples/Locations2/images/Icon-Small-50.png
  60. BIN  samples/Locations2/images/Icon-Small.png
  61. BIN  samples/Locations2/images/Icon-Small@2x.png
  62. BIN  samples/Locations2/images/Icon.png
  63. BIN  samples/Locations2/images/Icon@2x.png
  64. BIN  samples/Locations2/images/iTunesArtwork
  65. +22 0 samples/Locations2/main.m
  66. +19 6 samples/UserPreference/UserPreference/AmazonKeyChainWrapper.m
  67. +0 2  samples/UserPreference/UserPreference/AmazonTVMClient.h
  68. +7 14 samples/UserPreference/UserPreference/AmazonTVMClient.m
  69. +58 0 src-persistence/AWSPersistenceDynamoDBIncrementalStore.h
  70. +1,109 0 src-persistence/AWSPersistenceDynamoDBIncrementalStore.m
  71. +15 0 src/Amazon.AutoScaling/AutoScalingRequest.m
  72. +1 1  src/Amazon.EC2/Model/EC2ActivateLicenseRequestMarshaller.m
  73. +1 1  src/Amazon.EC2/Model/EC2AllocateAddressRequestMarshaller.m
  74. +1 1  src/Amazon.EC2/Model/EC2AssociateAddressRequestMarshaller.m
  75. +1 1  src/Amazon.EC2/Model/EC2AttachVolumeRequestMarshaller.m
  76. +1 1  src/Amazon.EC2/Model/EC2AuthorizeSecurityGroupIngressRequestMarshaller.m
  77. +1 1  src/Amazon.EC2/Model/EC2BundleInstanceRequestMarshaller.m
  78. +1 1  src/Amazon.EC2/Model/EC2CancelBundleTaskRequestMarshaller.m
  79. +1 1  src/Amazon.EC2/Model/EC2CancelConversionTaskRequestMarshaller.m
  80. +1 1  src/Amazon.EC2/Model/EC2CancelSpotInstanceRequestsRequestMarshaller.m
  81. +1 1  src/Amazon.EC2/Model/EC2ConfirmProductInstanceRequestMarshaller.m
  82. +1 1  src/Amazon.EC2/Model/EC2CreateImageRequestMarshaller.m
  83. +1 1  src/Amazon.EC2/Model/EC2CreateKeyPairRequestMarshaller.m
  84. +1 1  src/Amazon.EC2/Model/EC2CreatePlacementGroupRequestMarshaller.m
  85. +1 1  src/Amazon.EC2/Model/EC2CreateSecurityGroupRequestMarshaller.m
  86. +1 1  src/Amazon.EC2/Model/EC2CreateSnapshotRequestMarshaller.m
  87. +1 1  src/Amazon.EC2/Model/EC2CreateSpotDatafeedSubscriptionRequestMarshaller.m
  88. +1 1  src/Amazon.EC2/Model/EC2CreateTagsRequestMarshaller.m
  89. +1 1  src/Amazon.EC2/Model/EC2CreateVolumeRequestMarshaller.m
  90. +1 1  src/Amazon.EC2/Model/EC2DeactivateLicenseRequestMarshaller.m
  91. +1 1  src/Amazon.EC2/Model/EC2DeleteKeyPairRequestMarshaller.m
  92. +1 1  src/Amazon.EC2/Model/EC2DeletePlacementGroupRequestMarshaller.m
  93. +1 1  src/Amazon.EC2/Model/EC2DeleteSecurityGroupRequestMarshaller.m
  94. +1 1  src/Amazon.EC2/Model/EC2DeleteSnapshotRequestMarshaller.m
  95. +1 1  src/Amazon.EC2/Model/EC2DeleteSpotDatafeedSubscriptionRequestMarshaller.m
  96. +1 1  src/Amazon.EC2/Model/EC2DeleteTagsRequestMarshaller.m
  97. +1 1  src/Amazon.EC2/Model/EC2DeleteVolumeRequestMarshaller.m
  98. +1 1  src/Amazon.EC2/Model/EC2DeregisterImageRequestMarshaller.m
  99. +1 1  src/Amazon.EC2/Model/EC2DescribeAddressesRequestMarshaller.m
  100. +1 1  src/Amazon.EC2/Model/EC2DescribeAvailabilityZonesRequestMarshaller.m
  101. +1 1  src/Amazon.EC2/Model/EC2DescribeBundleTasksRequestMarshaller.m
  102. +1 1  src/Amazon.EC2/Model/EC2DescribeConversionTasksRequestMarshaller.m
  103. +1 1  src/Amazon.EC2/Model/EC2DescribeImageAttributeRequestMarshaller.m
  104. +1 1  src/Amazon.EC2/Model/EC2DescribeImagesRequestMarshaller.m
  105. +1 1  src/Amazon.EC2/Model/EC2DescribeInstanceAttributeRequestMarshaller.m
  106. +1 1  src/Amazon.EC2/Model/EC2DescribeInstanceStatusRequestMarshaller.m
  107. +1 1  src/Amazon.EC2/Model/EC2DescribeInstancesRequestMarshaller.m
  108. +1 1  src/Amazon.EC2/Model/EC2DescribeKeyPairsRequestMarshaller.m
  109. +1 1  src/Amazon.EC2/Model/EC2DescribeLicensesRequestMarshaller.m
  110. +1 1  src/Amazon.EC2/Model/EC2DescribePlacementGroupsRequestMarshaller.m
  111. +1 1  src/Amazon.EC2/Model/EC2DescribeRegionsRequestMarshaller.m
  112. +1 1  src/Amazon.EC2/Model/EC2DescribeReservedInstancesOfferingsRequestMarshaller.m
  113. +1 1  src/Amazon.EC2/Model/EC2DescribeReservedInstancesRequestMarshaller.m
  114. +1 1  src/Amazon.EC2/Model/EC2DescribeSecurityGroupsRequestMarshaller.m
  115. +1 1  src/Amazon.EC2/Model/EC2DescribeSnapshotAttributeRequestMarshaller.m
  116. +10 0 src/Amazon.EC2/Model/EC2DescribeSnapshotAttributeResponse.m
  117. +9 0 src/Amazon.EC2/Model/EC2DescribeSnapshotAttributeResponseUnmarshaller.m
  118. +1 1  src/Amazon.EC2/Model/EC2DescribeSnapshotsRequestMarshaller.m
  119. +1 1  src/Amazon.EC2/Model/EC2DescribeSpotDatafeedSubscriptionRequestMarshaller.m
  120. +1 1  src/Amazon.EC2/Model/EC2DescribeSpotInstanceRequestsRequestMarshaller.m
  121. +1 1  src/Amazon.EC2/Model/EC2DescribeSpotPriceHistoryRequestMarshaller.m
  122. +1 1  src/Amazon.EC2/Model/EC2DescribeTagsRequestMarshaller.m
  123. +1 1  src/Amazon.EC2/Model/EC2DescribeVolumeAttributeRequestMarshaller.m
  124. +10 0 src/Amazon.EC2/Model/EC2DescribeVolumeAttributeResponse.m
  125. +9 0 src/Amazon.EC2/Model/EC2DescribeVolumeAttributeResponseUnmarshaller.m
  126. +1 1  src/Amazon.EC2/Model/EC2DescribeVolumeStatusRequestMarshaller.m
  127. +1 1  src/Amazon.EC2/Model/EC2DescribeVolumesRequestMarshaller.m
  128. +1 1  src/Amazon.EC2/Model/EC2DetachVolumeRequestMarshaller.m
  129. +1 1  src/Amazon.EC2/Model/EC2DisassociateAddressRequestMarshaller.m
  130. +1 1  src/Amazon.EC2/Model/EC2EnableVolumeIORequestMarshaller.m
  131. +1 1  src/Amazon.EC2/Model/EC2GetConsoleOutputRequestMarshaller.m
  132. +1 1  src/Amazon.EC2/Model/EC2GetPasswordDataRequestMarshaller.m
  133. +1 1  src/Amazon.EC2/Model/EC2ImportInstanceRequestMarshaller.m
  134. +1 1  src/Amazon.EC2/Model/EC2ImportKeyPairRequestMarshaller.m
  135. +1 1  src/Amazon.EC2/Model/EC2ImportVolumeRequestMarshaller.m
  136. +13 0 src/Amazon.EC2/Model/EC2InstanceAttribute.m
  137. +9 0 src/Amazon.EC2/Model/EC2InstanceAttributeUnmarshaller.m
  138. +1 1  src/Amazon.EC2/Model/EC2ModifyImageAttributeRequestMarshaller.m
  139. +1 1  src/Amazon.EC2/Model/EC2ModifyInstanceAttributeRequestMarshaller.m
  140. +1 1  src/Amazon.EC2/Model/EC2ModifySnapshotAttributeRequestMarshaller.m
  141. +1 1  src/Amazon.EC2/Model/EC2ModifyVolumeAttributeRequestMarshaller.m
  142. +1 1  src/Amazon.EC2/Model/EC2MonitorInstancesRequestMarshaller.m
  143. +5 1 src/Amazon.EC2/Model/EC2ProductCode.m
  144. +5 0 src/Amazon.EC2/Model/EC2ProductCodeUnmarshaller.m
  145. +1 1  src/Amazon.EC2/Model/EC2PurchaseReservedInstancesOfferingRequestMarshaller.m
  146. +1 1  src/Amazon.EC2/Model/EC2RebootInstancesRequestMarshaller.m
  147. +1 1  src/Amazon.EC2/Model/EC2RegisterImageRequestMarshaller.m
  148. +1 1  src/Amazon.EC2/Model/EC2ReleaseAddressRequestMarshaller.m
  149. +1 1  src/Amazon.EC2/Model/EC2ReportInstanceStatusRequestMarshaller.m
  150. +1 1  src/Amazon.EC2/Model/EC2RequestSpotInstancesRequestMarshaller.m
  151. +1 1  src/Amazon.EC2/Model/EC2ResetImageAttributeRequestMarshaller.m
  152. +1 1  src/Amazon.EC2/Model/EC2ResetInstanceAttributeRequestMarshaller.m
  153. +1 1  src/Amazon.EC2/Model/EC2ResetSnapshotAttributeRequestMarshaller.m
  154. +1 1  src/Amazon.EC2/Model/EC2RevokeSecurityGroupIngressRequestMarshaller.m
  155. +8 8 src/Amazon.EC2/Model/EC2RunInstancesRequestMarshaller.m
  156. +1 1  src/Amazon.EC2/Model/EC2StartInstancesRequestMarshaller.m
  157. +1 1  src/Amazon.EC2/Model/EC2StopInstancesRequestMarshaller.m
  158. +1 1  src/Amazon.EC2/Model/EC2TerminateInstancesRequestMarshaller.m
  159. +1 1  src/Amazon.EC2/Model/EC2UnmonitorInstancesRequestMarshaller.m
  160. +15 0 src/Amazon.ElasticLoadBalancing/ElasticLoadBalancingRequest.m
  161. +0 6 src/Amazon.Runtime/AmazonAbstractWebServiceClient.m
  162. +23 10 src/Amazon.Runtime/AmazonDictionaryUnmarshaller.m
  163. +35 0 src/Amazon.SES/AmazonSESClient.m
  164. +57 0 src/Amazon.SES/Model/SESDeleteIdentityRequest.m
  165. +43 0 src/Amazon.SES/Model/SESDeleteIdentityRequestMarshaller.m
  166. +68 0 src/Amazon.SES/Model/SESDeleteIdentityResponse.m
  167. +66 0 src/Amazon.SES/Model/SESDeleteIdentityResponseUnmarshaller.m
  168. +66 0 src/Amazon.SES/Model/SESGetIdentityVerificationAttributesRequest.m
  169. +49 0 src/Amazon.SES/Model/SESGetIdentityVerificationAttributesRequestMarshaller.m
  170. +78 0 src/Amazon.SES/Model/SESGetIdentityVerificationAttributesResponse.m
  171. +77 0 src/Amazon.SES/Model/SESGetIdentityVerificationAttributesResponseUnmarshaller.m
  172. +61 0 src/Amazon.SES/Model/SESIdentityVerificationAttributes.m
  173. +76 0 src/Amazon.SES/Model/SESIdentityVerificationAttributesUnmarshaller.m
  174. +65 0 src/Amazon.SES/Model/SESListIdentitiesRequest.m
  175. +53 0 src/Amazon.SES/Model/SESListIdentitiesRequestMarshaller.m
  176. +83 0 src/Amazon.SES/Model/SESListIdentitiesResponse.m
  177. +80 0 src/Amazon.SES/Model/SESListIdentitiesResponseUnmarshaller.m
  178. +57 0 src/Amazon.SES/Model/SESVerifyDomainIdentityRequest.m
  179. +43 0 src/Amazon.SES/Model/SESVerifyDomainIdentityRequestMarshaller.m
  180. +73 0 src/Amazon.SES/Model/SESVerifyDomainIdentityResponse.m
  181. +71 0 src/Amazon.SES/Model/SESVerifyDomainIdentityResponseUnmarshaller.m
  182. +57 0 src/Amazon.SES/Model/SESVerifyEmailIdentityRequest.m
  183. +43 0 src/Amazon.SES/Model/SESVerifyEmailIdentityRequestMarshaller.m
  184. +68 0 src/Amazon.SES/Model/SESVerifyEmailIdentityResponse.m
  185. +66 0 src/Amazon.SES/Model/SESVerifyEmailIdentityResponseUnmarshaller.m
  186. +14 0 src/Amazon.SES/SESRequest.m
  187. +5 13 src/Amazon.SNS/Model/SNSGetSubscriptionAttributesResponseUnmarshaller.m
  188. +5 13 src/Amazon.SNS/Model/SNSGetTopicAttributesResponseUnmarshaller.m
  189. +14 0 src/Amazon.SNS/SNSRequest.m
  190. +3 12 src/Amazon.SQS/Model/SQSGetQueueAttributesResponseUnmarshaller.m
  191. +3 12 src/Amazon.SQS/Model/SQSMessageUnmarshaller.m
  192. +14 0 src/Amazon.SQS/SQSRequest.m
  193. +22 17 src/Amazon.STS/AmazonSecurityTokenServiceClient.m
  194. +6 0 src/include/AmazonDictionaryUnmarshaller.h
  195. +12 12 src/include/AmazonEndpoints.h
  196. +1 1  src/include/AmazonSDKUtil.h
  197. +470 554 src/include/AutoScaling/AmazonAutoScalingClient.h
  198. +0 2  src/include/AutoScaling/AutoScalingActivity.h
  199. +0 2  src/include/AutoScaling/AutoScalingAdjustmentType.h
  200. +0 2  src/include/AutoScaling/AutoScalingAlarm.h
  201. +0 2  src/include/AutoScaling/AutoScalingAlreadyExistsException.h
  202. +0 2  src/include/AutoScaling/AutoScalingAutoScalingGroup.h
  203. +0 2  src/include/AutoScaling/AutoScalingAutoScalingInstanceDetails.h
  204. +0 2  src/include/AutoScaling/AutoScalingBlockDeviceMapping.h
  205. +0 2  src/include/AutoScaling/AutoScalingCreateAutoScalingGroupRequest.h
  206. +0 2  src/include/AutoScaling/AutoScalingCreateAutoScalingGroupResponse.h
  207. +0 2  src/include/AutoScaling/AutoScalingCreateLaunchConfigurationRequest.h
  208. +0 2  src/include/AutoScaling/AutoScalingCreateLaunchConfigurationResponse.h
  209. +0 2  src/include/AutoScaling/AutoScalingCreateOrUpdateTagsRequest.h
  210. +0 2  src/include/AutoScaling/AutoScalingCreateOrUpdateTagsResponse.h
  211. +0 2  src/include/AutoScaling/AutoScalingDeleteAutoScalingGroupRequest.h
  212. +0 2  src/include/AutoScaling/AutoScalingDeleteAutoScalingGroupResponse.h
  213. +0 2  src/include/AutoScaling/AutoScalingDeleteLaunchConfigurationRequest.h
  214. +0 2  src/include/AutoScaling/AutoScalingDeleteLaunchConfigurationResponse.h
  215. +0 2  src/include/AutoScaling/AutoScalingDeleteNotificationConfigurationRequest.h
  216. +0 2  src/include/AutoScaling/AutoScalingDeleteNotificationConfigurationResponse.h
  217. +0 2  src/include/AutoScaling/AutoScalingDeletePolicyRequest.h
  218. +0 2  src/include/AutoScaling/AutoScalingDeletePolicyResponse.h
  219. +0 2  src/include/AutoScaling/AutoScalingDeleteScheduledActionRequest.h
  220. +0 2  src/include/AutoScaling/AutoScalingDeleteScheduledActionResponse.h
  221. +0 2  src/include/AutoScaling/AutoScalingDeleteTagsRequest.h
  222. +0 2  src/include/AutoScaling/AutoScalingDeleteTagsResponse.h
  223. +0 2  src/include/AutoScaling/AutoScalingDescribeAdjustmentTypesRequest.h
  224. +0 2  src/include/AutoScaling/AutoScalingDescribeAdjustmentTypesResponse.h
  225. +0 2  src/include/AutoScaling/AutoScalingDescribeAutoScalingGroupsRequest.h
  226. +0 2  src/include/AutoScaling/AutoScalingDescribeAutoScalingGroupsResponse.h
  227. +0 2  src/include/AutoScaling/AutoScalingDescribeAutoScalingInstancesRequest.h
  228. +0 2  src/include/AutoScaling/AutoScalingDescribeAutoScalingInstancesResponse.h
  229. +0 2  src/include/AutoScaling/AutoScalingDescribeAutoScalingNotificationTypesRequest.h
  230. +0 2  src/include/AutoScaling/AutoScalingDescribeAutoScalingNotificationTypesResponse.h
  231. +0 2  src/include/AutoScaling/AutoScalingDescribeLaunchConfigurationsRequest.h
  232. +0 2  src/include/AutoScaling/AutoScalingDescribeLaunchConfigurationsResponse.h
  233. +0 2  src/include/AutoScaling/AutoScalingDescribeMetricCollectionTypesRequest.h
  234. +0 2  src/include/AutoScaling/AutoScalingDescribeMetricCollectionTypesResponse.h
  235. +0 2  src/include/AutoScaling/AutoScalingDescribeNotificationConfigurationsRequest.h
  236. +0 2  src/include/AutoScaling/AutoScalingDescribeNotificationConfigurationsResponse.h
  237. +0 2  src/include/AutoScaling/AutoScalingDescribePoliciesRequest.h
  238. +0 2  src/include/AutoScaling/AutoScalingDescribePoliciesResponse.h
  239. +0 2  src/include/AutoScaling/AutoScalingDescribeScalingActivitiesRequest.h
  240. +0 2  src/include/AutoScaling/AutoScalingDescribeScalingActivitiesResponse.h
  241. +0 2  src/include/AutoScaling/AutoScalingDescribeScalingProcessTypesRequest.h
  242. +0 2  src/include/AutoScaling/AutoScalingDescribeScalingProcessTypesResponse.h
  243. +0 2  src/include/AutoScaling/AutoScalingDescribeScheduledActionsRequest.h
  244. +0 2  src/include/AutoScaling/AutoScalingDescribeScheduledActionsResponse.h
  245. +0 2  src/include/AutoScaling/AutoScalingDescribeTagsRequest.h
  246. +0 2  src/include/AutoScaling/AutoScalingDescribeTagsResponse.h
  247. +0 2  src/include/AutoScaling/AutoScalingDisableMetricsCollectionRequest.h
  248. +0 2  src/include/AutoScaling/AutoScalingDisableMetricsCollectionResponse.h
  249. +0 2  src/include/AutoScaling/AutoScalingEbs.h
  250. +0 2  src/include/AutoScaling/AutoScalingEnableMetricsCollectionRequest.h
  251. +0 2  src/include/AutoScaling/AutoScalingEnableMetricsCollectionResponse.h
  252. +0 2  src/include/AutoScaling/AutoScalingEnabledMetric.h
  253. +0 2  src/include/AutoScaling/AutoScalingExecutePolicyRequest.h
  254. +0 2  src/include/AutoScaling/AutoScalingExecutePolicyResponse.h
  255. +0 2  src/include/AutoScaling/AutoScalingFilter.h
  256. +0 2  src/include/AutoScaling/AutoScalingInstance.h
  257. +0 2  src/include/AutoScaling/AutoScalingInstanceMonitoring.h
  258. +0 2  src/include/AutoScaling/AutoScalingInvalidNextTokenException.h
  259. +0 2  src/include/AutoScaling/AutoScalingLaunchConfiguration.h
  260. +0 2  src/include/AutoScaling/AutoScalingLimitExceededException.h
  261. +0 2  src/include/AutoScaling/AutoScalingMetricCollectionType.h
  262. +0 2  src/include/AutoScaling/AutoScalingMetricGranularityType.h
  263. +0 2  src/include/AutoScaling/AutoScalingNotificationConfiguration.h
  264. +0 2  src/include/AutoScaling/AutoScalingProcessType.h
  265. +0 2  src/include/AutoScaling/AutoScalingPutNotificationConfigurationRequest.h
  266. +0 2  src/include/AutoScaling/AutoScalingPutNotificationConfigurationResponse.h
  267. +0 2  src/include/AutoScaling/AutoScalingPutScalingPolicyRequest.h
  268. +0 2  src/include/AutoScaling/AutoScalingPutScalingPolicyResponse.h
  269. +0 2  src/include/AutoScaling/AutoScalingPutScheduledUpdateGroupActionRequest.h
  270. +0 2  src/include/AutoScaling/AutoScalingPutScheduledUpdateGroupActionResponse.h
  271. +18 0 src/include/AutoScaling/AutoScalingRequest.h
  272. +0 2  src/include/AutoScaling/AutoScalingResourceInUseException.h
  273. +3 0  src/include/AutoScaling/AutoScalingResponse.h
  274. +0 2  src/include/AutoScaling/AutoScalingResumeProcessesRequest.h
  275. +0 2  src/include/AutoScaling/AutoScalingResumeProcessesResponse.h
  276. +0 2  src/include/AutoScaling/AutoScalingScalingActivityInProgressException.h
  277. +0 2  src/include/AutoScaling/AutoScalingScalingPolicy.h
  278. +0 2  src/include/AutoScaling/AutoScalingScheduledUpdateGroupAction.h
  279. +0 2  src/include/AutoScaling/AutoScalingSetDesiredCapacityRequest.h
  280. +0 2  src/include/AutoScaling/AutoScalingSetDesiredCapacityResponse.h
  281. +0 2  src/include/AutoScaling/AutoScalingSetInstanceHealthRequest.h
  282. +0 2  src/include/AutoScaling/AutoScalingSetInstanceHealthResponse.h
  283. +0 2  src/include/AutoScaling/AutoScalingSuspendProcessesRequest.h
  284. +0 2  src/include/AutoScaling/AutoScalingSuspendProcessesResponse.h
  285. +0 2  src/include/AutoScaling/AutoScalingSuspendedProcess.h
  286. +0 2  src/include/AutoScaling/AutoScalingTag.h
  287. +0 2  src/include/AutoScaling/AutoScalingTagDescription.h
  288. +0 2  src/include/AutoScaling/AutoScalingTerminateInstanceInAutoScalingGroupRequest.h
  289. +0 2  src/include/AutoScaling/AutoScalingTerminateInstanceInAutoScalingGroupResponse.h
  290. +0 2  src/include/AutoScaling/AutoScalingUpdateAutoScalingGroupRequest.h
  291. +0 2  src/include/AutoScaling/AutoScalingUpdateAutoScalingGroupResponse.h
  292. +189 242 src/include/CloudWatch/AmazonCloudWatchClient.h
  293. +0 2  src/include/CloudWatch/CloudWatchAlarmHistoryItem.h
  294. +0 2  src/include/CloudWatch/CloudWatchDatapoint.h
  295. +0 2  src/include/CloudWatch/CloudWatchDeleteAlarmsRequest.h
  296. +0 2  src/include/CloudWatch/CloudWatchDeleteAlarmsResponse.h
  297. +0 2  src/include/CloudWatch/CloudWatchDescribeAlarmHistoryRequest.h
  298. +0 2  src/include/CloudWatch/CloudWatchDescribeAlarmHistoryResponse.h
  299. +0 2  src/include/CloudWatch/CloudWatchDescribeAlarmsForMetricRequest.h
  300. +0 2  src/include/CloudWatch/CloudWatchDescribeAlarmsForMetricResponse.h
  301. +0 2  src/include/CloudWatch/CloudWatchDescribeAlarmsRequest.h
  302. +0 2  src/include/CloudWatch/CloudWatchDescribeAlarmsResponse.h
  303. +0 2  src/include/CloudWatch/CloudWatchDimension.h
  304. +0 2  src/include/CloudWatch/CloudWatchDimensionFilter.h
  305. +0 2  src/include/CloudWatch/CloudWatchDisableAlarmActionsRequest.h
  306. +0 2  src/include/CloudWatch/CloudWatchDisableAlarmActionsResponse.h
  307. +0 2  src/include/CloudWatch/CloudWatchEnableAlarmActionsRequest.h
  308. +0 2  src/include/CloudWatch/CloudWatchEnableAlarmActionsResponse.h
  309. +0 2  src/include/CloudWatch/CloudWatchGetMetricStatisticsRequest.h
  310. +0 2  src/include/CloudWatch/CloudWatchGetMetricStatisticsResponse.h
Sorry, we could not display the entire diff because too many files (1,003) changed.
2  samples/AWSiOSDemoTVM/AWSiOSDemoTVM/Classes/AmazonClientManager.m
@@ -80,7 +80,7 @@ +(Response *)validateCredentials
80 80 if ( [ableToGetToken wasSuccessful] && ((sdb == nil) || (s3 == nil) || (sqs == nil) || (sns == nil))) {
81 81 [AmazonClientManager clearCredentials];
82 82
83   - AmazonCredentials *credentials = [[AmazonKeyChainWrapper getCredentialsFromKeyChain] autorelease];
  83 + AmazonCredentials *credentials = [AmazonKeyChainWrapper getCredentialsFromKeyChain];
84 84 s3 = [[AmazonS3Client alloc] initWithCredentials:credentials];
85 85 sdb = [[AmazonSimpleDBClient alloc] initWithCredentials:credentials];
86 86 sqs = [[AmazonSQSClient alloc] initWithCredentials:credentials];
55 samples/AWSiOSDemoTVM/AWSiOSDemoTVM/Classes/TVMClient/AmazonKeyChainWrapper.m
@@ -17,17 +17,30 @@
17 17 #import <AWSiOSSDK/AmazonLogger.h>
18 18
19 19
20   -static NSString *kKeychainAccessKeyIdentifier = @"AWSiOSDemoTVM.com.amazon.aws.demo.AWSAccessKey";
21   -static NSString *kKeychainSecretKeyIdentifier = @"AWSiOSDemoTVM.com.amazon.aws.demo.AWSSecretKey";
22   -static NSString *kKeychainSecrutiyTokenIdentifier = @"AWSiOSDemoTVM.com.amazon.aws.demo.AWSSecurityToken";
23   -static NSString *kKeychainExpirationDateIdentifier = @"AWSiOSDemoTVM.com.amazon.aws.demo.AWSExpirationDate";
24 20
25   -static NSString *kKeychainUidIdentifier = @"AWSiOSDemoTVM.com.amazon.aws.demo.UID";
26   -static NSString *kKeychainKeyIdentifier = @"AWSiOSDemoTVM.com.amazon.aws.demo.KEY";
  21 +
  22 +NSString *kKeychainAccessKeyIdentifier;
  23 +NSString *kKeychainSecretKeyIdentifier;
  24 +NSString *kKeychainSecrutiyTokenIdentifier;
  25 +NSString *kKeychainExpirationDateIdentifier;
  26 +
  27 +NSString *kKeychainUidIdentifier;
  28 +NSString *kKeychainKeyIdentifier;
27 29
28 30
29 31 @implementation AmazonKeyChainWrapper
30 32
  33 ++(void)initialize {
  34 + NSString *bundleID = [NSBundle mainBundle].bundleIdentifier;
  35 + kKeychainAccessKeyIdentifier = [[NSString stringWithFormat:@"%@.AWSAccessKey", bundleID] retain];
  36 + kKeychainSecretKeyIdentifier= [[NSString stringWithFormat:@"%@.AWSSecretKey", bundleID] retain];
  37 + kKeychainSecrutiyTokenIdentifier = [[NSString stringWithFormat:@"%@.AWSSecurityToken", bundleID] retain];
  38 + kKeychainExpirationDateIdentifier = [[NSString stringWithFormat:@"%@.AWSExpirationDate", bundleID] retain];
  39 +
  40 + kKeychainUidIdentifier = [[NSString stringWithFormat:@"%@.UID", bundleID] retain];
  41 + kKeychainKeyIdentifier = [[NSString stringWithFormat:@"%@.KEY", bundleID] retain];
  42 +}
  43 +
31 44 +(bool)areCredentialsExpired
32 45 {
33 46 AMZLogDebug(@"areCredentialsExpired");
@@ -37,7 +50,7 @@ +(bool)areCredentialsExpired
37 50 return YES;
38 51 }
39 52 else {
40   - NSDate *expirationDate = [[AmazonKeyChainWrapper convertStringToDate:expiration] autorelease];
  53 + NSDate *expirationDate = [AmazonKeyChainWrapper convertStringToDate:expiration];
41 54
42 55 AMZLog(@"expirationDate : %@, %@", expiration, expirationDate);
43 56
@@ -69,7 +82,7 @@ +(AmazonCredentials *)getCredentialsFromKeyChain
69 82
70 83 if ((accessKey != nil) && (secretKey != nil) && (securityToken != nil)) {
71 84 if (![AmazonKeyChainWrapper areCredentialsExpired]) {
72   - AmazonCredentials *credentials = [[AmazonCredentials alloc] initWithAccessKey:accessKey withSecretKey:secretKey];
  85 + AmazonCredentials *credentials = [[[AmazonCredentials alloc] initWithAccessKey:accessKey withSecretKey:secretKey] autorelease];
73 86 credentials.securityToken = securityToken;
74 87
75 88 return credentials;
@@ -101,11 +114,13 @@ +(bool)isExpired:(NSDate *)date
101 114
102 115 +(NSDate *)convertStringToDate:(NSString *)expiration
103 116 {
104   - if (expiration != nil) {
  117 + if (expiration != nil)
  118 + {
105 119 long long exactSecondOfExpiration = (long long)([expiration longLongValue] / 1000);
106   - return [[NSDate alloc] initWithTimeIntervalSince1970:exactSecondOfExpiration];
  120 + return [[[NSDate alloc] initWithTimeIntervalSince1970:exactSecondOfExpiration] autorelease];
107 121 }
108   - else {
  122 + else
  123 + {
109 124 return nil;
110 125 }
111 126 }
@@ -157,20 +172,38 @@ +(void)wipeKeyChain
157 172 {
158 173 OSStatus keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainAccessKeyIdentifier]);
159 174
  175 + AMZLogDebug(@"Keychain Key: kKeychainAccessKeyIdentifier, Error Code: %ld", keychainError);
  176 +
160 177 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecretKeyIdentifier]);
  178 + AMZLogDebug(@"Keychain Key: kKeychainSecretKeyIdentifier, Error Code: %ld", keychainError);
  179 +
161 180 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecrutiyTokenIdentifier]);
  181 + AMZLogDebug(@"Keychain Key: kKeychainSecrutiyTokenIdentifier, Error Code: %ld", keychainError);
  182 +
162 183 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainExpirationDateIdentifier]);
  184 + AMZLogDebug(@"Keychain Key: kKeychainExpirationDateIdentifier, Error Code: %ld", keychainError);
  185 +
163 186 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainUidIdentifier]);
  187 + AMZLogDebug(@"Keychain Key: kKeychainUidIdentifier, Error Code: %ld", keychainError);
  188 +
164 189 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainKeyIdentifier]);
  190 + AMZLogDebug(@"Keychain Key: kKeychainKeyIdentifier, Error Code: %ld", keychainError);
165 191 }
166 192
167 193 +(void)wipeCredentialsFromKeyChain
168 194 {
169 195 OSStatus keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainAccessKeyIdentifier]);
170 196
  197 + AMZLogDebug(@"Keychain Key: kKeychainAccessKeyIdentifier, Error Code: %ld", keychainError);
  198 +
171 199 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecretKeyIdentifier]);
  200 + AMZLogDebug(@"Keychain Key: kKeychainSecretKeyIdentifier, Error Code: %ld", keychainError);
  201 +
172 202 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecrutiyTokenIdentifier]);
  203 + AMZLogDebug(@"Keychain Key: kKeychainSecrutiyTokenIdentifier, Error Code: %ld", keychainError);
  204 +
173 205 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainExpirationDateIdentifier]);
  206 + AMZLogDebug(@"Keychain Key: kKeychainExpirationDateIdentifier, Error Code: %ld", keychainError);
174 207 }
175 208
176 209 +(NSMutableDictionary *)createKeychainDictionaryForKey:(NSString *)key
8 samples/AWSiOSDemoTVM/AWSiOSDemoTVM/Classes/TVMClient/AmazonTVMClient.h
@@ -20,12 +20,12 @@
20 20
21 21
22 22 @interface AmazonTVMClient:NSObject {
23   - NSString *endpoint;
24   - bool useSSL;
  23 + NSString *endpoint;
  24 + bool useSSL;
25 25 }
26 26
27   -@property (nonatomic, retain) NSString *endpoint;
28   -@property (nonatomic) bool useSSL;
  27 +@property (nonatomic, retain) NSString *endpoint;
  28 +@property (nonatomic) bool useSSL;
29 29
30 30 -(id)initWithEndpoint:(NSString *)endpoint useSSL:(bool)useSSL;
31 31 -(Response *)anonymousRegister;
21 samples/AWSiOSDemoTVM/AWSiOSDemoTVM/Classes/TVMClient/AmazonTVMClient.m
@@ -16,7 +16,7 @@
16 16 #import "AmazonTVMClient.h"
17 17 #import "AmazonKeyChainWrapper.h"
18 18 #import <AWSiOSSDK/AmazonLogger.h>
19   -#import <AWSiOSSDk/AmazonAuthUtils.h>
  19 +#import <AWSiOSSDK/AmazonAuthUtils.h>
20 20
21 21 #import "RequestDelegate.h"
22 22
@@ -30,8 +30,7 @@
30 30
31 31 @implementation AmazonTVMClient
32 32
33   -@synthesize endpoint;
34   -@synthesize useSSL;
  33 +@synthesize endpoint, useSSL;
35 34
36 35 -(id)initWithEndpoint:(NSString *)theEndpoint useSSL:(bool)usingSSL;
37 36 {
@@ -94,16 +93,16 @@ -(Response *)processRequest:(Request *)request responseHandler:(ResponseHandler
94 93 do {
95 94 AMZLogDebug(@"Request URL: %@", [request buildRequestUrl]);
96 95
97   - NSURL *url = [[[NSURL alloc] initWithString:[request buildRequestUrl]] autorelease];
98   - NSURLRequest *theRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
99   - [[NSURLConnection alloc] initWithRequest:theRequest delegate:delegate];
  96 + NSURL *url = [[[NSURL alloc] initWithString:[request buildRequestUrl]] autorelease];
  97 + NSURLRequest *theRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
  98 + NSError *error = nil;
  99 + NSHTTPURLResponse *response = nil;
100 100
101   - while (!delegate.failed && !delegate.done) {
102   - [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[[NSDate date] dateByAddingTimeInterval:1]];
103   - }
  101 + NSData *data = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
104 102
105   - if (!delegate.failed) {
106   - return [handler handleResponse:200 body:delegate.responseBody];
  103 + if (error == nil)
  104 + {
  105 + return [handler handleResponse:response.statusCode body:[[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]];
107 106 }
108 107 } while (delegate.failed && retries-- > 0);
109 108
2  samples/AWSiOSDemoTVMIdentity/AWSiOSDemoTVMIdentity/Classes/AmazonClientManager.m
@@ -91,7 +91,7 @@ +(Response *)validateCredentials
91 91 if ( ([ableToGetToken wasSuccessful] && (sdb == nil)) || (s3 == nil) || (sqs == nil) || (sns == nil)) {
92 92 [AmazonClientManager clearCredentials];
93 93
94   - AmazonCredentials *credentials = [[AmazonKeyChainWrapper getCredentialsFromKeyChain] autorelease];
  94 + AmazonCredentials *credentials = [AmazonKeyChainWrapper getCredentialsFromKeyChain];
95 95 s3 = [[AmazonS3Client alloc] initWithCredentials:credentials];
96 96 sdb = [[AmazonSimpleDBClient alloc] initWithCredentials:credentials];
97 97 sqs = [[AmazonSQSClient alloc] initWithCredentials:credentials];
55 samples/AWSiOSDemoTVMIdentity/AWSiOSDemoTVMIdentity/Classes/TVMClient/AmazonKeyChainWrapper.m
@@ -17,17 +17,30 @@
17 17 #import <AWSiOSSDK/AmazonLogger.h>
18 18
19 19
20   -static NSString *kKeychainAccessKeyIdentifier = @"AWSiOSDemoTVMIdentity.com.amazon.aws.demo.AWSAccessKey";
21   -static NSString *kKeychainSecretKeyIdentifier = @"AWSiOSDemoTVMIdentity.com.amazon.aws.demo.AWSSecretKey";
22   -static NSString *kKeychainSecrutiyTokenIdentifier = @"AWSiOSDemoTVMIdentity.com.amazon.aws.demo.AWSSecurityToken";
23   -static NSString *kKeychainExpirationDateIdentifier = @"AWSiOSDemoTVMIdentity.com.amazon.aws.demo.AWSExpirationDate";
24 20
25   -static NSString *kKeychainUidIdentifier = @"AWSiOSDemoTVMIdentity.com.amazon.aws.demo.UID";
26   -static NSString *kKeychainKeyIdentifier = @"AWSiOSDemoTVMIdentity.com.amazon.aws.demo.KEY";
  21 +
  22 +NSString *kKeychainAccessKeyIdentifier;
  23 +NSString *kKeychainSecretKeyIdentifier;
  24 +NSString *kKeychainSecrutiyTokenIdentifier;
  25 +NSString *kKeychainExpirationDateIdentifier;
  26 +
  27 +NSString *kKeychainUidIdentifier;
  28 +NSString *kKeychainKeyIdentifier;
27 29
28 30
29 31 @implementation AmazonKeyChainWrapper
30 32
  33 ++(void)initialize {
  34 + NSString *bundleID = [NSBundle mainBundle].bundleIdentifier;
  35 + kKeychainAccessKeyIdentifier = [[NSString stringWithFormat:@"%@.AWSAccessKey", bundleID] retain];
  36 + kKeychainSecretKeyIdentifier= [[NSString stringWithFormat:@"%@.AWSSecretKey", bundleID] retain];
  37 + kKeychainSecrutiyTokenIdentifier = [[NSString stringWithFormat:@"%@.AWSSecurityToken", bundleID] retain];
  38 + kKeychainExpirationDateIdentifier = [[NSString stringWithFormat:@"%@.AWSExpirationDate", bundleID] retain];
  39 +
  40 + kKeychainUidIdentifier = [[NSString stringWithFormat:@"%@.UID", bundleID] retain];
  41 + kKeychainKeyIdentifier = [[NSString stringWithFormat:@"%@.KEY", bundleID] retain];
  42 +}
  43 +
31 44 +(bool)areCredentialsExpired
32 45 {
33 46 AMZLogDebug(@"areCredentialsExpired");
@@ -37,7 +50,7 @@ +(bool)areCredentialsExpired
37 50 return YES;
38 51 }
39 52 else {
40   - NSDate *expirationDate = [[AmazonKeyChainWrapper convertStringToDate:expiration] autorelease];
  53 + NSDate *expirationDate = [AmazonKeyChainWrapper convertStringToDate:expiration];
41 54
42 55 AMZLog(@"expirationDate : %@, %@", expiration, expirationDate);
43 56
@@ -69,7 +82,7 @@ +(AmazonCredentials *)getCredentialsFromKeyChain
69 82
70 83 if ((accessKey != nil) && (secretKey != nil) && (securityToken != nil)) {
71 84 if (![AmazonKeyChainWrapper areCredentialsExpired]) {
72   - AmazonCredentials *credentials = [[AmazonCredentials alloc] initWithAccessKey:accessKey withSecretKey:secretKey];
  85 + AmazonCredentials *credentials = [[[AmazonCredentials alloc] initWithAccessKey:accessKey withSecretKey:secretKey] autorelease];
73 86 credentials.securityToken = securityToken;
74 87
75 88 return credentials;
@@ -101,11 +114,13 @@ +(bool)isExpired:(NSDate *)date
101 114
102 115 +(NSDate *)convertStringToDate:(NSString *)expiration
103 116 {
104   - if (expiration != nil) {
  117 + if (expiration != nil)
  118 + {
105 119 long long exactSecondOfExpiration = (long long)([expiration longLongValue] / 1000);
106   - return [[NSDate alloc] initWithTimeIntervalSince1970:exactSecondOfExpiration];
  120 + return [[[NSDate alloc] initWithTimeIntervalSince1970:exactSecondOfExpiration] autorelease];
107 121 }
108   - else {
  122 + else
  123 + {
109 124 return nil;
110 125 }
111 126 }
@@ -157,20 +172,38 @@ +(void)wipeKeyChain
157 172 {
158 173 OSStatus keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainAccessKeyIdentifier]);
159 174
  175 + AMZLogDebug(@"Keychain Key: kKeychainAccessKeyIdentifier, Error Code: %ld", keychainError);
  176 +
160 177 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecretKeyIdentifier]);
  178 + AMZLogDebug(@"Keychain Key: kKeychainSecretKeyIdentifier, Error Code: %ld", keychainError);
  179 +
161 180 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecrutiyTokenIdentifier]);
  181 + AMZLogDebug(@"Keychain Key: kKeychainSecrutiyTokenIdentifier, Error Code: %ld", keychainError);
  182 +
162 183 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainExpirationDateIdentifier]);
  184 + AMZLogDebug(@"Keychain Key: kKeychainExpirationDateIdentifier, Error Code: %ld", keychainError);
  185 +
163 186 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainUidIdentifier]);
  187 + AMZLogDebug(@"Keychain Key: kKeychainUidIdentifier, Error Code: %ld", keychainError);
  188 +
164 189 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainKeyIdentifier]);
  190 + AMZLogDebug(@"Keychain Key: kKeychainKeyIdentifier, Error Code: %ld", keychainError);
165 191 }
166 192
167 193 +(void)wipeCredentialsFromKeyChain
168 194 {
169 195 OSStatus keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainAccessKeyIdentifier]);
170 196
  197 + AMZLogDebug(@"Keychain Key: kKeychainAccessKeyIdentifier, Error Code: %ld", keychainError);
  198 +
171 199 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecretKeyIdentifier]);
  200 + AMZLogDebug(@"Keychain Key: kKeychainSecretKeyIdentifier, Error Code: %ld", keychainError);
  201 +
172 202 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecrutiyTokenIdentifier]);
  203 + AMZLogDebug(@"Keychain Key: kKeychainSecrutiyTokenIdentifier, Error Code: %ld", keychainError);
  204 +
173 205 keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainExpirationDateIdentifier]);
  206 + AMZLogDebug(@"Keychain Key: kKeychainExpirationDateIdentifier, Error Code: %ld", keychainError);
174 207 }
175 208
176 209 +(NSMutableDictionary *)createKeychainDictionaryForKey:(NSString *)key
24 samples/AWSiOSDemoTVMIdentity/AWSiOSDemoTVMIdentity/Classes/TVMClient/AmazonTVMClient.m
@@ -97,20 +97,20 @@ -(Response *)processRequest:(Request *)request responseHandler:(ResponseHandler
97 97
98 98 do {
99 99 AMZLogDebug(@"Request URL: %@", [request buildRequestUrl]);
100   -
101   - NSURL *url = [[[NSURL alloc] initWithString:[request buildRequestUrl]] autorelease];
102   - NSURLRequest *theRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
103   - [[NSURLConnection alloc] initWithRequest:theRequest delegate:delegate];
104   -
105   - while (!delegate.failed && !delegate.done) {
106   - [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[[NSDate date] dateByAddingTimeInterval:1]];
107   - }
108   -
109   - if (!delegate.failed) {
110   - return [handler handleResponse:200 body:delegate.responseBody];
  100 +
  101 + NSURL *url = [[[NSURL alloc] initWithString:[request buildRequestUrl]] autorelease];
  102 + NSURLRequest *theRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
  103 + NSError *error = nil;
  104 + NSHTTPURLResponse *response = nil;
  105 +
  106 + NSData *data = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
  107 +
  108 + if (error == nil)
  109 + {
  110 + return [handler handleResponse:response.statusCode body:[[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]];
111 111 }
112 112 } while (delegate.failed && retries-- > 0);
113   -
  113 +
114 114 return [[[Response alloc] initWithCode:500 andMessage:delegate.responseBody] autorelease];
115 115 }
116 116
32 samples/Locations2/Classes/AmazonClientManager.h
... ... @@ -0,0 +1,32 @@
  1 +/*
  2 + * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License").
  5 + * You may not use this file except in compliance with the License.
  6 + * A copy of the License is located at
  7 + *
  8 + * http://aws.amazon.com/apache2.0
  9 + *
  10 + * or in the "license" file accompanying this file. This file is distributed
  11 + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12 + * express or implied. See the License for the specific language governing
  13 + * permissions and limitations under the License.
  14 + */
  15 +
  16 +#import <Foundation/Foundation.h>
  17 +#import <AWSiOSSDK/DynamoDB/AmazonDynamoDBClient.h>
  18 +#import "Constants.h"
  19 +#import "Response.h"
  20 +
  21 +@interface AmazonClientManager:NSObject
  22 +{
  23 +}
  24 +
  25 ++(AmazonDynamoDBClient *)ddb;
  26 ++(AmazonCredentials *)credentials;
  27 ++(bool)hasCredentials;
  28 ++(Response *)validateCredentials;
  29 ++(void)clearCredentials;
  30 ++(void)wipeAllCredentials;
  31 +
  32 +@end
117 samples/Locations2/Classes/AmazonClientManager.m
... ... @@ -0,0 +1,117 @@
  1 +/*
  2 + * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License").
  5 + * You may not use this file except in compliance with the License.
  6 + * A copy of the License is located at
  7 + *
  8 + * http://aws.amazon.com/apache2.0
  9 + *
  10 + * or in the "license" file accompanying this file. This file is distributed
  11 + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12 + * express or implied. See the License for the specific language governing
  13 + * permissions and limitations under the License.
  14 + */
  15 +
  16 +#import "AmazonClientManager.h"
  17 +#import <AWSiOSSDK/AmazonLogger.h>
  18 +#import "AmazonKeyChainWrapper.h"
  19 +#import "AmazonTVMClient.h"
  20 +#import <AWSiOSSDK/S3/AmazonS3Client.h>
  21 +#import <AWSiOSSDK/S3/S3GetObjectRequest.h>
  22 +#import <AWSiOSSDK/S3/S3GetObjectResponse.h>
  23 +
  24 +static AmazonCredentials *credentials = nil;
  25 +static AmazonDynamoDBClient *ddb = nil;
  26 +static AmazonTVMClient *tvm = nil;
  27 +
  28 +
  29 +@implementation AmazonClientManager
  30 +
  31 ++(AmazonDynamoDBClient *)ddb
  32 +{
  33 + @try
  34 + {
  35 + [AmazonClientManager validateCredentials];
  36 + return ddb;
  37 + }
  38 + @catch (NSException *exception)
  39 + {
  40 + NSLog(@"Exception: %@", exception);
  41 + }
  42 +}
  43 +
  44 ++(AmazonCredentials *)credentials;
  45 +{
  46 + @try
  47 + {
  48 + [AmazonClientManager validateCredentials];
  49 + return credentials;
  50 + }
  51 + @catch (NSException *exception)
  52 + {
  53 + NSLog(@"Exception: %@", exception);
  54 + }
  55 +}
  56 +
  57 ++(AmazonTVMClient *)tvm
  58 +{
  59 + if (tvm == nil) {
  60 + tvm = [[AmazonTVMClient alloc] initWithEndpoint:TOKEN_VENDING_MACHINE_URL useSSL:USE_SSL];
  61 + }
  62 +
  63 + return tvm;
  64 +}
  65 +
  66 ++(bool)hasCredentials
  67 +{
  68 + return ![TOKEN_VENDING_MACHINE_URL isEqualToString:@"CHANGE ME"];
  69 +}
  70 +
  71 ++(Response *)validateCredentials
  72 +{
  73 + Response *ableToGetToken = nil;
  74 +
  75 + if ([AmazonKeyChainWrapper areCredentialsExpired]) {
  76 + [AmazonClientManager clearCredentials];
  77 +
  78 + ableToGetToken = [[AmazonClientManager tvm] anonymousRegister];
  79 +
  80 + if ( [ableToGetToken wasSuccessful])
  81 + {
  82 + ableToGetToken = [[AmazonClientManager tvm] getToken];
  83 + }
  84 + }
  85 + else
  86 + {
  87 + ableToGetToken = [[[Response alloc] initWithCode:200 andMessage:@"OK"] autorelease];
  88 + }
  89 +
  90 + if ( [ableToGetToken wasSuccessful] && credentials == nil)
  91 + {
  92 + [AmazonClientManager clearCredentials];
  93 +
  94 + credentials = [AmazonKeyChainWrapper getCredentialsFromKeyChain];
  95 + [credentials retain];
  96 +
  97 + ddb = [[AmazonDynamoDBClient alloc] initWithCredentials:credentials];
  98 + }
  99 +
  100 + return ableToGetToken;
  101 +}
  102 +
  103 ++(void)clearCredentials
  104 +{
  105 + [ddb release];
  106 + ddb = nil;
  107 + [credentials release];
  108 + credentials = nil;
  109 +}
  110 +
  111 ++(void)wipeAllCredentials
  112 +{
  113 + [AmazonClientManager clearCredentials];
  114 + [AmazonKeyChainWrapper wipeCredentialsFromKeyChain];
  115 +}
  116 +
  117 +@end
41 samples/Locations2/Classes/AmazonKeyChainWrapper.h
... ... @@ -0,0 +1,41 @@
  1 +/*
  2 + * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License").
  5 + * You may not use this file except in compliance with the License.
  6 + * A copy of the License is located at
  7 + *
  8 + * http://aws.amazon.com/apache2.0
  9 + *
  10 + * or in the "license" file accompanying this file. This file is distributed
  11 + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12 + * express or implied. See the License for the specific language governing
  13 + * permissions and limitations under the License.
  14 + */
  15 +
  16 +#import <Foundation/Foundation.h>
  17 +#import <AWSiOSSDK/AmazonCredentials.h>
  18 +
  19 +
  20 +@interface AmazonKeyChainWrapper:NSObject {
  21 +}
  22 +
  23 ++(bool)areCredentialsExpired;
  24 ++(AmazonCredentials *)getCredentialsFromKeyChain;
  25 ++(void)storeCredentialsInKeyChain:(NSString *)theAccessKey secretKey:(NSString *)theSecretKey securityToken:(NSString *)theSecurityToken expiration:(NSString *)theExpirationDate;
  26 +
  27 ++(NSString *)getValueFromKeyChain:(NSString *)key;
  28 ++(void)storeValueInKeyChain:(NSString *)value forKey:(NSString *)key;
  29 +
  30 ++(void)registerDeviceId:(NSString *)uid andKey:(NSString *)key;
  31 ++(NSString *)getUidForDevice;
  32 ++(NSString *)getKeyForDevice;
  33 +
  34 ++(NSDate *)convertStringToDate:(NSString *)expiration;
  35 ++(bool)isExpired:(NSDate *)date;
  36 +
  37 ++(void)wipeKeyChain;
  38 ++(void)wipeCredentialsFromKeyChain;
  39 ++(NSMutableDictionary *)createKeychainDictionaryForKey:(NSString *)key;
  40 +
  41 +@end
221 samples/Locations2/Classes/AmazonKeyChainWrapper.m
... ... @@ -0,0 +1,221 @@
  1 +/*
  2 + * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License").
  5 + * You may not use this file except in compliance with the License.
  6 + * A copy of the License is located at
  7 + *
  8 + * http://aws.amazon.com/apache2.0
  9 + *
  10 + * or in the "license" file accompanying this file. This file is distributed
  11 + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12 + * express or implied. See the License for the specific language governing
  13 + * permissions and limitations under the License.
  14 + */
  15 +
  16 +#import "AmazonKeyChainWrapper.h"
  17 +#import <AWSiOSSDK/AmazonLogger.h>
  18 +
  19 +
  20 +
  21 +
  22 +NSString *kKeychainAccessKeyIdentifier;
  23 +NSString *kKeychainSecretKeyIdentifier;
  24 +NSString *kKeychainSecrutiyTokenIdentifier;
  25 +NSString *kKeychainExpirationDateIdentifier;
  26 +
  27 +NSString *kKeychainUidIdentifier;
  28 +NSString *kKeychainKeyIdentifier;
  29 +
  30 +
  31 +@implementation AmazonKeyChainWrapper
  32 +
  33 ++(void)initialize {
  34 + NSString *bundleID = [NSBundle mainBundle].bundleIdentifier;
  35 + kKeychainAccessKeyIdentifier = [[NSString stringWithFormat:@"%@.AWSAccessKey", bundleID] retain];
  36 + kKeychainSecretKeyIdentifier= [[NSString stringWithFormat:@"%@.AWSSecretKey", bundleID] retain];
  37 + kKeychainSecrutiyTokenIdentifier = [[NSString stringWithFormat:@"%@.AWSSecurityToken", bundleID] retain];
  38 + kKeychainExpirationDateIdentifier = [[NSString stringWithFormat:@"%@.AWSExpirationDate", bundleID] retain];
  39 +
  40 + kKeychainUidIdentifier = [[NSString stringWithFormat:@"%@.UID", bundleID] retain];
  41 + kKeychainKeyIdentifier = [[NSString stringWithFormat:@"%@.KEY", bundleID] retain];
  42 +}
  43 +
  44 ++(bool)areCredentialsExpired
  45 +{
  46 + AMZLogDebug(@"areCredentialsExpired");
  47 +
  48 + NSString *expiration = [AmazonKeyChainWrapper getValueFromKeyChain:kKeychainExpirationDateIdentifier];
  49 + if (expiration == nil) {
  50 + return YES;
  51 + }
  52 + else {
  53 + NSDate *expirationDate = [AmazonKeyChainWrapper convertStringToDate:expiration];
  54 +
  55 + AMZLog(@"expirationDate : %@, %@", expiration, expirationDate);
  56 +
  57 + return [AmazonKeyChainWrapper isExpired:expirationDate];
  58 + }
  59 +}
  60 +
  61 ++(void)registerDeviceId:(NSString *)uid andKey:(NSString *)key
  62 +{
  63 + [AmazonKeyChainWrapper storeValueInKeyChain:uid forKey:kKeychainUidIdentifier];
  64 + [AmazonKeyChainWrapper storeValueInKeyChain:key forKey:kKeychainKeyIdentifier];
  65 +}
  66 +
  67 ++(NSString *)getKeyForDevice
  68 +{
  69 + return [AmazonKeyChainWrapper getValueFromKeyChain:kKeychainKeyIdentifier];
  70 +}
  71 +
  72 ++(NSString *)getUidForDevice
  73 +{
  74 + return [AmazonKeyChainWrapper getValueFromKeyChain:kKeychainUidIdentifier];
  75 +}
  76 +
  77 ++(AmazonCredentials *)getCredentialsFromKeyChain
  78 +{
  79 + NSString *accessKey = [AmazonKeyChainWrapper getValueFromKeyChain:kKeychainAccessKeyIdentifier];
  80 + NSString *secretKey = [AmazonKeyChainWrapper getValueFromKeyChain:kKeychainSecretKeyIdentifier];
  81 + NSString *securityToken = [AmazonKeyChainWrapper getValueFromKeyChain:kKeychainSecrutiyTokenIdentifier];
  82 +
  83 + if ((accessKey != nil) && (secretKey != nil) && (securityToken != nil)) {
  84 + if (![AmazonKeyChainWrapper areCredentialsExpired]) {
  85 + AmazonCredentials *credentials = [[[AmazonCredentials alloc] initWithAccessKey:accessKey withSecretKey:secretKey] autorelease];
  86 + credentials.securityToken = securityToken;
  87 +
  88 + return credentials;
  89 + }
  90 + }
  91 +
  92 + return nil;
  93 +}
  94 +
  95 ++(void)storeCredentialsInKeyChain:(NSString *)theAccessKey secretKey:(NSString *)theSecretKey securityToken:(NSString *)theSecurityToken expiration:(NSString *)theExpirationDate
  96 +{
  97 + [AmazonKeyChainWrapper storeValueInKeyChain:theAccessKey forKey:kKeychainAccessKeyIdentifier];
  98 + [AmazonKeyChainWrapper storeValueInKeyChain:theSecretKey forKey:kKeychainSecretKeyIdentifier];
  99 + [AmazonKeyChainWrapper storeValueInKeyChain:theSecurityToken forKey:kKeychainSecrutiyTokenIdentifier];
  100 + [AmazonKeyChainWrapper storeValueInKeyChain:theExpirationDate forKey:kKeychainExpirationDateIdentifier];
  101 +}
  102 +
  103 ++(bool)isExpired:(NSDate *)date
  104 +{
  105 + NSDate *soon = [NSDate dateWithTimeIntervalSinceNow:(15 * 60)]; // Fifteen minutes from now.
  106 +
  107 + if ( [soon compare:date] == NSOrderedDescending) {
  108 + return YES;
  109 + }
  110 + else {
  111 + return NO;
  112 + }
  113 +}
  114 +
  115 ++(NSDate *)convertStringToDate:(NSString *)expiration
  116 +{
  117 + if (expiration != nil)
  118 + {
  119 + long long exactSecondOfExpiration = (long long)([expiration longLongValue] / 1000);
  120 + return [[[NSDate alloc] initWithTimeIntervalSince1970:exactSecondOfExpiration] autorelease];
  121 + }
  122 + else
  123 + {
  124 + return nil;
  125 + }
  126 +}
  127 +
  128 ++(NSString *)getValueFromKeyChain:(NSString *)key
  129 +{
  130 + AMZLogDebug(@"Get Value for KeyChain key:[%@]", key);
  131 +
  132 + NSMutableDictionary *queryDictionary = [[[NSMutableDictionary alloc] init] autorelease];
  133 +
  134 + [queryDictionary setObject:[key dataUsingEncoding:NSUTF8StringEncoding] forKey:(id)kSecAttrGeneric];
  135 + [queryDictionary setObject:(id) kCFBooleanTrue forKey:(id)kSecReturnAttributes];
  136 + [queryDictionary setObject:(id) kSecMatchLimitOne forKey:(id)kSecMatchLimit];
  137 + [queryDictionary setObject:(id) kCFBooleanTrue forKey:(id)kSecReturnData];
  138 + [queryDictionary setObject:(id) kSecClassGenericPassword forKey:(id)kSecClass];
  139 +
  140 + NSDictionary *returnedDictionary = [[[NSMutableDictionary alloc] init] autorelease];
  141 + OSStatus keychainError = SecItemCopyMatching((CFDictionaryRef)queryDictionary, (CFTypeRef *)&returnedDictionary);
  142 + if (keychainError == noErr)
  143 + {
  144 + NSData *rawData = [returnedDictionary objectForKey:(id)kSecValueData];
  145 + return [[[NSString alloc] initWithBytes:[rawData bytes] length:[rawData length] encoding:NSUTF8StringEncoding] autorelease];
  146 + }
  147 + else
  148 + {
  149 + return nil;
  150 + }
  151 +}
  152 +
  153 ++(void)storeValueInKeyChain:(NSString *)value forKey:(NSString *)key
  154 +{
  155 + AMZLogDebug(@"Storing value:[%@] in KeyChain as key:[%@]", value, key);
  156 +
  157 + NSMutableDictionary *keychainDictionary = [[[NSMutableDictionary alloc] init] autorelease];
  158 + [keychainDictionary setObject:[key dataUsingEncoding:NSUTF8StringEncoding] forKey:(id)kSecAttrGeneric];
  159 + [keychainDictionary setObject:(id) kSecClassGenericPassword forKey:(id)kSecClass];
  160 + [keychainDictionary setObject:[value dataUsingEncoding:NSUTF8StringEncoding] forKey:(id)kSecValueData];
  161 + [keychainDictionary setObject:[key dataUsingEncoding:NSUTF8StringEncoding] forKey:(id)kSecAttrAccount];
  162 + [keychainDictionary setObject:(id) kSecAttrAccessibleWhenUnlockedThisDeviceOnly forKey:(id)kSecAttrAccessible];
  163 +
  164 + OSStatus keychainError = SecItemAdd((CFDictionaryRef)keychainDictionary, NULL);
  165 + if (keychainError == errSecDuplicateItem) {
  166 + SecItemDelete((CFDictionaryRef)keychainDictionary);
  167 + SecItemAdd((CFDictionaryRef)keychainDictionary, NULL);
  168 + }
  169 +}
  170 +
  171 ++(void)wipeKeyChain
  172 +{
  173 + OSStatus keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainAccessKeyIdentifier]);
  174 +
  175 + AMZLogDebug(@"Keychain Key: kKeychainAccessKeyIdentifier, Error Code: %ld", keychainError);
  176 +
  177 + keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecretKeyIdentifier]);
  178 + AMZLogDebug(@"Keychain Key: kKeychainSecretKeyIdentifier, Error Code: %ld", keychainError);
  179 +
  180 + keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecrutiyTokenIdentifier]);
  181 + AMZLogDebug(@"Keychain Key: kKeychainSecrutiyTokenIdentifier, Error Code: %ld", keychainError);
  182 +
  183 + keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainExpirationDateIdentifier]);
  184 + AMZLogDebug(@"Keychain Key: kKeychainExpirationDateIdentifier, Error Code: %ld", keychainError);
  185 +
  186 + keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainUidIdentifier]);
  187 + AMZLogDebug(@"Keychain Key: kKeychainUidIdentifier, Error Code: %ld", keychainError);
  188 +
  189 + keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainKeyIdentifier]);
  190 + AMZLogDebug(@"Keychain Key: kKeychainKeyIdentifier, Error Code: %ld", keychainError);
  191 +}
  192 +
  193 ++(void)wipeCredentialsFromKeyChain
  194 +{
  195 + OSStatus keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainAccessKeyIdentifier]);
  196 +
  197 + AMZLogDebug(@"Keychain Key: kKeychainAccessKeyIdentifier, Error Code: %ld", keychainError);
  198 +
  199 + keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecretKeyIdentifier]);
  200 + AMZLogDebug(@"Keychain Key: kKeychainSecretKeyIdentifier, Error Code: %ld", keychainError);
  201 +
  202 + keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainSecrutiyTokenIdentifier]);
  203 + AMZLogDebug(@"Keychain Key: kKeychainSecrutiyTokenIdentifier, Error Code: %ld", keychainError);
  204 +
  205 + keychainError = SecItemDelete((CFDictionaryRef)[AmazonKeyChainWrapper createKeychainDictionaryForKey : kKeychainExpirationDateIdentifier]);
  206 + AMZLogDebug(@"Keychain Key: kKeychainExpirationDateIdentifier, Error Code: %ld", keychainError);
  207 +}
  208 +
  209 ++(NSMutableDictionary *)createKeychainDictionaryForKey:(NSString *)key
  210 +{
  211 + NSMutableDictionary *dictionary = [[[NSMutableDictionary alloc] init] autorelease];
  212 +
  213 + [dictionary setObject:[key dataUsingEncoding:NSUTF8StringEncoding] forKey:(id)kSecAttrGeneric];
  214 + [dictionary setObject:(id) kSecClassGenericPassword forKey:(id)kSecClass];
  215 + [dictionary setObject:[key dataUsingEncoding:NSUTF8StringEncoding] forKey:(id)kSecAttrAccount];
  216 + [dictionary setObject:(id) kSecAttrAccessibleWhenUnlockedThisDeviceOnly forKey:(id)kSecAttrAccessible];
  217 +
  218 + return dictionary;
  219 +}
  220 +
  221 +@end
37 samples/Locations2/Classes/AmazonTVMClient.h
... ... @@ -0,0 +1,37 @@
  1 +/*
  2 + * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License").
  5 + * You may not use this file except in compliance with the License.
  6 + * A copy of the License is located at
  7 + *
  8 + * http://aws.amazon.com/apache2.0
  9 + *
  10 + * or in the "license" file accompanying this file. This file is distributed
  11 + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12 + * express or implied. See the License for the specific language governing
  13 + * permissions and limitations under the License.
  14 + */
  15 +
  16 +#import <Foundation/Foundation.h>
  17 +#import "Request.h"
  18 +#import "Response.h"
  19 +#import "ResponseHandler.h"
  20 +
  21 +
  22 +@interface AmazonTVMClient:NSObject {
  23 + NSString *endpoint;
  24 + bool useSSL;
  25 +}
  26 +
  27 +@property (nonatomic, retain) NSString *endpoint;
  28 +@property (nonatomic) bool useSSL;
  29 +
  30 +-(id)initWithEndpoint:(NSString *)endpoint useSSL:(bool)useSSL;
  31 +-(Response *)anonymousRegister;
  32 +-(Response *)getToken;
  33 +-(Response *)processRequest:(Request *)request responseHandler:(ResponseHandler *)handler;
  34 +-(NSString *)getEndpointDomain:(NSString *)originalEndpoint;
  35 +
  36 +@end
  37 +
140 samples/Locations2/Classes/AmazonTVMClient.m
... ... @@ -0,0 +1,140 @@
  1 +/*
  2 + * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License").
  5 + * You may not use this file except in compliance with the License.
  6 + * A copy of the License is located at
  7 + *
  8 + * http://aws.amazon.com/apache2.0
  9 + *
  10 + * or in the "license" file accompanying this file. This file is distributed
  11 + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12 + * express or implied. See the License for the specific language governing
  13 + * permissions and limitations under the License.
  14 + */
  15 +