@@ -442,31 +442,28 @@ func TestEndpointWithARN(t *testing.T) {
442442 expectedSigningName : "s3-outposts" ,
443443 expectedSigningRegion : "us-gov-east-1" ,
444444 },
445- "Outpost AccessPoint Fips region" : {
445+ "Outpost AccessPoint FIPS cross- region" : {
446446 bucket : "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
447447 options : s3.Options {
448448 Region : "fips-us-gov-west-1" ,
449449 },
450450 expectedErr : "ConfigurationError : client region does not match provided ARN region" ,
451451 },
452- "Outpost AccessPoint Fips region in Arn " : {
453- bucket : "arn:aws-us-gov:s3-outposts:fips- us-gov-west -1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
452+ "Outpost AccessPoint with FIPS client cross-region " : {
453+ bucket : "arn:aws-us-gov:s3-outposts:us-gov-east -1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
454454 options : s3.Options {
455- Region : "fips-us-gov-west-1" ,
456- EndpointOptions : endpoints.Options {DisableHTTPS : true },
457- UseARNRegion : true ,
455+ Region : "fips-us-gov-west-1" ,
456+ UseARNRegion : true ,
458457 },
459- expectedErr : "InvalidARNError : resource ARN not supported for FIPS region " ,
458+ expectedErr : "use of ARN is not supported when client or request is configured for FIPS" ,
460459 },
461- "Outpost AccessPoint Fips region with valid ARN region" : {
462- bucket : "arn:aws-us-gov:s3-outposts:us-gov-east -1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
460+ "Outpost AccessPoint with FIPS client matching region" : {
461+ bucket : "arn:aws-us-gov:s3-outposts:us-gov-west -1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
463462 options : s3.Options {
464463 Region : "fips-us-gov-west-1" ,
465464 UseARNRegion : true ,
466465 },
467- expectedReqURL : "https://myaccesspoint-123456789012.op-01234567890123456.s3-outposts.us-gov-east-1.amazonaws.com/testkey?x-id=GetObject" ,
468- expectedSigningName : "s3-outposts" ,
469- expectedSigningRegion : "us-gov-east-1" ,
466+ expectedErr : "use of ARN is not supported when client or request is configured for FIPS" ,
470467 },
471468 "Outpost AccessPoint with Immutable Endpoint" : {
472469 bucket : "arn:aws:s3-outposts:us-west-2:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
@@ -809,6 +806,54 @@ func TestEndpointWithARN(t *testing.T) {
809806 expectedSigningName : "s3" ,
810807 expectedSigningRegion : "us-west-2" ,
811808 },
809+ "Invalid AccessPoint ARN with FIPS pseudo-region (prefix)" : {
810+ bucket : "arn:aws:s3:fips-us-east-1:123456789012:accesspoint:myendpoint" ,
811+ options : s3.Options {
812+ Region : "us-west-2" ,
813+ UseARNRegion : true ,
814+ },
815+ expectedErr : "FIPS region not allowed in ARN" ,
816+ },
817+ "Invalid AccessPoint ARN with FIPS pseudo-region (suffix)" : {
818+ bucket : "arn:aws:s3:us-east-1-fips:123456789012:accesspoint:myendpoint" ,
819+ options : s3.Options {
820+ Region : "us-west-2" ,
821+ UseARNRegion : true ,
822+ },
823+ expectedErr : "FIPS region not allowed in ARN" ,
824+ },
825+ "Invalid Outpost AccessPoint ARN with FIPS pseudo-region (prefix)" : {
826+ bucket : "arn:aws:s3-outposts:fips-us-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
827+ options : s3.Options {
828+ Region : "us-west-2" ,
829+ UseARNRegion : true ,
830+ },
831+ expectedErr : "FIPS region not allowed in ARN" ,
832+ },
833+ "Invalid Outpost AccessPoint ARN with FIPS pseudo-region (suffix)" : {
834+ bucket : "arn:aws:s3-outposts:us-east-1-fips:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint" ,
835+ options : s3.Options {
836+ Region : "us-west-2" ,
837+ UseARNRegion : true ,
838+ },
839+ expectedErr : "FIPS region not allowed in ARN" ,
840+ },
841+ "Invalid Object Lambda ARN with FIPS pseudo-region (prefix)" : {
842+ bucket : "arn:aws:s3-object-lambda:fips-us-east-1:123456789012:accesspoint/myap" ,
843+ options : s3.Options {
844+ Region : "us-west-2" ,
845+ UseARNRegion : true ,
846+ },
847+ expectedErr : "FIPS region not allowed in ARN" ,
848+ },
849+ "Invalid Object Lambda ARN with FIPS pseudo-region (suffix)" : {
850+ bucket : "arn:aws:s3-object-lambda:us-east-1-fips:123456789012:accesspoint/myap" ,
851+ options : s3.Options {
852+ Region : "us-west-2" ,
853+ UseARNRegion : true ,
854+ },
855+ expectedErr : "FIPS region not allowed in ARN" ,
856+ },
812857 }
813858
814859 for name , c := range cases {
0 commit comments