aws-sdk-cloudfront 1.27.1 → 1.81.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,280 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::CloudFront
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::CloudFront::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::CloudFront::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::CloudFront::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :associate_alias
60
+ Aws::CloudFront::Endpoints::AssociateAlias.build(context)
61
+ when :copy_distribution
62
+ Aws::CloudFront::Endpoints::CopyDistribution.build(context)
63
+ when :create_cache_policy
64
+ Aws::CloudFront::Endpoints::CreateCachePolicy.build(context)
65
+ when :create_cloud_front_origin_access_identity
66
+ Aws::CloudFront::Endpoints::CreateCloudFrontOriginAccessIdentity.build(context)
67
+ when :create_continuous_deployment_policy
68
+ Aws::CloudFront::Endpoints::CreateContinuousDeploymentPolicy.build(context)
69
+ when :create_distribution
70
+ Aws::CloudFront::Endpoints::CreateDistribution.build(context)
71
+ when :create_distribution_with_tags
72
+ Aws::CloudFront::Endpoints::CreateDistributionWithTags.build(context)
73
+ when :create_field_level_encryption_config
74
+ Aws::CloudFront::Endpoints::CreateFieldLevelEncryptionConfig.build(context)
75
+ when :create_field_level_encryption_profile
76
+ Aws::CloudFront::Endpoints::CreateFieldLevelEncryptionProfile.build(context)
77
+ when :create_function
78
+ Aws::CloudFront::Endpoints::CreateFunction.build(context)
79
+ when :create_invalidation
80
+ Aws::CloudFront::Endpoints::CreateInvalidation.build(context)
81
+ when :create_key_group
82
+ Aws::CloudFront::Endpoints::CreateKeyGroup.build(context)
83
+ when :create_monitoring_subscription
84
+ Aws::CloudFront::Endpoints::CreateMonitoringSubscription.build(context)
85
+ when :create_origin_access_control
86
+ Aws::CloudFront::Endpoints::CreateOriginAccessControl.build(context)
87
+ when :create_origin_request_policy
88
+ Aws::CloudFront::Endpoints::CreateOriginRequestPolicy.build(context)
89
+ when :create_public_key
90
+ Aws::CloudFront::Endpoints::CreatePublicKey.build(context)
91
+ when :create_realtime_log_config
92
+ Aws::CloudFront::Endpoints::CreateRealtimeLogConfig.build(context)
93
+ when :create_response_headers_policy
94
+ Aws::CloudFront::Endpoints::CreateResponseHeadersPolicy.build(context)
95
+ when :create_streaming_distribution
96
+ Aws::CloudFront::Endpoints::CreateStreamingDistribution.build(context)
97
+ when :create_streaming_distribution_with_tags
98
+ Aws::CloudFront::Endpoints::CreateStreamingDistributionWithTags.build(context)
99
+ when :delete_cache_policy
100
+ Aws::CloudFront::Endpoints::DeleteCachePolicy.build(context)
101
+ when :delete_cloud_front_origin_access_identity
102
+ Aws::CloudFront::Endpoints::DeleteCloudFrontOriginAccessIdentity.build(context)
103
+ when :delete_continuous_deployment_policy
104
+ Aws::CloudFront::Endpoints::DeleteContinuousDeploymentPolicy.build(context)
105
+ when :delete_distribution
106
+ Aws::CloudFront::Endpoints::DeleteDistribution.build(context)
107
+ when :delete_field_level_encryption_config
108
+ Aws::CloudFront::Endpoints::DeleteFieldLevelEncryptionConfig.build(context)
109
+ when :delete_field_level_encryption_profile
110
+ Aws::CloudFront::Endpoints::DeleteFieldLevelEncryptionProfile.build(context)
111
+ when :delete_function
112
+ Aws::CloudFront::Endpoints::DeleteFunction.build(context)
113
+ when :delete_key_group
114
+ Aws::CloudFront::Endpoints::DeleteKeyGroup.build(context)
115
+ when :delete_monitoring_subscription
116
+ Aws::CloudFront::Endpoints::DeleteMonitoringSubscription.build(context)
117
+ when :delete_origin_access_control
118
+ Aws::CloudFront::Endpoints::DeleteOriginAccessControl.build(context)
119
+ when :delete_origin_request_policy
120
+ Aws::CloudFront::Endpoints::DeleteOriginRequestPolicy.build(context)
121
+ when :delete_public_key
122
+ Aws::CloudFront::Endpoints::DeletePublicKey.build(context)
123
+ when :delete_realtime_log_config
124
+ Aws::CloudFront::Endpoints::DeleteRealtimeLogConfig.build(context)
125
+ when :delete_response_headers_policy
126
+ Aws::CloudFront::Endpoints::DeleteResponseHeadersPolicy.build(context)
127
+ when :delete_streaming_distribution
128
+ Aws::CloudFront::Endpoints::DeleteStreamingDistribution.build(context)
129
+ when :describe_function
130
+ Aws::CloudFront::Endpoints::DescribeFunction.build(context)
131
+ when :get_cache_policy
132
+ Aws::CloudFront::Endpoints::GetCachePolicy.build(context)
133
+ when :get_cache_policy_config
134
+ Aws::CloudFront::Endpoints::GetCachePolicyConfig.build(context)
135
+ when :get_cloud_front_origin_access_identity
136
+ Aws::CloudFront::Endpoints::GetCloudFrontOriginAccessIdentity.build(context)
137
+ when :get_cloud_front_origin_access_identity_config
138
+ Aws::CloudFront::Endpoints::GetCloudFrontOriginAccessIdentityConfig.build(context)
139
+ when :get_continuous_deployment_policy
140
+ Aws::CloudFront::Endpoints::GetContinuousDeploymentPolicy.build(context)
141
+ when :get_continuous_deployment_policy_config
142
+ Aws::CloudFront::Endpoints::GetContinuousDeploymentPolicyConfig.build(context)
143
+ when :get_distribution
144
+ Aws::CloudFront::Endpoints::GetDistribution.build(context)
145
+ when :get_distribution_config
146
+ Aws::CloudFront::Endpoints::GetDistributionConfig.build(context)
147
+ when :get_field_level_encryption
148
+ Aws::CloudFront::Endpoints::GetFieldLevelEncryption.build(context)
149
+ when :get_field_level_encryption_config
150
+ Aws::CloudFront::Endpoints::GetFieldLevelEncryptionConfig.build(context)
151
+ when :get_field_level_encryption_profile
152
+ Aws::CloudFront::Endpoints::GetFieldLevelEncryptionProfile.build(context)
153
+ when :get_field_level_encryption_profile_config
154
+ Aws::CloudFront::Endpoints::GetFieldLevelEncryptionProfileConfig.build(context)
155
+ when :get_function
156
+ Aws::CloudFront::Endpoints::GetFunction.build(context)
157
+ when :get_invalidation
158
+ Aws::CloudFront::Endpoints::GetInvalidation.build(context)
159
+ when :get_key_group
160
+ Aws::CloudFront::Endpoints::GetKeyGroup.build(context)
161
+ when :get_key_group_config
162
+ Aws::CloudFront::Endpoints::GetKeyGroupConfig.build(context)
163
+ when :get_monitoring_subscription
164
+ Aws::CloudFront::Endpoints::GetMonitoringSubscription.build(context)
165
+ when :get_origin_access_control
166
+ Aws::CloudFront::Endpoints::GetOriginAccessControl.build(context)
167
+ when :get_origin_access_control_config
168
+ Aws::CloudFront::Endpoints::GetOriginAccessControlConfig.build(context)
169
+ when :get_origin_request_policy
170
+ Aws::CloudFront::Endpoints::GetOriginRequestPolicy.build(context)
171
+ when :get_origin_request_policy_config
172
+ Aws::CloudFront::Endpoints::GetOriginRequestPolicyConfig.build(context)
173
+ when :get_public_key
174
+ Aws::CloudFront::Endpoints::GetPublicKey.build(context)
175
+ when :get_public_key_config
176
+ Aws::CloudFront::Endpoints::GetPublicKeyConfig.build(context)
177
+ when :get_realtime_log_config
178
+ Aws::CloudFront::Endpoints::GetRealtimeLogConfig.build(context)
179
+ when :get_response_headers_policy
180
+ Aws::CloudFront::Endpoints::GetResponseHeadersPolicy.build(context)
181
+ when :get_response_headers_policy_config
182
+ Aws::CloudFront::Endpoints::GetResponseHeadersPolicyConfig.build(context)
183
+ when :get_streaming_distribution
184
+ Aws::CloudFront::Endpoints::GetStreamingDistribution.build(context)
185
+ when :get_streaming_distribution_config
186
+ Aws::CloudFront::Endpoints::GetStreamingDistributionConfig.build(context)
187
+ when :list_cache_policies
188
+ Aws::CloudFront::Endpoints::ListCachePolicies.build(context)
189
+ when :list_cloud_front_origin_access_identities
190
+ Aws::CloudFront::Endpoints::ListCloudFrontOriginAccessIdentities.build(context)
191
+ when :list_conflicting_aliases
192
+ Aws::CloudFront::Endpoints::ListConflictingAliases.build(context)
193
+ when :list_continuous_deployment_policies
194
+ Aws::CloudFront::Endpoints::ListContinuousDeploymentPolicies.build(context)
195
+ when :list_distributions
196
+ Aws::CloudFront::Endpoints::ListDistributions.build(context)
197
+ when :list_distributions_by_cache_policy_id
198
+ Aws::CloudFront::Endpoints::ListDistributionsByCachePolicyId.build(context)
199
+ when :list_distributions_by_key_group
200
+ Aws::CloudFront::Endpoints::ListDistributionsByKeyGroup.build(context)
201
+ when :list_distributions_by_origin_request_policy_id
202
+ Aws::CloudFront::Endpoints::ListDistributionsByOriginRequestPolicyId.build(context)
203
+ when :list_distributions_by_realtime_log_config
204
+ Aws::CloudFront::Endpoints::ListDistributionsByRealtimeLogConfig.build(context)
205
+ when :list_distributions_by_response_headers_policy_id
206
+ Aws::CloudFront::Endpoints::ListDistributionsByResponseHeadersPolicyId.build(context)
207
+ when :list_distributions_by_web_acl_id
208
+ Aws::CloudFront::Endpoints::ListDistributionsByWebACLId.build(context)
209
+ when :list_field_level_encryption_configs
210
+ Aws::CloudFront::Endpoints::ListFieldLevelEncryptionConfigs.build(context)
211
+ when :list_field_level_encryption_profiles
212
+ Aws::CloudFront::Endpoints::ListFieldLevelEncryptionProfiles.build(context)
213
+ when :list_functions
214
+ Aws::CloudFront::Endpoints::ListFunctions.build(context)
215
+ when :list_invalidations
216
+ Aws::CloudFront::Endpoints::ListInvalidations.build(context)
217
+ when :list_key_groups
218
+ Aws::CloudFront::Endpoints::ListKeyGroups.build(context)
219
+ when :list_origin_access_controls
220
+ Aws::CloudFront::Endpoints::ListOriginAccessControls.build(context)
221
+ when :list_origin_request_policies
222
+ Aws::CloudFront::Endpoints::ListOriginRequestPolicies.build(context)
223
+ when :list_public_keys
224
+ Aws::CloudFront::Endpoints::ListPublicKeys.build(context)
225
+ when :list_realtime_log_configs
226
+ Aws::CloudFront::Endpoints::ListRealtimeLogConfigs.build(context)
227
+ when :list_response_headers_policies
228
+ Aws::CloudFront::Endpoints::ListResponseHeadersPolicies.build(context)
229
+ when :list_streaming_distributions
230
+ Aws::CloudFront::Endpoints::ListStreamingDistributions.build(context)
231
+ when :list_tags_for_resource
232
+ Aws::CloudFront::Endpoints::ListTagsForResource.build(context)
233
+ when :publish_function
234
+ Aws::CloudFront::Endpoints::PublishFunction.build(context)
235
+ when :tag_resource
236
+ Aws::CloudFront::Endpoints::TagResource.build(context)
237
+ when :test_function
238
+ Aws::CloudFront::Endpoints::TestFunction.build(context)
239
+ when :untag_resource
240
+ Aws::CloudFront::Endpoints::UntagResource.build(context)
241
+ when :update_cache_policy
242
+ Aws::CloudFront::Endpoints::UpdateCachePolicy.build(context)
243
+ when :update_cloud_front_origin_access_identity
244
+ Aws::CloudFront::Endpoints::UpdateCloudFrontOriginAccessIdentity.build(context)
245
+ when :update_continuous_deployment_policy
246
+ Aws::CloudFront::Endpoints::UpdateContinuousDeploymentPolicy.build(context)
247
+ when :update_distribution
248
+ Aws::CloudFront::Endpoints::UpdateDistribution.build(context)
249
+ when :update_distribution_with_staging_config
250
+ Aws::CloudFront::Endpoints::UpdateDistributionWithStagingConfig.build(context)
251
+ when :update_field_level_encryption_config
252
+ Aws::CloudFront::Endpoints::UpdateFieldLevelEncryptionConfig.build(context)
253
+ when :update_field_level_encryption_profile
254
+ Aws::CloudFront::Endpoints::UpdateFieldLevelEncryptionProfile.build(context)
255
+ when :update_function
256
+ Aws::CloudFront::Endpoints::UpdateFunction.build(context)
257
+ when :update_key_group
258
+ Aws::CloudFront::Endpoints::UpdateKeyGroup.build(context)
259
+ when :update_origin_access_control
260
+ Aws::CloudFront::Endpoints::UpdateOriginAccessControl.build(context)
261
+ when :update_origin_request_policy
262
+ Aws::CloudFront::Endpoints::UpdateOriginRequestPolicy.build(context)
263
+ when :update_public_key
264
+ Aws::CloudFront::Endpoints::UpdatePublicKey.build(context)
265
+ when :update_realtime_log_config
266
+ Aws::CloudFront::Endpoints::UpdateRealtimeLogConfig.build(context)
267
+ when :update_response_headers_policy
268
+ Aws::CloudFront::Endpoints::UpdateResponseHeadersPolicy.build(context)
269
+ when :update_streaming_distribution
270
+ Aws::CloudFront::Endpoints::UpdateStreamingDistribution.build(context)
271
+ end
272
+ end
273
+ end
274
+
275
+ def add_handlers(handlers, _config)
276
+ handlers.add(Handler, step: :build, priority: 75)
277
+ end
278
+ end
279
+ end
280
+ end
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'base64'
2
4
  require 'uri'
3
5
  require 'time'
4
- require 'json'
5
6
  require 'openssl'
6
7
 
7
8
  module Aws
@@ -14,7 +15,8 @@ module Aws
14
15
  # @option options [String] :private_key_path
15
16
  def initialize(options = {})
16
17
  @key_pair_id = key_pair_id(options)
17
- @private_key = private_key(options)
18
+ @cipher = OpenSSL::Digest::SHA1.new
19
+ @private_key = OpenSSL::PKey::RSA.new(private_key(options))
18
20
  end
19
21
 
20
22
  private
@@ -67,7 +69,7 @@ module Aws
67
69
  resource_content
68
70
  end
69
71
  else
70
- msg = "Invaild URI scheme:#{scheme}.Scheme must be one of: http, https or rtmp."
72
+ msg = "Invalid URI scheme:#{scheme}.Scheme must be one of: http, https or rtmp."
71
73
  raise ArgumentError, msg
72
74
  end
73
75
  end
@@ -96,8 +98,7 @@ module Aws
96
98
 
97
99
  # create the signature string with policy signed
98
100
  def sign_policy(policy)
99
- key = OpenSSL::PKey::RSA.new(@private_key)
100
- key.sign(OpenSSL::Digest::SHA1.new, policy)
101
+ @private_key.sign(@cipher, policy)
101
102
  end
102
103
 
103
104
  # create canned policy that used for signing
@@ -110,7 +111,7 @@ module Aws
110
111
  }
111
112
  ]
112
113
  }
113
- JSON.dump(json_hash)
114
+ Aws::Json.dump(json_hash)
114
115
  end
115
116
 
116
117
  def encode(policy)