From 8dbe1042bf0fac70a02843a0d278529b535fbd8c Mon Sep 17 00:00:00 2001 From: Zoe Wang <33073555+zoewangg@users.noreply.github.com> Date: Fri, 5 Jan 2024 15:59:54 -0800 Subject: [PATCH] Add s3 invalid expires protocol test --- .../model/restXml/services/s3.smithy | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/smithy-aws-protocol-tests/model/restXml/services/s3.smithy b/smithy-aws-protocol-tests/model/restXml/services/s3.smithy index 9631ab69c04..615cd2dac10 100644 --- a/smithy-aws-protocol-tests/model/restXml/services/s3.smithy +++ b/smithy-aws-protocol-tests/model/restXml/services/s3.smithy @@ -43,7 +43,8 @@ service AmazonS3 { operations: [ ListObjectsV2, GetBucketLocation, - DeleteObjectTagging + DeleteObjectTagging, + GetObject ], } @@ -364,7 +365,6 @@ operation GetBucketLocation { output: GetBucketLocationOutput, } - structure CommonPrefix { Prefix: Prefix, } @@ -380,6 +380,42 @@ structure GetBucketLocationOutput { LocationConstraint: BucketLocationConstraint, } +@httpResponseTests([{ + id: "GetObjectInvalidExpires", + documentation: """ + S3 clients should not fail the request with invalid expires. + GA SDKs should verify the value in ExpiresString param and + new SDKs should verifiy the value in Expires param + """, + code: 200, + headers: { + "Expires": "foobar1234" + }, + body: "", + protocol: restXml + }]) +@http(uri: "/{Bucket}/{Key+}", method: "GET") +@s3UnwrappedXmlOutput +operation GetObject { + input: GetObjectRequest, + output: GetObjectOutput, +} + +structure GetObjectRequest { + @httpLabel + @required + Bucket: BucketName, + + @httpLabel + @required + Key: KeyName, +} + +structure GetObjectOutput { + @httpHeader("Expires") + Expires: Expires +} + structure ListObjectsV2Request { @httpLabel @required @@ -515,10 +551,14 @@ string AccountId string BucketName +string KeyName + string Delimiter string DisplayName +string Expires + enum EncodingType { @suppress(["EnumShape"]) url