Skip to content

Commit

Permalink
Specify the behavior of COEP: credentialless,
Browse files Browse the repository at this point in the history
(Draft)

Originally described in: https://github.com/mikewest/credentiallessness

`credentialless` and `require-corp` are similar. One or the other is a requirements for the `window.crossOriginIsolated` capability.
They differ mostly in the fetch specification. `require-corp` requires a CORP header for cross-origin no-cors responses. `credentialless` doesn't, but omits credentials (Cookies, clients certificates, etc...) in no-cors cross-origin requests.

* HTML (whatwg/html#6638)
  * Define how to parse the `credentialless` value.
  * From the HTML spec point of view, `credentialless` and `require-corp` are equivalent. They have been grouped into `compatible with crossOriginIsolation` and the HTML spec rewritten to use this concept.

* Fetch: (This PR)
  * Define "Cross-Origin-Embedder-Policy allows credentials".
  * Omit credentials for no-cors, cross-origin, COEP:credentialless requests.
  * Check CORP for navigational COEP:credentialless response.

* ServiceWorker: XXX
  * Integration with `Cache.matchAll `algorithm.
  * XXX

See: whatwg/html#6637

----

- [ ] At least two implementers are interested (and none opposed):
   * Chrome: https://chromestatus.com/feature/4918234241302528#details
   * Firefox: XXX
   * Safari: XXX

- [X] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * https://wpt.fyi/results/html/cross-origin-embedder-policy/credentialless/credentialless

- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chrome: https://crbug.com/1175099
   * Firefox: XXX
   * Safari: XXX

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)

----

See: whatwg/html#6637
  • Loading branch information
ArthurSonzogni committed May 4, 2021
1 parent 5fac9e8 commit 43d078a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1870,6 +1870,25 @@ source of security bugs. Please seek security review for features that deal with
<a for="URL serializer"><i>exclude fragment</i></a> set to true.
</ol>

<p>To check <dfn export>Cross-Origin-Embedder-Policy allows credentials</dfn>, given a
<a for=/>request</a> <var>request</var>, run theses steps:

<ol>
<li><p>If <var>request</var>'s <a for=request>mode</a> is not <code>no-cors</code>", return
true.</p>

<li><p>If <var>request</var>'s <a for=request>client</a> is null, return true.</p>

<li><p>If <var>request</var>'s <a for=request>client</a>'s <a for="environment settings
object">embedder policy</a> is not "<code><a for="embedder policy
value">credentialless</a></code>", return true.</p>

<li><p>If <var>request</var>'s <a for=request>origin</a> is not <a>same origin</a> with
<var>request</var>'s <a for=request>client</a>'s <a for="environment settings object">origin</a>,
return true.</p>

<li><p>Return false.</p>
</ol>

<h4 id=responses>Responses</h4>

Expand Down Expand Up @@ -3399,6 +3418,10 @@ Cross-Origin-Resource-Policy = %s"same-origin" / %s"same-site" / %s"cross-or
"<code><a for="embedder policy value">require-corp</a></code>", then set <var>policy</var> to
`<code>same-origin</code>`.

<li><p>If <var>policy</var> is null, <var>embedderPolicyValue</var> is
"<code><a for="embedder policy value">credentialless</a></code>", and
<var>forNavigation</var> is true, then set <var>policy</var> to `<code>same-origin</code>`.

<li>
<p>Switch on <var>policy</var>:

Expand Down Expand Up @@ -4549,6 +4572,10 @@ steps. They return a <a for=/>response</a>.

<p>is true; otherwise false.

<li>
<p>If <a>Cross-Origin-Embedder-Policy allows credentials</a> with
<var>request</var> is false, set <var>includeCredentials</var> to false.</p>

<li><p>Let <var>contentLength</var> be <var>httpRequest</var>'s <a for=request>body</a>'s
<a for=body>length</a>, if <var>httpRequest</var>'s <a for=request>body</a> is non-null;
otherwise null.
Expand Down Expand Up @@ -7720,6 +7747,7 @@ Arkadiusz Michalski,
Arne Johannessen,
Artem Skoretskiy,
Arthur Barstow,
Arthur Sonzogni,
Asanka Herath,
Axel Rauschmayer,
Ben Kelly,
Expand Down

0 comments on commit 43d078a

Please sign in to comment.