File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1
1
Unreleased Changes
2
2
------------------
3
3
4
+ * Issue - Raise error when ` use_fips_endpoint ` is used with ` use_accelerate_endpoint ` .
5
+
4
6
1.105.0 (2021-11-04)
5
7
------------------
6
8
Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ def call(context)
46
46
raise ArgumentError ,
47
47
'Cannot use both :use_accelerate_endpoint and :endpoint'
48
48
end
49
+ # Raise if :use_fips_endpoint and accelerate are both provided
50
+ if accelerate && context . config . use_fips_endpoint
51
+ raise ArgumentError ,
52
+ 'Cannot use both :use_accelerate_endpoint and ' \
53
+ ':use_fips_endpoint'
54
+ end
49
55
context [ :use_accelerate_endpoint ] = accelerate
50
56
@handler . call ( context )
51
57
end
Original file line number Diff line number Diff line change @@ -65,6 +65,26 @@ module S3
65
65
)
66
66
end
67
67
68
+ it 'raises when accelerate and endpoint are configured' do
69
+ expect do
70
+ Client . new (
71
+ options . merge (
72
+ use_accelerate_endpoint : true , endpoint : 'https://amazon.com'
73
+ )
74
+ ) . put_object ( bucket : 'bucket-name' , key : 'key' )
75
+ end . to raise_error ( ArgumentError , /:endpoint/ )
76
+ end
77
+
78
+ it 'raises when accelerate and use_fips_endpoint are configured' do
79
+ expect do
80
+ Client . new (
81
+ options . merge (
82
+ use_accelerate_endpoint : true , use_fips_endpoint : true
83
+ )
84
+ ) . put_object ( bucket : 'bucket-name' , key : 'key' )
85
+ end . to raise_error ( ArgumentError , /:use_fips_endpoint/ )
86
+ end
87
+
68
88
it 'does not apply to #create_bucket' do
69
89
resp = accelerated_client . create_bucket ( bucket : 'bucket-name' )
70
90
expect ( resp . context . http_request . endpoint . to_s ) . to eq (
You can’t perform that action at this time.
0 commit comments