Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fractional seconds from http-date #1847

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/source-1.0/spec/core/protocol-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,7 @@ Smithy defines the following built-in timestamp formats:
* - http-date
- An HTTP date as defined by the ``IMF-fixdate`` production in
:rfc:`7231#section-7.1.1.1` (for example,
``Tue, 29 Apr 2014 18:30:38 GMT``). Note that in addition to the
``IMF-fixdate`` format specified in the RFC, implementations MUST
also support optional fractional seconds (for example,
``Sun, 02 Jan 2000 20:34:56.000 GMT``).
``Tue, 29 Apr 2014 18:30:38 GMT``).
* - epoch-seconds
- Also known as Unix time, the number of seconds that have elapsed since
00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970,
Expand Down
5 changes: 1 addition & 4 deletions docs/source-2.0/spec/protocol-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,7 @@ Smithy defines the following built-in timestamp formats:
* - http-date
- An HTTP date as defined by the ``IMF-fixdate`` production in
:rfc:`7231#section-7.1.1.1` (for example,
``Tue, 29 Apr 2014 18:30:38 GMT``). Note that in addition to the
``IMF-fixdate`` format specified in the RFC, implementations MUST
also support optional fractional seconds (for example,
``Sun, 02 Jan 2000 20:34:56.000 GMT``).
``Tue, 29 Apr 2014 18:30:38 GMT``).
* - epoch-seconds
- Also known as Unix time, the number of seconds that have elapsed since
00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ namespace aws.protocoltests.json

use aws.protocols#awsJson1_1
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#HttpDate
use smithy.test#httpResponseTests

// These tests are for verifying the client can correctly parse
// the `DateTime` and `HttpDate` timestamps with fractional seconds
// These tests verify that clients can parse `DateTime` timestamps with fractional seconds.
@tags(["client-only"])
operation FractionalSeconds {
output: FractionalSecondsOutput
Expand All @@ -33,29 +31,9 @@ apply FractionalSeconds @httpResponseTests([
"Content-Type": "application/x-amz-json-1.1"
},
appliesTo: "client"
},
{
id: "AwsJson11HttpDateWithFractionalSeconds",
documentation: """
Ensures that clients can correctly parse http-date timestamps with fractional seconds""",
protocol: awsJson1_1,
code: 200,
body:
"""
{
"httpdate": "Sun, 02 Jan 2000 20:34:56.456 GMT"
}
""",
params: { httpdate: 946845296.456 }
bodyMediaType: "application/json",
headers: {
"Content-Type": "application/x-amz-json-1.1"
},
appliesTo: "client"
}
])

structure FractionalSecondsOutput {
datetime: DateTime
httpdate: HttpDate
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ namespace aws.protocoltests.query

use aws.protocols#awsQuery
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#HttpDate
use smithy.test#httpResponseTests

// These tests are for verifying the client can correctly parse
// the `DateTime` and `HttpDate` timestamps with fractional seconds
// These tests verify that clients can parse `DateTime` timestamps with fractional seconds.
@tags(["client-only"])
operation FractionalSeconds {
output: FractionalSecondsOutput
Expand All @@ -35,29 +33,8 @@ apply FractionalSeconds @httpResponseTests([
},
appliesTo: "client"
}
{
id: "AwsQueryHttpDateWithFractionalSeconds",
documentation: """
Ensures that clients can correctly parse http-date timestamps with fractional seconds""",
protocol: awsQuery,
code: 200,
body: """
<FractionalSecondsResponse xmlns="https://example.com/">
<FractionalSecondsResult>
<httpdate>Sun, 02 Jan 2000 20:34:56.456 GMT</httpdate>
</FractionalSecondsResult>
</FractionalSecondsResponse>
""",
params: { httpdate: 946845296.456 }
bodyMediaType: "application/xml",
headers: {
"Content-Type": "text/xml"
},
appliesTo: "client"
}
])

structure FractionalSecondsOutput {
datetime: DateTime
httpdate: HttpDate
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ namespace aws.protocoltests.ec2

use aws.protocols#ec2Query
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#HttpDate
use smithy.test#httpResponseTests

// These tests are for verifying the client can correctly parse
// the `DateTime` and `HttpDate` timestamps with fractional seconds
// These tests verify that clients can parse `DateTime` timestamps with fractional seconds.
@tags(["client-only"])
operation FractionalSeconds {
output: FractionalSecondsOutput
Expand All @@ -32,28 +30,9 @@ apply FractionalSeconds @httpResponseTests([
"Content-Type": "text/xml;charset=UTF-8"
},
params: { datetime: 946845296.123 }
},
{
id: "Ec2QueryHttpDateWithFractionalSeconds",
documentation: """
Ensures that clients can correctly parse http-date timestamps with fractional seconds""",
protocol: ec2Query,
code: 200,
body: """
<FractionalSecondsResponse xmlns="https://example.com/">
<httpdate>Sun, 02 Jan 2000 20:34:56.456 GMT</httpdate>
<RequestId>requestid</RequestId>
</FractionalSecondsResponse>
""",
bodyMediaType: "application/xml",
headers: {
"Content-Type": "text/xml;charset=UTF-8"
},
params: { httpdate: 946845296.456 }
}
])

structure FractionalSecondsOutput {
datetime: DateTime
httpdate: HttpDate
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ namespace aws.protocoltests.restjson

use aws.protocols#restJson1
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#HttpDate
use smithy.test#httpResponseTests

// These tests are for verifying the client can correctly parse
// the `DateTime` and `HttpDate` timestamps with fractional seconds
// These tests verify that clients can parse `DateTime` timestamps with fractional seconds.
@tags(["client-only"])
@http(uri: "/FractionalSeconds", method: "POST")
operation FractionalSeconds {
Expand All @@ -31,26 +29,9 @@ apply FractionalSeconds @httpResponseTests([
params: { datetime: 946845296.123 }
bodyMediaType: "application/json",
appliesTo: "client"
},
{
id: "RestJsonHttpDateWithFractionalSeconds",
documentation: """
Ensures that clients can correctly parse http-date timestamps with fractional seconds""",
protocol: restJson1,
code: 200,
body:
"""
{
"httpdate": "Sun, 02 Jan 2000 20:34:56.456 GMT"
}
""",
params: { httpdate: 946845296.456 }
bodyMediaType: "application/json",
appliesTo: "client"
}
])

structure FractionalSecondsOutput {
datetime: DateTime
httpdate: HttpDate
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ apply MalformedTimestampBodyDefault @httpMalformedRequestTests([
}
},
testParameters: {
"value" : ["Tue, 29 Apr 2014 18:30:38 GMT",
"Sun, 02 Jan 2000 20:34:56.000 GMT"]
"value" : ["Tue, 29 Apr 2014 18:30:38 GMT"]
},
tags : ["timestamp"]
},
Expand Down Expand Up @@ -156,8 +155,7 @@ apply MalformedTimestampBodyDateTime @httpMalformedRequestTests([
}
},
testParameters: {
"value" : ["Tue, 29 Apr 2014 18:30:38 GMT",
"Sun, 02 Jan 2000 20:34:56.000 GMT"]
"value" : ["Tue, 29 Apr 2014 18:30:38 GMT"]
},
tags : ["timestamp"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ apply MalformedTimestampHeaderDateTime @httpMalformedRequestTests([
}
},
testParameters: {
"value" : ["Tue, 29 Apr 2014 18:30:38 GMT",
"Sun, 02 Jan 2000 20:34:56.000 GMT"]
"value" : ["Tue, 29 Apr 2014 18:30:38 GMT"]
},
tags : ["timestamp"]
},
Expand Down Expand Up @@ -213,8 +212,7 @@ apply MalformedTimestampHeaderEpoch @httpMalformedRequestTests([
}
},
testParameters: {
"value" : ["Tue, 29 Apr 2014 18:30:38 GMT",
"Sun, 02 Jan 2000 20:34:56.000 GMT"]
"value" : ["Tue, 29 Apr 2014 18:30:38 GMT"]
},
tags : ["timestamp"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ apply MalformedUniqueItems @httpMalformedRequestTests([
}
},
testParameters: {
value: ["[\"Tue, 29 Apr 2014 18:30:38 GMT\", \"Tue, 29 Apr 2014 18:30:38 GMT\"]", "[\"Sun, 02 Jan 2000 20:34:56.000 GMT\", \"Sun, 02 Jan 2000 20:34:56.000 GMT\"]"]
value: ["[\"Tue, 29 Apr 2014 18:30:38 GMT\", \"Tue, 29 Apr 2014 18:30:38 GMT\"]"]
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ namespace aws.protocoltests.restxml

use aws.protocols#restXml
use aws.protocoltests.shared#DateTime
use aws.protocoltests.shared#HttpDate
use smithy.test#httpResponseTests

// These tests are for verifying the client can correctly parse
// the `DateTime` and `HttpDate` timestamps with fractional seconds
// These tests verify that clients can parse `DateTime` timestamps with fractional seconds.
@tags(["client-only"])
@http(uri: "/FractionalSeconds", method: "POST")
operation FractionalSeconds {
Expand All @@ -32,27 +30,9 @@ apply FractionalSeconds @httpResponseTests([
"Content-Type": "application/xml"
},
params: { datetime: 946845296.123 }
},
{
id: "RestXmlHttpDateWithFractionalSeconds",
documentation: """
Ensures that clients can correctly parse http-date timestamps with fractional seconds""",
protocol: restXml,
code: 200,
body: """
<FractionalSecondsOutput>
<httpdate>Sun, 02 Jan 2000 20:34:56.456 GMT</httpdate>
</FractionalSecondsOutput>
""",
bodyMediaType: "application/xml",
headers: {
"Content-Type": "application/xml"
},
params: { httpdate: 946845296.456 }
}
])

structure FractionalSecondsOutput {
datetime: DateTime
httpdate: HttpDate
}