Skip to content

Commit

Permalink
service/s3: Update unit test to clarify implemented behavior (#4033)
Browse files Browse the repository at this point in the history
Updates Amazon S3 Output ARN unit test to more specifically describe the
behavior that is being tested.

If the client's resolved endpoint's signing region does not match the
Output ARN's region component the client will return the region not
match error. If the client's resolved endpoint's signing region does
match the Output ARN's region component, but the API client's configured
region includes FIPS, the FIPS configured error will be returned.
  • Loading branch information
jasdel committed Jul 28, 2021
1 parent a4a27c7 commit abb47fb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions service/s3/endpoint_test.go
Expand Up @@ -265,14 +265,22 @@ func TestEndpoint(t *testing.T) {
expectedSigningName: "s3-outposts",
expectedSigningRegion: "us-gov-east-1",
},
"Outpost AccessPoint FIPS client region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
"Outpost AccessPoint FIPS client region, resolved signing region does not match ARN region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-unknown-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
config: &aws.Config{
EndpointResolver: endpoints.AwsUsGovPartition(),
Region: aws.String("fips-us-gov-east-1"),
Region: aws.String("fips-us-gov-unknown-1"),
},
expectedErr: "ConfigurationError: client region does not match provided ARN region",
},
"Outpost AccessPoint FIPS client region, resolved signing region does match ARN region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-west-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
config: &aws.Config{
EndpointResolver: endpoints.AwsUsGovPartition(),
Region: aws.String("fips-us-gov-west-1"),
},
expectedErr: "use of ARN is not supported when client or request is configured for FIPS",
},
"Outpost AccessPoint FIPS client region with matching ARN region": {
bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint",
config: &aws.Config{
Expand Down

0 comments on commit abb47fb

Please sign in to comment.