aws-sdk-cloudfront 1.118.0 → 1.132.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +70 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-cloudfront/client.rb +254 -103
- data/lib/aws-sdk-cloudfront/client_api.rb +20 -9
- data/lib/aws-sdk-cloudfront/customizations.rb +0 -1
- data/lib/aws-sdk-cloudfront/endpoint_parameters.rb +12 -12
- data/lib/aws-sdk-cloudfront/endpoint_provider.rb +14 -11
- data/lib/aws-sdk-cloudfront/signer.rb +14 -20
- data/lib/aws-sdk-cloudfront/types.rb +435 -139
- data/lib/aws-sdk-cloudfront.rb +1 -1
- data/sig/client.rbs +19 -9
- data/sig/resource.rbs +1 -0
- data/sig/types.rbs +6 -3
- metadata +4 -4
|
@@ -380,6 +380,7 @@ module Aws::CloudFront
|
|
|
380
380
|
InvalidationList = Shapes::StructureShape.new(name: 'InvalidationList')
|
|
381
381
|
InvalidationSummary = Shapes::StructureShape.new(name: 'InvalidationSummary')
|
|
382
382
|
InvalidationSummaryList = Shapes::ListShape.new(name: 'InvalidationSummaryList')
|
|
383
|
+
IpAddressType = Shapes::StringShape.new(name: 'IpAddressType')
|
|
383
384
|
ItemSelection = Shapes::StringShape.new(name: 'ItemSelection')
|
|
384
385
|
KGKeyPairIds = Shapes::StructureShape.new(name: 'KGKeyPairIds')
|
|
385
386
|
KGKeyPairIdsList = Shapes::ListShape.new(name: 'KGKeyPairIdsList')
|
|
@@ -618,6 +619,7 @@ module Aws::CloudFront
|
|
|
618
619
|
S3OriginConfig = Shapes::StructureShape.new(name: 'S3OriginConfig')
|
|
619
620
|
SSLSupportMethod = Shapes::StringShape.new(name: 'SSLSupportMethod')
|
|
620
621
|
SamplingRate = Shapes::FloatShape.new(name: 'SamplingRate')
|
|
622
|
+
ServerCertificateId = Shapes::StringShape.new(name: 'ServerCertificateId')
|
|
621
623
|
SessionStickinessConfig = Shapes::StructureShape.new(name: 'SessionStickinessConfig')
|
|
622
624
|
Signer = Shapes::StructureShape.new(name: 'Signer')
|
|
623
625
|
SignerList = Shapes::ListShape.new(name: 'SignerList')
|
|
@@ -1421,6 +1423,7 @@ module Aws::CloudFront
|
|
|
1421
1423
|
CustomOriginConfig.add_member(:origin_ssl_protocols, Shapes::ShapeRef.new(shape: OriginSslProtocols, location_name: "OriginSslProtocols"))
|
|
1422
1424
|
CustomOriginConfig.add_member(:origin_read_timeout, Shapes::ShapeRef.new(shape: integer, location_name: "OriginReadTimeout"))
|
|
1423
1425
|
CustomOriginConfig.add_member(:origin_keepalive_timeout, Shapes::ShapeRef.new(shape: integer, location_name: "OriginKeepaliveTimeout"))
|
|
1426
|
+
CustomOriginConfig.add_member(:ip_address_type, Shapes::ShapeRef.new(shape: IpAddressType, location_name: "IpAddressType"))
|
|
1424
1427
|
CustomOriginConfig.struct_class = Types::CustomOriginConfig
|
|
1425
1428
|
|
|
1426
1429
|
Customizations.add_member(:web_acl, Shapes::ShapeRef.new(shape: WebAclCustomization, location_name: "WebAcl"))
|
|
@@ -1485,7 +1488,7 @@ module Aws::CloudFront
|
|
|
1485
1488
|
DeleteFieldLevelEncryptionProfileRequest.add_member(:if_match, Shapes::ShapeRef.new(shape: string, location: "header", location_name: "If-Match"))
|
|
1486
1489
|
DeleteFieldLevelEncryptionProfileRequest.struct_class = Types::DeleteFieldLevelEncryptionProfileRequest
|
|
1487
1490
|
|
|
1488
|
-
DeleteFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape:
|
|
1491
|
+
DeleteFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape: FunctionName, required: true, location: "uri", location_name: "Name"))
|
|
1489
1492
|
DeleteFunctionRequest.add_member(:if_match, Shapes::ShapeRef.new(shape: string, required: true, location: "header", location_name: "If-Match"))
|
|
1490
1493
|
DeleteFunctionRequest.struct_class = Types::DeleteFunctionRequest
|
|
1491
1494
|
|
|
@@ -1536,7 +1539,7 @@ module Aws::CloudFront
|
|
|
1536
1539
|
DeleteVpcOriginResult[:payload] = :vpc_origin
|
|
1537
1540
|
DeleteVpcOriginResult[:payload_member] = DeleteVpcOriginResult.member(:vpc_origin)
|
|
1538
1541
|
|
|
1539
|
-
DescribeFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape:
|
|
1542
|
+
DescribeFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape: FunctionName, required: true, location: "uri", location_name: "Name"))
|
|
1540
1543
|
DescribeFunctionRequest.add_member(:stage, Shapes::ShapeRef.new(shape: FunctionStage, location: "querystring", location_name: "Stage"))
|
|
1541
1544
|
DescribeFunctionRequest.struct_class = Types::DescribeFunctionRequest
|
|
1542
1545
|
|
|
@@ -1651,7 +1654,7 @@ module Aws::CloudFront
|
|
|
1651
1654
|
DistributionSummary.add_member(:default_cache_behavior, Shapes::ShapeRef.new(shape: DefaultCacheBehavior, required: true, location_name: "DefaultCacheBehavior"))
|
|
1652
1655
|
DistributionSummary.add_member(:cache_behaviors, Shapes::ShapeRef.new(shape: CacheBehaviors, required: true, location_name: "CacheBehaviors"))
|
|
1653
1656
|
DistributionSummary.add_member(:custom_error_responses, Shapes::ShapeRef.new(shape: CustomErrorResponses, required: true, location_name: "CustomErrorResponses"))
|
|
1654
|
-
DistributionSummary.add_member(:comment, Shapes::ShapeRef.new(shape:
|
|
1657
|
+
DistributionSummary.add_member(:comment, Shapes::ShapeRef.new(shape: sensitiveStringType, required: true, location_name: "Comment"))
|
|
1655
1658
|
DistributionSummary.add_member(:price_class, Shapes::ShapeRef.new(shape: PriceClass, required: true, location_name: "PriceClass"))
|
|
1656
1659
|
DistributionSummary.add_member(:enabled, Shapes::ShapeRef.new(shape: boolean, required: true, location_name: "Enabled"))
|
|
1657
1660
|
DistributionSummary.add_member(:viewer_certificate, Shapes::ShapeRef.new(shape: ViewerCertificate, required: true, location_name: "ViewerCertificate"))
|
|
@@ -2046,7 +2049,7 @@ module Aws::CloudFront
|
|
|
2046
2049
|
GetFieldLevelEncryptionResult[:payload] = :field_level_encryption
|
|
2047
2050
|
GetFieldLevelEncryptionResult[:payload_member] = GetFieldLevelEncryptionResult.member(:field_level_encryption)
|
|
2048
2051
|
|
|
2049
|
-
GetFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape:
|
|
2052
|
+
GetFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape: FunctionName, required: true, location: "uri", location_name: "Name"))
|
|
2050
2053
|
GetFunctionRequest.add_member(:stage, Shapes::ShapeRef.new(shape: FunctionStage, location: "querystring", location_name: "Stage"))
|
|
2051
2054
|
GetFunctionRequest.struct_class = Types::GetFunctionRequest
|
|
2052
2055
|
|
|
@@ -2841,6 +2844,7 @@ module Aws::CloudFront
|
|
|
2841
2844
|
Origin.add_member(:vpc_origin_config, Shapes::ShapeRef.new(shape: VpcOriginConfig, location_name: "VpcOriginConfig"))
|
|
2842
2845
|
Origin.add_member(:connection_attempts, Shapes::ShapeRef.new(shape: integer, location_name: "ConnectionAttempts"))
|
|
2843
2846
|
Origin.add_member(:connection_timeout, Shapes::ShapeRef.new(shape: integer, location_name: "ConnectionTimeout"))
|
|
2847
|
+
Origin.add_member(:response_completion_timeout, Shapes::ShapeRef.new(shape: integer, location_name: "ResponseCompletionTimeout"))
|
|
2844
2848
|
Origin.add_member(:origin_shield, Shapes::ShapeRef.new(shape: OriginShield, location_name: "OriginShield"))
|
|
2845
2849
|
Origin.add_member(:origin_access_control_id, Shapes::ShapeRef.new(shape: string, location_name: "OriginAccessControlId"))
|
|
2846
2850
|
Origin.struct_class = Types::Origin
|
|
@@ -3031,7 +3035,7 @@ module Aws::CloudFront
|
|
|
3031
3035
|
|
|
3032
3036
|
PublicKeySummaryList.member = Shapes::ShapeRef.new(shape: PublicKeySummary, location_name: "PublicKeySummary")
|
|
3033
3037
|
|
|
3034
|
-
PublishFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape:
|
|
3038
|
+
PublishFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape: FunctionName, required: true, location: "uri", location_name: "Name"))
|
|
3035
3039
|
PublishFunctionRequest.add_member(:if_match, Shapes::ShapeRef.new(shape: string, required: true, location: "header", location_name: "If-Match"))
|
|
3036
3040
|
PublishFunctionRequest.struct_class = Types::PublishFunctionRequest
|
|
3037
3041
|
|
|
@@ -3227,6 +3231,7 @@ module Aws::CloudFront
|
|
|
3227
3231
|
S3Origin.struct_class = Types::S3Origin
|
|
3228
3232
|
|
|
3229
3233
|
S3OriginConfig.add_member(:origin_access_identity, Shapes::ShapeRef.new(shape: string, required: true, location_name: "OriginAccessIdentity"))
|
|
3234
|
+
S3OriginConfig.add_member(:origin_read_timeout, Shapes::ShapeRef.new(shape: integer, location_name: "OriginReadTimeout"))
|
|
3230
3235
|
S3OriginConfig.struct_class = Types::S3OriginConfig
|
|
3231
3236
|
|
|
3232
3237
|
SessionStickinessConfig.add_member(:idle_ttl, Shapes::ShapeRef.new(shape: integer, required: true, location_name: "IdleTTL"))
|
|
@@ -3313,7 +3318,7 @@ module Aws::CloudFront
|
|
|
3313
3318
|
StreamingLoggingConfig.add_member(:prefix, Shapes::ShapeRef.new(shape: string, required: true, location_name: "Prefix"))
|
|
3314
3319
|
StreamingLoggingConfig.struct_class = Types::StreamingLoggingConfig
|
|
3315
3320
|
|
|
3316
|
-
StringSchemaConfig.add_member(:comment, Shapes::ShapeRef.new(shape:
|
|
3321
|
+
StringSchemaConfig.add_member(:comment, Shapes::ShapeRef.new(shape: sensitiveStringType, location_name: "Comment"))
|
|
3317
3322
|
StringSchemaConfig.add_member(:default_value, Shapes::ShapeRef.new(shape: ParameterValue, location_name: "DefaultValue"))
|
|
3318
3323
|
StringSchemaConfig.add_member(:required, Shapes::ShapeRef.new(shape: boolean, required: true, location_name: "Required"))
|
|
3319
3324
|
StringSchemaConfig.struct_class = Types::StringSchemaConfig
|
|
@@ -3344,7 +3349,7 @@ module Aws::CloudFront
|
|
|
3344
3349
|
TestFunctionFailed.add_member(:message, Shapes::ShapeRef.new(shape: string, location_name: "Message"))
|
|
3345
3350
|
TestFunctionFailed.struct_class = Types::TestFunctionFailed
|
|
3346
3351
|
|
|
3347
|
-
TestFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape:
|
|
3352
|
+
TestFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape: FunctionName, required: true, location: "uri", location_name: "Name"))
|
|
3348
3353
|
TestFunctionRequest.add_member(:if_match, Shapes::ShapeRef.new(shape: string, required: true, location: "header", location_name: "If-Match"))
|
|
3349
3354
|
TestFunctionRequest.add_member(:stage, Shapes::ShapeRef.new(shape: FunctionStage, location_name: "Stage"))
|
|
3350
3355
|
TestFunctionRequest.add_member(:event_object, Shapes::ShapeRef.new(shape: FunctionEventObject, required: true, location_name: "EventObject"))
|
|
@@ -3679,7 +3684,7 @@ module Aws::CloudFront
|
|
|
3679
3684
|
UpdateFieldLevelEncryptionProfileResult[:payload] = :field_level_encryption_profile
|
|
3680
3685
|
UpdateFieldLevelEncryptionProfileResult[:payload_member] = UpdateFieldLevelEncryptionProfileResult.member(:field_level_encryption_profile)
|
|
3681
3686
|
|
|
3682
|
-
UpdateFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape:
|
|
3687
|
+
UpdateFunctionRequest.add_member(:name, Shapes::ShapeRef.new(shape: FunctionName, required: true, location: "uri", location_name: "Name"))
|
|
3683
3688
|
UpdateFunctionRequest.add_member(:if_match, Shapes::ShapeRef.new(shape: string, required: true, location: "header", location_name: "If-Match"))
|
|
3684
3689
|
UpdateFunctionRequest.add_member(:function_config, Shapes::ShapeRef.new(shape: FunctionConfig, required: true, location_name: "FunctionConfig"))
|
|
3685
3690
|
UpdateFunctionRequest.add_member(:function_code, Shapes::ShapeRef.new(shape: FunctionBlob, required: true, location_name: "FunctionCode"))
|
|
@@ -3818,7 +3823,7 @@ module Aws::CloudFront
|
|
|
3818
3823
|
VerifyDnsConfigurationResult.struct_class = Types::VerifyDnsConfigurationResult
|
|
3819
3824
|
|
|
3820
3825
|
ViewerCertificate.add_member(:cloud_front_default_certificate, Shapes::ShapeRef.new(shape: boolean, location_name: "CloudFrontDefaultCertificate"))
|
|
3821
|
-
ViewerCertificate.add_member(:iam_certificate_id, Shapes::ShapeRef.new(shape:
|
|
3826
|
+
ViewerCertificate.add_member(:iam_certificate_id, Shapes::ShapeRef.new(shape: ServerCertificateId, location_name: "IAMCertificateId"))
|
|
3822
3827
|
ViewerCertificate.add_member(:acm_certificate_arn, Shapes::ShapeRef.new(shape: string, location_name: "ACMCertificateArn"))
|
|
3823
3828
|
ViewerCertificate.add_member(:ssl_support_method, Shapes::ShapeRef.new(shape: SSLSupportMethod, location_name: "SSLSupportMethod"))
|
|
3824
3829
|
ViewerCertificate.add_member(:minimum_protocol_version, Shapes::ShapeRef.new(shape: MinimumProtocolVersion, location_name: "MinimumProtocolVersion"))
|
|
@@ -5585,6 +5590,12 @@ module Aws::CloudFront
|
|
|
5585
5590
|
o.input = Shapes::ShapeRef.new(shape: ListOriginAccessControlsRequest)
|
|
5586
5591
|
o.output = Shapes::ShapeRef.new(shape: ListOriginAccessControlsResult)
|
|
5587
5592
|
o.errors << Shapes::ShapeRef.new(shape: InvalidArgument)
|
|
5593
|
+
o[:pager] = Aws::Pager.new(
|
|
5594
|
+
limit_key: "max_items",
|
|
5595
|
+
tokens: {
|
|
5596
|
+
"origin_access_control_list.next_marker" => "marker"
|
|
5597
|
+
}
|
|
5598
|
+
)
|
|
5588
5599
|
end)
|
|
5589
5600
|
|
|
5590
5601
|
api.add_operation(:list_origin_request_policies, Seahorse::Model::Operation.new.tap do |o|
|
|
@@ -10,59 +10,59 @@
|
|
|
10
10
|
module Aws::CloudFront
|
|
11
11
|
# Endpoint parameters used to influence endpoints per request.
|
|
12
12
|
#
|
|
13
|
-
# @!attribute region
|
|
14
|
-
# The AWS region used to dispatch the request.
|
|
15
|
-
#
|
|
16
|
-
# @return [String]
|
|
17
|
-
#
|
|
18
13
|
# @!attribute use_dual_stack
|
|
19
14
|
# When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
|
|
20
15
|
#
|
|
21
|
-
# @return [
|
|
16
|
+
# @return [boolean]
|
|
22
17
|
#
|
|
23
18
|
# @!attribute use_fips
|
|
24
19
|
# When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
|
|
25
20
|
#
|
|
26
|
-
# @return [
|
|
21
|
+
# @return [boolean]
|
|
27
22
|
#
|
|
28
23
|
# @!attribute endpoint
|
|
29
24
|
# Override the endpoint used to send this request
|
|
30
25
|
#
|
|
31
|
-
# @return [
|
|
26
|
+
# @return [string]
|
|
27
|
+
#
|
|
28
|
+
# @!attribute region
|
|
29
|
+
# The AWS region used to dispatch the request.
|
|
30
|
+
#
|
|
31
|
+
# @return [string]
|
|
32
32
|
#
|
|
33
33
|
EndpointParameters = Struct.new(
|
|
34
|
-
:region,
|
|
35
34
|
:use_dual_stack,
|
|
36
35
|
:use_fips,
|
|
37
36
|
:endpoint,
|
|
37
|
+
:region,
|
|
38
38
|
) do
|
|
39
39
|
include Aws::Structure
|
|
40
40
|
|
|
41
41
|
# @api private
|
|
42
42
|
class << self
|
|
43
43
|
PARAM_MAP = {
|
|
44
|
-
'Region' => :region,
|
|
45
44
|
'UseDualStack' => :use_dual_stack,
|
|
46
45
|
'UseFIPS' => :use_fips,
|
|
47
46
|
'Endpoint' => :endpoint,
|
|
47
|
+
'Region' => :region,
|
|
48
48
|
}.freeze
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def initialize(options = {})
|
|
52
|
-
self[:region] = options[:region]
|
|
53
52
|
self[:use_dual_stack] = options[:use_dual_stack]
|
|
54
53
|
self[:use_dual_stack] = false if self[:use_dual_stack].nil?
|
|
55
54
|
self[:use_fips] = options[:use_fips]
|
|
56
55
|
self[:use_fips] = false if self[:use_fips].nil?
|
|
57
56
|
self[:endpoint] = options[:endpoint]
|
|
57
|
+
self[:region] = options[:region]
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def self.create(config, options={})
|
|
61
61
|
new({
|
|
62
|
-
region: config.region,
|
|
63
62
|
use_dual_stack: config.use_dualstack_endpoint,
|
|
64
63
|
use_fips: config.use_fips_endpoint,
|
|
65
64
|
endpoint: (config.endpoint.to_s unless config.regional_endpoint),
|
|
65
|
+
region: config.region,
|
|
66
66
|
}.merge(options))
|
|
67
67
|
end
|
|
68
68
|
end
|
|
@@ -21,34 +21,37 @@ module Aws::CloudFront
|
|
|
21
21
|
end
|
|
22
22
|
if Aws::Endpoints::Matchers.set?(parameters.region)
|
|
23
23
|
if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
|
|
24
|
-
if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack,
|
|
25
|
-
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront.
|
|
24
|
+
if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
|
25
|
+
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront.global.api.aws", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingRegion" => "us-east-1"}]})
|
|
26
26
|
end
|
|
27
|
-
if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack,
|
|
28
|
-
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront-fips.
|
|
27
|
+
if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
|
28
|
+
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront-fips.global.api.aws", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingRegion" => "us-east-1"}]})
|
|
29
29
|
end
|
|
30
30
|
if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-cn") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
|
|
31
|
-
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront.cn-northwest-1.amazonaws.com.cn", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "
|
|
31
|
+
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront.cn-northwest-1.amazonaws.com.cn", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingRegion" => "cn-northwest-1"}]})
|
|
32
|
+
end
|
|
33
|
+
if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-cn") && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
|
|
34
|
+
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront-fips.cn-northwest-1.amazonaws.com.cn", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingRegion" => "cn-northwest-1"}]})
|
|
32
35
|
end
|
|
33
36
|
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
|
34
37
|
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
|
35
|
-
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront-fips.#{
|
|
38
|
+
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront-fips.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingRegion" => "#{partition_result['implicitGlobalRegion']}"}]})
|
|
36
39
|
end
|
|
37
40
|
raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
|
|
38
41
|
end
|
|
39
|
-
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
|
|
42
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, false)
|
|
40
43
|
if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
|
|
41
|
-
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront-fips.#{
|
|
44
|
+
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront-fips.#{partition_result['dnsSuffix']}", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingRegion" => "#{partition_result['implicitGlobalRegion']}"}]})
|
|
42
45
|
end
|
|
43
46
|
raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
|
|
44
47
|
end
|
|
45
|
-
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
|
48
|
+
if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(parameters.use_dual_stack, true)
|
|
46
49
|
if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
|
|
47
|
-
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront.#{
|
|
50
|
+
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingRegion" => "#{partition_result['implicitGlobalRegion']}"}]})
|
|
48
51
|
end
|
|
49
52
|
raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
|
|
50
53
|
end
|
|
51
|
-
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront.#{
|
|
54
|
+
return Aws::Endpoints::Endpoint.new(url: "https://cloudfront.#{partition_result['dnsSuffix']}", headers: {}, properties: {"authSchemes" => [{"name" => "sigv4", "signingRegion" => "#{partition_result['implicitGlobalRegion']}"}]})
|
|
52
55
|
end
|
|
53
56
|
end
|
|
54
57
|
raise ArgumentError, "Invalid Configuration: Missing Region"
|
|
@@ -7,25 +7,22 @@ require 'openssl'
|
|
|
7
7
|
|
|
8
8
|
module Aws
|
|
9
9
|
module CloudFront
|
|
10
|
-
|
|
11
10
|
module Signer
|
|
12
|
-
|
|
13
11
|
# @option options [String] :key_pair_id
|
|
14
12
|
# @option options [String] :private_key
|
|
15
13
|
# @option options [String] :private_key_path
|
|
16
14
|
def initialize(options = {})
|
|
17
15
|
@key_pair_id = key_pair_id(options)
|
|
18
|
-
@cipher = OpenSSL::Digest
|
|
19
|
-
@private_key = OpenSSL::PKey
|
|
16
|
+
@cipher = OpenSSL::Digest.new('SHA1')
|
|
17
|
+
@private_key = OpenSSL::PKey.read(private_key(options))
|
|
20
18
|
end
|
|
21
19
|
|
|
22
20
|
private
|
|
23
21
|
|
|
24
22
|
def scheme_and_uri(url)
|
|
25
23
|
url_sections = url.split('://', 2)
|
|
26
|
-
if url_sections.length < 2
|
|
27
|
-
|
|
28
|
-
end
|
|
24
|
+
raise ArgumentError, "Invalid URL:#{url}" if url_sections.length < 2
|
|
25
|
+
|
|
29
26
|
scheme = url_sections[0].delete('*')
|
|
30
27
|
uri = "#{scheme}://#{url_sections[1]}"
|
|
31
28
|
[scheme, uri]
|
|
@@ -69,7 +66,7 @@ module Aws
|
|
|
69
66
|
resource_content
|
|
70
67
|
end
|
|
71
68
|
else
|
|
72
|
-
msg = "Invalid URI scheme:#{scheme}.Scheme must be one of: http, https or rtmp."
|
|
69
|
+
msg = "Invalid URI scheme:#{scheme}. Scheme must be one of: http, https or rtmp."
|
|
73
70
|
raise ArgumentError, msg
|
|
74
71
|
end
|
|
75
72
|
end
|
|
@@ -87,7 +84,7 @@ module Aws
|
|
|
87
84
|
policy = canned_policy(params[:resource], params[:expires])
|
|
88
85
|
signature_content['Expires'] = params[:expires]
|
|
89
86
|
else
|
|
90
|
-
msg =
|
|
87
|
+
msg = 'Either a policy or a resource with an expiration time must be provided.'
|
|
91
88
|
raise ArgumentError, msg
|
|
92
89
|
end
|
|
93
90
|
|
|
@@ -106,37 +103,34 @@ module Aws
|
|
|
106
103
|
json_hash = {
|
|
107
104
|
'Statement' => [
|
|
108
105
|
'Resource' => resource,
|
|
109
|
-
|
|
110
|
-
'DateLessThan' => {'AWS:EpochTime' => expires}
|
|
111
|
-
}
|
|
106
|
+
'Condition' => { 'DateLessThan' => { 'AWS:EpochTime' => expires } }
|
|
112
107
|
]
|
|
113
108
|
}
|
|
114
109
|
Aws::Json.dump(json_hash)
|
|
115
110
|
end
|
|
116
111
|
|
|
117
112
|
def encode(policy)
|
|
118
|
-
Base64.encode64(policy).gsub(
|
|
113
|
+
Base64.encode64(policy).gsub(%r{[+=/]}, '+' => '-', '=' => '_', '/' => '~')
|
|
119
114
|
end
|
|
120
115
|
|
|
121
116
|
def key_pair_id(options)
|
|
122
|
-
if options[:key_pair_id].nil?
|
|
123
|
-
raise ArgumentError,
|
|
124
|
-
else
|
|
125
|
-
options[:key_pair_id]
|
|
117
|
+
if options[:key_pair_id].nil? || (options[:key_pair_id] == '')
|
|
118
|
+
raise ArgumentError, ':key_pair_id must not be blank'
|
|
126
119
|
end
|
|
120
|
+
|
|
121
|
+
options[:key_pair_id]
|
|
127
122
|
end
|
|
128
123
|
|
|
129
124
|
def private_key(options)
|
|
130
125
|
if options[:private_key]
|
|
131
126
|
options[:private_key]
|
|
132
127
|
elsif options[:private_key_path]
|
|
133
|
-
File.open(options[:private_key_path], 'rb'
|
|
128
|
+
File.open(options[:private_key_path], 'rb', &:read)
|
|
134
129
|
else
|
|
135
|
-
msg =
|
|
130
|
+
msg = ':private_key or :private_key_path should be provided'
|
|
136
131
|
raise ArgumentError, msg
|
|
137
132
|
end
|
|
138
133
|
end
|
|
139
|
-
|
|
140
134
|
end
|
|
141
135
|
end
|
|
142
136
|
end
|