Skip to content

Commit

Permalink
add s3 dot segment protocol tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean O'Brien authored and JordonPhillips committed Feb 27, 2024
1 parent b8e5f5c commit 18530ec
Showing 1 changed file with 84 additions and 1 deletion.
85 changes: 84 additions & 1 deletion smithy-aws-protocol-tests/model/restXml/services/s3.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ service AmazonS3 {
operations: [
ListObjectsV2,
GetBucketLocation,
DeleteObjectTagging
DeleteObjectTagging,
GetObject
],
}

Expand Down Expand Up @@ -343,6 +344,74 @@ operation DeleteObjectTagging {
output: DeleteObjectTaggingOutput
}

@httpRequestTests([
{
id: "S3PreservesLeadingDotSegmentInUriLabel",
documentation: """
S3 clients should not remove dot segments from request paths.
""",
protocol: restXml,
method: "GET",
uri: "/../key.txt",
host: "s3.us-west-2.amazonaws.com",
resolvedHost: "mybucket.s3.us-west-2.amazonaws.com",
body: "",
queryParams: [
"tagging"
],
params: {
Bucket: "mybucket",
Key: "../key.txt"
},
vendorParamsShape: aws.protocoltests.config#AwsConfig,
vendorParams: {
scopedConfig: {
client: {
region: "us-west-2",
},
s3: {
addressing_style: "virtual",
},
},
},
},
{
id: "S3PreservesEmbeddedDotSegmentInUriLabel",
documentation: """
S3 clients should not remove dot segments from request paths.
""",
protocol: restXml,
method: "GET",
uri: "foo/../key.txt",
host: "s3.us-west-2.amazonaws.com",
resolvedHost: "mybucket.s3.us-west-2.amazonaws.com",
body: "",
queryParams: [
"tagging"
],
params: {
Bucket: "mybucket",
Key: "foo/../key.txt"
},
vendorParamsShape: aws.protocoltests.config#AwsConfig,
vendorParams: {
scopedConfig: {
client: {
region: "us-west-2",
},
s3: {
addressing_style: "virtual",
},
},
},
}
])
@http(uri: "/{Bucket}/{Key+}",method: "GET")
operation GetObject {
input: GetObjectRequest,
output: GetObjectOutput,
}


@httpResponseTests([{
id: "GetBucketLocationUnwrappedOutput",
Expand Down Expand Up @@ -441,6 +510,20 @@ structure ListObjectsV2Output {
StartAfter: StartAfter,
}

@input
structure GetObjectRequest {
@httpLabel
@required
Bucket: BucketName,

@httpLabel
@required
Key: ObjectKey,
}

@output
structure GetObjectOutput {}

@input
structure DeleteObjectTaggingRequest {
@httpLabel
Expand Down

0 comments on commit 18530ec

Please sign in to comment.