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

Nits #120

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Nits #120

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
39 changes: 27 additions & 12 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ <h2 id="framework">Framework</h2>

<h3 id="ip-address-space-heading">IP Address Space</h3>

Define {{IPAddressSpace}} as follows:
<pre class="idl">
enum IPAddressSpace { "public", "private", "local" };
</pre>

Every IP address belongs to an
<dfn export local-lt="address space">IP address space</dfn>, which can be one
of three different values:
Expand Down Expand Up @@ -527,7 +532,7 @@ <h3 id="private-network-request-heading">Private Network Request</h3>
a change is not deemed worth the payoff for now. This can be shipped as an
incremental improvement later on.

NOTE: Some [=local network requests=] are more challenging to secure than
NOTE: Some [=private network requests=] are more challenging to secure than
others. See [[#rollout-difficulties]] for more details.

<h3 id="headers">Additional CORS Headers</h3>
Expand Down Expand Up @@ -918,14 +923,17 @@ <h4 id="fetching">Fetching</h4>
"<a http-header>`Private-Network-Access-ID`</a>" and
|response|'s [=response/header list=].

1. if |targetId| is invalid, return a [=network error=].
1. if |targetId| is not a string of 6 hexadecimal bytes
separated by colons, return a [=network error=].

1. Let |targetName| be the result of [=extracting header list
values=] given
"<a http-header>`Private-Network-Access-Name`</a>" and
|response|'s [=response/header list=].

1. if |targetName| is invalid, return a [=network error=].
1. if |targetName| does not match the [ECMAScript] regexp
/^[a-z0-9_-.]+$/ or has more than 248 UTF-8 code units,
return a [=network error=].

1. Let |state| be the result of [=requesting permission to use=]
the following descriptor:
Expand Down Expand Up @@ -960,10 +968,6 @@ <h4 id="fetch-api">Fetch API</h4>

The Fetch API needs to be adjusted as well.

- Define {{IPAddressSpace}} as follows.
<pre class="idl">
enum IPAddressSpace { "public","private", "local" };
</pre>
- Append an optional [=map/entry=] to {{RequestInfo}}, whose [=map/key=] is
<dfn export>targetAddressSpace</dfn>, and [=map/value=] is a
{{IPAddressSpace}}.
Expand All @@ -972,21 +976,32 @@ <h4 id="fetch-api">Fetch API</h4>
IPAddressSpace targetAddressSpace;
};
</pre>

- Define a new {=targetAddressSpace=} representing the
above in [=request=].
<pre class="idl">
partial interface Request {
readonly attribute IPAddressSpace targetAddressSpace;
};
</pre>

- The <a constructor for=Request lt="Request(input, init)"><code>new
Request(<var ignore=''>input</var>, |init|)</code></a> is
appended with the following step right before setting [=this=]'s [=request=]
to |request|:
1. If |init|["{{RequestInit/targetAddressSpace}}"] [=map/exists=], and
|request|'s [=request/client=] is a [=secure context=], then switch on
|init|["{{RequestInit/targetAddressSpace}}"]:
iVanlIsh marked this conversation as resolved.
Show resolved Hide resolved
1. If |init|["{{RequestInit/targetAddressSpace}}"] [=map/exists=], then
switch on |init|["{{RequestInit/targetAddressSpace}}"]:
<dl class=switch>
<dt>public
<dd>Do nothing.

<dt>private
<dd>Set |request|'s [=target IP address space=] to [=IP address
space/private=]
space/private=].

<dt>local
<dd>Set |request|'s [=target IP address space=] to [=IP address
space/local=]
space/local=].
</dl>

<h4 id="forbidden-header-names">Forbidden header names</h4>
Expand Down