|
531 | 531 | ("S3://bucket-name", (true, false, nothing, "bucket-name", "", "")),
|
532 | 532 | ("HTtp://127.0.0.1:27181/bucket-name/key-name", (true, false, "HTtp://127.0.0.1:27181", "bucket-name", "", "key-name")),
|
533 | 533 | ("htTP://127.0.0.1:27181/bucket-name", (true, false, "htTP://127.0.0.1:27181", "bucket-name", "", "")),
|
| 534 | + |
| 535 | + ("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name", (true, false, nothing, "bucket-name", "us-west-2", "")), |
| 536 | + ("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name/key-name", (true, false, nothing, "bucket-name", "us-west-2", "key-name")), |
534 | 537 | ]
|
535 | 538 | for (url, parts) in s3
|
536 | 539 | ok, accelerate, host, bucket, reg, key = CloudStore.parseAWSBucketRegionKey(url; parseLocal=true)
|
|
587 | 590 | "httP://S3.AmAzonAws.com/bucket-name",
|
588 | 591 | "httP://bucket-name/key-name",
|
589 | 592 | "httP://bucket-name",
|
| 593 | + |
| 594 | + "http://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name", |
| 595 | + "http://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name/key-name", |
| 596 | + "https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.XvpceX.amazonaws.com/bucket-name", |
| 597 | + "https://bucket.Xvpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name", |
| 598 | + "https://XbucketX.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name/key-name", |
590 | 599 | ]
|
591 | 600 | for url in invalid_s3
|
592 | 601 | ok, accelerate, host, bucket, reg, key = CloudStore.parseAWSBucketRegionKey(url; parseLocal=true)
|
|
918 | 927 | @test CloudStore.validate_bucket_name("a.b-c1", false) == "a.b-c1"
|
919 | 928 | @test CloudStore.validate_bucket_name("a"^63, false) == "a"^63
|
920 | 929 | @test CloudStore.validate_bucket_name("a"^3, false) == "a"^3
|
| 930 | + |
| 931 | + @test_throws ArgumentError("Validation failed for `region` \"xx-xxxx-x\"") CloudStore.parseAWSBucketRegionKey("https://bucket.vpce-1a2b3c4d-5e6f.s3.xx-xxxx-x.vpce.amazonaws.com/bucket-name") |
| 932 | + @test_throws ArgumentError("Validation failed for `bucket` name \"bn\": Bucket names must be between 3 (min) and 63 (max) characters long.") CloudStore.parseAWSBucketRegionKey("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bn") |
| 933 | + @test_throws ArgumentError("Validation failed for `key` \"key-n$("a" ^ 1024)me\": The key name must be shorter than 1025 bytes.") CloudStore.parseAWSBucketRegionKey("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com/bucket-name/key-n$("a" ^ 1024)me") |
921 | 934 | end
|
922 | 935 |
|
923 | 936 | @testset "validate_container_name" begin
|
|
0 commit comments