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

Replace outdated RFC references #2298

Merged
merged 2 commits into from
May 23, 2024
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
4 changes: 1 addition & 3 deletions docs/source-1.0/spec/aws/aws-json.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The |quoted shape name| protocol uses the following headers:
* - ``Content-Length``
- true
- The standard ``Content-Length`` header defined by
`RFC 7230 Section 3.3.2`_.
:rfc:`9110#section-8.6`.
* - ``X-Amz-Target``
- true for requests
- The value of this header is the :token:`shape name <smithy:Identifier>` of the
Expand Down Expand Up @@ -207,5 +207,3 @@ These compliance tests define a model that is used to define test cases and
the expected serialized HTTP requests and responses for each case.

*TODO: Add event stream handling specifications.*

.. _`RFC 7230 Section 3.3.2`: https://tools.ietf.org/html/rfc7230#section-3.3.2
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,3 @@ to the input's key.
* - ``union``
- A union is serialized identically to a ``structure`` shape, but only a
single member can be set to a non-null value.

.. _`RFC 7230 Section 3.3.2`: https://tools.ietf.org/html/rfc7230#section-3.3.2
28 changes: 12 additions & 16 deletions docs/source-1.0/spec/core/http-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ and error structures are considered when serializing HTTP messages.

.. important::

Violating `HTTP specifications`_ or relying on poorly-supported HTTP
functionality when defining HTTP bindings will limit interoperability
Violating :rfc:`HTTP specifications <9110>` or relying on poorly-supported
HTTP functionality when defining HTTP bindings will limit interoperability
and likely lead to undefined behavior across Smithy implementations. For
example, avoid defining GET/DELETE requests with payloads, defining
response payloads for operations with a 204/205 status, etc.
Expand Down Expand Up @@ -106,9 +106,8 @@ method
The ``method`` property defines the HTTP method of the operation (e.g., "GET",
"PUT", "POST", "DELETE", "PATCH", etc). Smithy will use this value literally
and will perform no validation on the method. The ``method`` value SHOULD
match the ``operation`` production rule of :rfc:`7230#appendix-B`. This
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This production doesn't seem to exist, even on RFC7230, so I replaced it with a reference to what I think it was talking about.

property does not influence the safety or idempotency characteristics of an
operation.
match one of the definitions found in :rfc:`9110#section-9.3`. This property
does not influence the safety or idempotency characteristics of an operation.


.. _http-uri:
Expand All @@ -117,7 +116,7 @@ uri
---

The ``uri`` property defines the *request-target* of the operation in
*origin-form* as defined in :rfc:`7230#section-5.3.1`. The URI is a simple
*origin-form* as defined in :rfc:`9112#section-3.2.1`. The URI is a simple
pattern that Smithy uses to match HTTP requests to operations and to bind
components of the request URI to fields in the operations's input structure.
:dfn:`Patterns` consist of literal characters that MUST be matched in the
Expand Down Expand Up @@ -525,9 +524,8 @@ Trait selector
``structure`` member that targets a list of these types.
Value type
``string`` value defining a valid HTTP header field name according to
:rfc:`section 3.2 of RFC7230 <7230#section-3.2>`. The value MUST NOT be
empty and MUST be case-insensitively unique across all other members of
the structure.
:rfc:`9110#section-5.1`. The value MUST NOT be empty and MUST be
case-insensitively unique across all other members of the structure.
Conflicts with
:ref:`httpLabel-trait`,
:ref:`httpQuery-trait`,
Expand All @@ -546,7 +544,7 @@ Conflicts with
* ``string`` values with a :ref:`mediaType-trait` are always base64 encoded.
* ``timestamp`` values are serialized using the ``http-date``
format by default, as defined in the ``IMF-fixdate`` production of
:rfc:`7231#section-7.1.1.1`. The :ref:`timestampFormat-trait` MAY be used
:rfc:`9110#section-5.6.7`. The :ref:`timestampFormat-trait` MAY be used
to use a custom serialization format.

.. rubric:: Do not put too much data in HTTP headers
Expand Down Expand Up @@ -954,10 +952,10 @@ the body of the response.

.. rubric:: Do not put too much data in the query string

While there is no limit placed on the length of an `HTTP request line`_,
many HTTP client and server implementations enforce limits in practice.
Carefully consider the maximum allowed length of each member that is bound to
an HTTP query string or path.
While there is no limit placed on the length of an
:rfc:`HTTP request line <9112#section-3>`, many HTTP client and server
implementations enforce limits in practice. Carefully consider the maximum
allowed length of each member that is bound to an HTTP query string or path.


.. smithy-trait:: smithy.api#httpQueryParams
Expand Down Expand Up @@ -1335,5 +1333,3 @@ marked with the ``httpPayload`` trait:


.. _percent-encoded: https://tools.ietf.org/html/rfc3986#section-2.1
.. _HTTP request line: https://tools.ietf.org/html/rfc7230.html#section-3.1.1
.. _HTTP specifications: https://datatracker.ietf.org/doc/html/rfc7230
2 changes: 1 addition & 1 deletion docs/source-1.0/spec/core/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ The following example defines the ``PutForecast`` operation.
.. rubric:: Put semantics

The semantics of a ``put`` lifecycle operation are similar to the semantics
of a HTTP PUT method as described in :rfc:`section 4.3.4 of [RFC7231] <7231#section-4.3.4>`:
of a HTTP PUT method as described in :rfc:`section 4.3.4 of [RFC9110] <9110#section-9.3.4>`:

The PUT method requests that the state of the target resource be
created or replaced ...
Expand Down
2 changes: 1 addition & 1 deletion docs/source-1.0/spec/core/protocol-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Smithy defines the following built-in timestamp formats:
values that contain offsets gracefully by normalizing them to UTC.
* - http-date
- An HTTP date as defined by the ``IMF-fixdate`` production in
:rfc:`7231#section-7.1.1.1` (for example,
:rfc:`9110#section-5.6.7` (for example,
``Tue, 29 Apr 2014 18:30:38 GMT``). A deserializer that encounters an
``http-date`` timestamp with fractional precision SHOULD fail to
deserialize the value (for example, an HTTP server SHOULD return a 400
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ headers for requests:
is ``application/vnd.amazon.eventstream``.
* - ``Content-Length``
- Conditional
- The standard ``Content-Length`` header defined by :rfc:`7230#section-3.3.2`.
- The standard ``Content-Length`` header defined by :rfc:`9110#section-8.6`.
For event streaming requests, this MUST NOT be set.
* - ``Accept``
- Conditional
Expand Down Expand Up @@ -303,7 +303,7 @@ headers for responses:
is ``application/vnd.amazon.eventstream``.
* - ``Content-Length``
- Conditional
- The standard ``Content-Length`` header defined by :rfc:`7230#section-3.3.2`.
- The standard ``Content-Length`` header defined by :rfc:`9110#section-8.6`.
For event streaming requests, this SHOULD NOT be set.


Expand Down
2 changes: 1 addition & 1 deletion docs/source-2.0/aws/protocols/aws-json.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The |quoted shape name| protocol uses the following headers:
* - ``Content-Length``
- true
- The standard ``Content-Length`` header defined by
:rfc:`7230#section-3.3.2`.
:rfc:`9110#section-8.6`.
* - ``X-Amz-Target``
- true for requests
- The value of this header is the :token:`shape name <smithy:Identifier>` of the
Expand Down
2 changes: 1 addition & 1 deletion docs/source-2.0/spec/behavior-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Idempotency
===========

Operations marked with the :ref:`readonly-trait` or :ref:`idempotent-trait`
are considered idempotent as defined in :rfc:`7231#section-4.2.2`. Operations
are considered idempotent as defined in :rfc:`9110#section-9.2.2`. Operations
that contain a top-level input member marked with the :ref:`idempotencytoken-trait`
that are provided a token for the member are also considered idempotent. All
other operations SHOULD be considered unsafe to retry unless the response to
Expand Down
18 changes: 8 additions & 10 deletions docs/source-2.0/spec/http-bindings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and error structures are considered when serializing HTTP messages.

.. important::

Violating :rfc:`HTTP specifications <7230>` or relying on poorly-supported
Violating :rfc:`HTTP specifications <9110>` or relying on poorly-supported
HTTP functionality when defining HTTP bindings will limit interoperability
and likely lead to undefined behavior across Smithy implementations. For
example, avoid defining GET/DELETE requests with payloads, defining
Expand Down Expand Up @@ -107,9 +107,8 @@ method
The ``method`` property defines the HTTP method of the operation (e.g., "GET",
"PUT", "POST", "DELETE", "PATCH", etc). Smithy will use this value literally
and will perform no validation on the method. The ``method`` value SHOULD
match the ``operation`` production rule of :rfc:`7230#appendix-B`. This
property does not influence the safety or idempotency characteristics of an
operation.
match one of the definitions found in :rfc:`9110#section-9.3`. This property
does not influence the safety or idempotency characteristics of an operation.


.. _http-uri:
Expand All @@ -118,7 +117,7 @@ uri
---

The ``uri`` property defines the *request-target* of the operation in
*origin-form* as defined in :rfc:`7230#section-5.3.1`. The URI is a simple
*origin-form* as defined in :rfc:`9112#section-3.2.1`. The URI is a simple
pattern that Smithy uses to match HTTP requests to operations and to bind
components of the request URI to fields in the operations's input structure.
:dfn:`Patterns` consist of literal characters that MUST be matched in the
Expand Down Expand Up @@ -634,9 +633,8 @@ Trait selector
``structure`` member that targets a list of these types.
Value type
``string`` value defining a valid HTTP header field name according to
:rfc:`section 3.2 of RFC7230 <7230#section-3.2>`. The value MUST NOT be
empty and MUST be case-insensitively unique across all other members of
the structure.
:rfc:`9110#section-5.1`. The value MUST NOT be empty and MUST be
case-insensitively unique across all other members of the structure.
Conflicts with
:ref:`httpLabel-trait`,
:ref:`httpQuery-trait`,
Expand All @@ -656,7 +654,7 @@ Conflicts with
* ``string`` values with a :ref:`mediaType-trait` are always base64 encoded.
* ``timestamp`` values are serialized using the ``http-date``
format by default, as defined in the ``IMF-fixdate`` production of
:rfc:`7231#section-7.1.1.1`. The :ref:`timestampFormat-trait` MAY be used
:rfc:`9110#section-5.6.7`. The :ref:`timestampFormat-trait` MAY be used
to use a custom serialization format.

.. note::
Expand Down Expand Up @@ -1089,7 +1087,7 @@ is simply ignored.
.. note::

While there is no limit placed on the length of an
:rfc:`HTTP request line <7230#section-3.1.1>`, many HTTP client and server
:rfc:`HTTP request line <9112#section-3>`, many HTTP client and server
implementations enforce limits in practice. Carefully consider the maximum
allowed length of each member that is bound to an HTTP query string or
path.
Expand Down
2 changes: 1 addition & 1 deletion docs/source-2.0/spec/protocol-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Smithy defines the following built-in timestamp formats:
values that contain offsets gracefully by normalizing them to UTC.
* - http-date
- An HTTP date as defined by the ``IMF-fixdate`` production in
:rfc:`7231#section-7.1.1.1` (for example,
:rfc:`9110#section-5.6.7` (for example,
``Tue, 29 Apr 2014 18:30:38 GMT``). A deserializer that encounters an
``http-date`` timestamp with fractional precision SHOULD fail to
deserialize the value (for example, an HTTP server SHOULD return a 400
Expand Down
2 changes: 1 addition & 1 deletion docs/source-2.0/spec/service-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ Put semantics
^^^^^^^^^^^^^

The semantics of a ``put`` lifecycle operation are similar to the semantics
of a HTTP PUT method as described in :rfc:`section 4.3.4 of [RFC7231] <7231#section-4.3.4>`:
of a HTTP PUT method as described in :rfc:`section 4.3.4 of [RFC9110] <9110#section-9.3.4>`:

The PUT method requests that the state of the target resource be
created or replaced ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ private UriPattern(Builder builder, Map<String, String> queryLiterals) {
* Parse a URI pattern string into a UriPattern.
*
* <p>The provided value must match the origin-form request-target
* grammar production in RFC 7230, section 5.3.1.
* grammar production in RFC 9112, section 3.2.1.
*
* @param uri URI pattern to parse.
* @return Returns the parsed URI pattern.
* @throws InvalidUriPatternException for invalid URI patterns.
* @see <a href="https://tools.ietf.org/html/rfc7230#section-5.3.1">RFC 7230 Section 5.3.1</a>
* @see <a href="https://tools.ietf.org/html/rfc9112#section-3.2.1">RFC 9112 Section 3.2.1</a>
*/
public static UriPattern parse(String uri) {
if (uri.endsWith("?")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void validateHttpDate(Node value, Emitter emitter) {
private String createInvalidHttpDateMessage(String dateValue) {
return String.format(
"Invalid value provided for %s formatted timestamp. Expected a string value that "
+ "matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: %s",
+ "matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: %s",
TimestampFormatTrait.HTTP_DATE, dateValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
public final class HttpHeaderTraitValidator extends AbstractValidator {

/** Gather the allowed characters for HTTP headers (tchar from RFC 7230). **/
/** Gather the allowed characters for HTTP headers (tchar from RFC 9110 section 5.6.2). **/
private static final Set<Character> TCHAR = SetUtils.of(
// "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
'!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~',
Expand Down Expand Up @@ -101,7 +101,7 @@ private Optional<ValidationEvent> validateHeader(MemberShape member, HttpHeaderT
for (int i = 0; i < header.length(); i++) {
if (!TCHAR.contains(header.charAt(i))) {
return Optional.of(danger(member, trait, String.format(
"`%s` is not a valid HTTP header field name according to section 3.2 of RFC 7230", header)));
"`%s` is not a valid HTTP header field name according to section 5.6.2 of RFC 9110", header)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/**
* Validates that `http` traits applied to operation shapes use the most
* semantically appropriate HTTP method according to RFC 7231.
* semantically appropriate HTTP method according to RFC 9110.
*/
public final class HttpMethodSemanticsValidator extends AbstractValidator {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ enum timestampFormat {
EPOCH_SECONDS = "epoch-seconds"

/// 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).
/// RFC 9110#section-5.6.7 (for example, Tue, 29 Apr 2014 18:30:38 GMT).
HTTP_DATE = "http-date"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ public static Collection<Object[]> data() {

// http-date
{"ns.foo#HttpDate", "\"Tue, 29 Apr 2014 18:30:38 GMT\"", null},
{"ns.foo#HttpDate", "\"Tuesday, 29 April 2014 18:30:38 GMT\"", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: Tuesday, 29 April 2014 18:30:38 GMT"}},
{"ns.foo#HttpDate", "\"Tue, 29 Apr 2014 18:30:38 PST\"", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: Tue, 29 Apr 2014 18:30:38 PST"}},
{"ns.foo#HttpDate", "11", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: number"}},
{"ns.foo#HttpDate", "\"Tuesday, 29 April 2014 18:30:38 GMT\"", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: Tuesday, 29 April 2014 18:30:38 GMT"}},
{"ns.foo#HttpDate", "\"Tue, 29 Apr 2014 18:30:38 PST\"", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: Tue, 29 Apr 2014 18:30:38 PST"}},
{"ns.foo#HttpDate", "11", new String[] {"Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: number"}},

// date-time
{"ns.foo#DateTime", "\"1985-04-12T23:20:50.52Z\"", null},
Expand All @@ -267,8 +267,8 @@ public static Collection<Object[]> data() {
"0: Invalid string value, `1985-04-12T23:20:50.52-07:00`, provided for timestamp, `ns.foo#TimestampList$member`. Expected an RFC 3339 formatted timestamp (e.g., \"1985-04-12T23:20:50.52Z\")"
}},
{"ns.foo#TimestampList", "[123]", new String[] {"0: Expected a string value for a date-time timestamp (e.g., \"1985-04-12T23:20:50.52Z\")"}},
{"ns.foo#Structure4", "{\"httpDate\": 1234}", new String[] {"httpDate: Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: number"}},
{"ns.foo#Structure4", "{\"httpDateTarget\": 1234}", new String[] {"httpDateTarget: Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 7231 section-7.1.1.1. Found: number"}},
{"ns.foo#Structure4", "{\"httpDate\": 1234}", new String[] {"httpDate: Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: number"}},
{"ns.foo#Structure4", "{\"httpDateTarget\": 1234}", new String[] {"httpDateTarget: Invalid value provided for http-date formatted timestamp. Expected a string value that matches the IMF-fixdate production of RFC 9110 section-5.6.7. Found: number"}},

// timestamp member with no format.
{"ns.foo#TimestampListNoFormatTrait", "[123]", null},
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[DANGER] ns.foo#SayHelloInput$myHeader: `Not valid!` is not a valid HTTP header field name according to section 3.2 of RFC 7230 | HttpHeaderTrait
[DANGER] ns.foo#SayHelloInput$myHeader: `Not valid!` is not a valid HTTP header field name according to section 5.6.2 of RFC 9110 | HttpHeaderTrait
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/**
* Implements a simple media type parser based on the Content-Type grammar defined in
* <a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1">RFC 7231</a>.
* <a href="https://tools.ietf.org/html/rfc9110#section-8.3">RFC 9110</a>.
*
* <p>The type, subtype, and parameter names are all canonicalized to
* lowercase strings.
Expand Down Expand Up @@ -154,7 +154,7 @@ public int hashCode() {
}

private static final class Parser extends SimpleParser {
// See https://tools.ietf.org/html/rfc7230#section-3.2.6
// See https://tools.ietf.org/html/rfc9110#section-5.6.2
// token = 1*tchar
// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
// / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
Expand Down Expand Up @@ -198,7 +198,7 @@ private static final class Parser extends SimpleParser {
}

private void parse() {
// From: https://tools.ietf.org/html/rfc7231#section-3.1.1.1
// From: https://tools.ietf.org/html/rfc9110#section-8.3.1
// The type, subtype, and parameter name tokens are case-insensitive.
// media-type = type "/" subtype *( OWS ";" OWS parameter )
// type = token.
Expand Down Expand Up @@ -240,7 +240,7 @@ private String parseToken() {
return sliceFrom(start);
}

// See https://tools.ietf.org/html/rfc7230#section-3.2.6
// See https://tools.ietf.org/html/rfc9110#section-5.6.4
// quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
// qdtext = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text
// obs-text = %x80-FF
Expand Down
Loading