Skip to content

Commit

Permalink
Replace RFC 7230 references
Browse files Browse the repository at this point in the history
RFC 7230 has been obsoleted by RFC 9110 and RFC 9112. This replaces
references to the old RFC with references to the relevant sections of
the new RFC.
  • Loading branch information
JordonPhillips committed May 23, 2024
1 parent 39006f9 commit 0f2ddf7
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 39 deletions.
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
2 changes: 0 additions & 2 deletions docs/source-1.0/spec/aws/aws-query-serialization.rst.template
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
26 changes: 11 additions & 15 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
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 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
4 changes: 2 additions & 2 deletions docs/source-2.0/additional-specs/protocols/smithy-rpc-v2.rst
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
16 changes: 7 additions & 9 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 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
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 @@ -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
@@ -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 @@ -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 @@ -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

0 comments on commit 0f2ddf7

Please sign in to comment.