@@ -80,51 +80,31 @@ func TestEndpoint_OutpostAccessPointARN(t *testing.T) {
80
80
expectedHeaderForAccountID : true ,
81
81
expectedHeaderForOutpostID : "op-01234567890123456" ,
82
82
},
83
- "Outpost AccessPoint with client region as Fips " : {
83
+ "Outpost AccessPoint with client region as FIPS " : {
84
84
bucket : "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
85
85
config : & aws.Config {
86
86
EndpointResolver : endpoints .AwsUsGovPartition (),
87
87
Region : aws .String ("us-gov-east-1-fips" ),
88
88
},
89
- expectedErr : "InvalidARNError: resource ARN not supported for FIPS region " ,
89
+ expectedErr : "use of ARN is not supported when client or request is configured for FIPS" ,
90
90
},
91
- "Outpost AccessPoint with client Fips region and use arn region enabled " : {
92
- bucket : "arn:aws-us-gov:s3-outposts:us-gov-east -1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
91
+ "Outpost AccessPoint with client FIPS region and cross- region ARN " : {
92
+ bucket : "arn:aws-us-gov:s3-outposts:us-gov-west -1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
93
93
config : & aws.Config {
94
94
EndpointResolver : endpoints .AwsUsGovPartition (),
95
95
Region : aws .String ("us-gov-east-1-fips" ),
96
96
S3UseARNRegion : aws .Bool (true ),
97
97
},
98
- expectedSigningName : "s3-outposts" ,
99
- expectedSigningRegion : "us-gov-east-1" ,
100
- expectedEndpoint : "https://s3-outposts.us-gov-east-1.amazonaws.com" ,
101
- expectedHeaderForAccountID : true ,
102
- expectedHeaderForOutpostID : "op-01234567890123456" ,
98
+ expectedErr : "use of ARN is not supported when client or request is configured for FIPS" ,
103
99
},
104
- "Outpost AccessPoint Fips region in Arn" : {
105
- bucket : "arn:aws-us-gov:s3-outposts:us-gov-east-1-fips:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
106
- config : & aws.Config {
107
- EndpointResolver : endpoints .AwsUsGovPartition (),
108
- EnforceShouldRetryCheck : nil ,
109
- Region : aws .String ("us-gov-east-1-fips" ),
110
- DisableSSL : nil ,
111
- HTTPClient : nil ,
112
- S3UseARNRegion : aws .Bool (true ),
113
- },
114
- expectedErr : "InvalidARNError: resource ARN not supported for FIPS region" ,
115
- },
116
- "Outpost AccessPoint Fips region with valid ARN region" : {
100
+ "Outpost AccessPoint FIPS client region with matching ARN region" : {
117
101
bucket : "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
118
102
config : & aws.Config {
119
103
EndpointResolver : endpoints .AwsUsGovPartition (),
120
104
Region : aws .String ("fips-us-gov-east-1" ),
121
105
S3UseARNRegion : aws .Bool (true ),
122
106
},
123
- expectedEndpoint : "https://s3-outposts.us-gov-east-1.amazonaws.com" ,
124
- expectedSigningName : "s3-outposts" ,
125
- expectedSigningRegion : "us-gov-east-1" ,
126
- expectedHeaderForAccountID : true ,
127
- expectedHeaderForOutpostID : "op-01234567890123456" ,
107
+ expectedErr : "use of ARN is not supported when client or request is configured for FIPS" ,
128
108
},
129
109
"Outpost AccessPoint with DualStack" : {
130
110
bucket : "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
@@ -180,6 +160,22 @@ func TestEndpoint_OutpostAccessPointARN(t *testing.T) {
180
160
},
181
161
expectedErr : "invalid Amazon s3-outposts ARN" ,
182
162
},
163
+ "Invalid Outpost AccessPoint ARN with FIPS pseudo-region (prefix)" : {
164
+ bucket : "arn:aws-us-gov:s3-outposts:fips-us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
165
+ config : & aws.Config {
166
+ Region : aws .String ("us-west-2" ),
167
+ S3UseARNRegion : aws .Bool (true ),
168
+ },
169
+ expectedErr : "FIPS region not allowed in ARN" ,
170
+ },
171
+ "Invalid Outpost AccessPoint ARN with FIPS pseudo-region (suffix)" : {
172
+ bucket : "arn:aws-us-gov:s3-outposts:us-east-1-fips:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
173
+ config : & aws.Config {
174
+ Region : aws .String ("us-west-2" ),
175
+ S3UseARNRegion : aws .Bool (true ),
176
+ },
177
+ expectedErr : "FIPS region not allowed in ARN" ,
178
+ },
183
179
}
184
180
185
181
runValidations (t , cases )
@@ -238,38 +234,31 @@ func TestEndpoint_OutpostBucketARN(t *testing.T) {
238
234
expectedHeaderForOutpostID : "op-01234567890123456" ,
239
235
expectedHeaderForAccountID : true ,
240
236
},
241
- "Outpost Bucket Fips region" : {
237
+ "Outpost Bucket FIPS client region" : {
242
238
bucket : "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket" ,
243
239
config : & aws.Config {
244
240
EndpointResolver : endpoints .AwsUsGovPartition (),
245
241
Region : aws .String ("fips-us-gov-east-1" ),
246
242
},
247
243
expectedErr : "ConfigurationError: client region does not match provided ARN region" ,
248
244
},
249
- "Outpost Bucket Fips region in Arn " : {
250
- bucket : "arn:aws-us-gov:s3-outposts:fips- us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket" ,
245
+ "Outpost Bucket FIPS client region with match ARN region " : {
246
+ bucket : "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket" ,
251
247
config : & aws.Config {
252
- EndpointResolver : endpoints .AwsUsGovPartition (),
253
- EnforceShouldRetryCheck : nil ,
254
- Region : aws .String ("fips-us-gov-east-1" ),
255
- DisableSSL : nil ,
256
- HTTPClient : nil ,
257
- S3UseARNRegion : aws .Bool (true ),
248
+ EndpointResolver : endpoints .AwsUsGovPartition (),
249
+ Region : aws .String ("fips-us-gov-east-1" ),
250
+ S3UseARNRegion : aws .Bool (true ),
258
251
},
259
- expectedErr : "InvalidARNError: resource ARN not supported for FIPS region " ,
252
+ expectedErr : "use of ARN is not supported when client or request is configured for FIPS" ,
260
253
},
261
- "Outpost Bucket Fips region with valid ARN region " : {
262
- bucket : "arn:aws-us-gov:s3-outposts:us-gov-east -1:123456789012:outpost:op-01234567890123456:bucket:mybucket" ,
254
+ "Outpost Bucket FIPS client region with cross-region ARN" : {
255
+ bucket : "arn:aws-us-gov:s3-outposts:us-gov-west -1:123456789012:outpost:op-01234567890123456:bucket:mybucket" ,
263
256
config : & aws.Config {
264
257
EndpointResolver : endpoints .AwsUsGovPartition (),
265
258
Region : aws .String ("fips-us-gov-east-1" ),
266
259
S3UseARNRegion : aws .Bool (true ),
267
260
},
268
- expectedEndpoint : "https://s3-outposts.us-gov-east-1.amazonaws.com" ,
269
- expectedSigningName : "s3-outposts" ,
270
- expectedSigningRegion : "us-gov-east-1" ,
271
- expectedHeaderForOutpostID : "op-01234567890123456" ,
272
- expectedHeaderForAccountID : true ,
261
+ expectedErr : "use of ARN is not supported when client or request is configured for FIPS" ,
273
262
},
274
263
"Outpost Bucket with DualStack" : {
275
264
bucket : "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:bucket:mybucket" ,
@@ -302,6 +291,22 @@ func TestEndpoint_OutpostBucketARN(t *testing.T) {
302
291
},
303
292
expectedErr : "invalid Amazon s3-outposts ARN, unknown resource type" ,
304
293
},
294
+ "Invalid Outpost Bucket ARN with FIPS pseudo-region (prefix)" : {
295
+ bucket : "arn:aws:s3-outposts:fips-us-east-1:123456789012:outpost:op-01234567890123456:bucket:mybucket" ,
296
+ config : & aws.Config {
297
+ Region : aws .String ("us-west-2" ),
298
+ S3UseARNRegion : aws .Bool (true ),
299
+ },
300
+ expectedErr : "FIPS region not allowed in ARN" ,
301
+ },
302
+ "Invalid Outpost Bucket ARN with FIPS pseudo-region (suffix)" : {
303
+ bucket : "arn:aws:s3-outposts:us-east-1-fips:123456789012:outpost:op-01234567890123456:bucket:mybucket" ,
304
+ config : & aws.Config {
305
+ Region : aws .String ("us-west-2" ),
306
+ S3UseARNRegion : aws .Bool (true ),
307
+ },
308
+ expectedErr : "FIPS region not allowed in ARN" ,
309
+ },
305
310
}
306
311
307
312
runValidations (t , cases )
0 commit comments