Permit HTTP redirects globally and add RFC references#607
Permit HTTP redirects globally and add RFC references#607tianon wants to merge 1 commit intoopencontainers:mainfrom
Conversation
|
Implementation evidence: 307:
429 / Retry-After:
|
- allow registries to redirect any request per RFC 9110 (section 15.4); status codes in this spec are those returned after redirects have been followed; clients MUST NOT forward `Authorization` headers across host boundaries - add 429 / Retry-After guidance per RFC 6585 (section 4) and RFC 9110 (section 10.2.3) - note that RFC 9110 governs HTTP behaviors not otherwise specified - normalize all RFC citations to consistent rfc-editor.org URLs with section numbers in link text Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
| The API operates over HTTP. Below is a summary of the endpoints used by the API. | ||
| The API operates over HTTP. | ||
| Where this specification does not define specific behavior, implementations SHOULD follow the HTTP semantics defined in [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110). | ||
| Registries MAY respond to any request with a redirect per [RFC 9110 (section 15.4)](https://www.rfc-editor.org/rfc/rfc9110#section-15.4); clients MUST follow such redirects, and MUST NOT forward `Authorization` headers across host boundaries unless explicitly configured to do so. |
There was a problem hiding this comment.
| Registries MAY respond to any request with a redirect per [RFC 9110 (section 15.4)](https://www.rfc-editor.org/rfc/rfc9110#section-15.4); clients MUST follow such redirects, and MUST NOT forward `Authorization` headers across host boundaries unless explicitly configured to do so. | |
| Registries MAY respond to any request with a redirect per [RFC 9110 (section 15.4)](https://www.rfc-editor.org/rfc/rfc9110#section-15.4); clients following such redirects MUST NOT forward `Authorization` headers across host boundaries unless explicitly configured to do so. |
Don't think we should force clients to accept redirects, that feels like an optional consideration.
There was a problem hiding this comment.
It's not "forcing", it's documenting reality.
Do you have a counter example of a client that doesn't follow redirects today? Any such client won't work against almost every single major registry, which is really compelling evidence for "this should be normative in the spec"
There was a problem hiding this comment.
keyword .. "should be normative" not MUST follow.. should be noted that in some circles redirects are not normative.
Not aware of any clients that disallow redirects outside some restrictions on the number of redirects.
There was a problem hiding this comment.
There was a problem hiding this comment.
Limiting the number of redirects followed is totally reasonable and actually called out in the RFC itself:
A client SHOULD detect and intervene in cyclical redirections (i.e., "infinite" redirection loops).
Note: An earlier version of this specification recommended a maximum of five redirections ([RFC2068], Section 10.3). Content developers need to be aware that some clients might implement such a fixed limitation.
I'd be willing to soften to a SHOULD from a MUST, but removing the strong language is (IMO) not being honest about how this actually works in practice -- for example, any client that doesn't follow redirects at all will literally not work with any of the largest public registries. That's stronger ecosystem evidence than would be covered by just a recommendation.
There was a problem hiding this comment.
Limiting the number of redirects followed is totally reasonable and actually called out in the RFC itself:
A client SHOULD detect and intervene in cyclical redirections (i.e., "infinite" redirection loops).
Note: An earlier version of this specification recommended a maximum of five redirections ([RFC2068], Section 10.3). Content developers need to be aware that some clients might implement such a fixed limitation.
I'd be willing to soften to a
SHOULDfrom aMUST, but removing the strong language is (IMO) not being honest about how this actually works in practice -- for example, any client that doesn't follow redirects at all will literally not work with any of the largest public registries. That's stronger ecosystem evidence than would be covered by just a recommendation.
soften to SHOULD language SGTM
I think it would also be fair to mention the need for reasoned following of redirects to enable working with the preponderance of public registries. Another reasonable response might be to check redirect allowance config for certain regions / providers, or just to include an info/debug log of the redirects so as not to hide them from the user.. etc..
allow registries to redirect any request per RFC 9110 (section 15.4); status codes in this spec are those returned after redirects have been followed; clients MUST NOT forward
Authorizationheaders across host boundariesadd 429 / Retry-After guidance per RFC 6585 (section 4) and RFC 9110 (section 10.2.3)
note that RFC 9110 governs HTTP behaviors not otherwise specified
normalize all RFC citations to consistent rfc-editor.org URLs with section numbers in link text
See also:
TOOMANYREQUESTSto the error table; this adds the RFC citations)