Skip to content

Commit 01a8212

Browse files
gtanzerGarrett TanzerVergeA
authored
Spec partition nonce functionality and "credentialless" integration (#149)
Co-authored-by: Garrett Tanzer <[email protected]> Co-authored-by: Andrew Verge <[email protected]>
1 parent 2eb05b7 commit 01a8212

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed

spec.bs

+100
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ spec: url; for:/; type: dfn; text: url
7474
"deliveredBy": [
7575
"https://wicg.io/"
7676
]
77+
},
78+
"iframe-credentialless": {
79+
"authors": [
80+
"Arthur Sonzogni",
81+
"Camille Lamy"
82+
],
83+
"href": "https://wicg.github.io/anonymous-iframe/",
84+
"title": "Iframe credentialless",
85+
"status": "CG-DRAFT",
86+
"publisher": "WICG",
87+
"deliveredBy": [
88+
"https://wicg.io/"
89+
]
7790
}
7891
}
7992
</pre>
@@ -269,6 +282,12 @@ spec: attribution-reporting; urlPrefix: https://wicg.github.io/attribution-repor
269282
spec: turtledove; urlPrefix: https://wicg.github.io/turtledove/
270283
type: dfn
271284
text: construct a pending fenced frame config; url: construct-a-pending-fenced-frame-config
285+
spec: iframe-credentialless; urlPrefix: https://wicg.github.io/anonymous-iframe/
286+
type: dfn
287+
for: navigation params
288+
text: credentialless; url: navigation-params-credentialless
289+
type: dfn
290+
text: navigation's credentialless flag; url: navigation-credentialless
272291
spec: RFC6455; urlPrefix: https://datatracker.ietf.org/doc/html/rfc6455
273292
type: dfn
274293
text: fail the WebSocket connection; url: #section-7.1.7
@@ -4333,6 +4352,87 @@ at the expense of some utility.
43334352
</wpt>
43344353
</div>
43354354

4355+
<h3 id=credentialless-monkeypatch>Iframe credentialless</h3>
4356+
4357+
*This first introductory section is non-normative.*
4358+
4359+
The [[!IFRAME-CREDENTIALLESS]] specification defines a new object, the [=page credentialless
4360+
nonce=]. At a high level, the [=fenced frame config instance/partition nonce=] serves the same
4361+
purpose as the [=page credentialless nonce=] (partitioning storage and network). However, each
4362+
fenced frame has its own unique nonce, whereas there is a single [=page credentialless nonce=]
4363+
scoped to the [=traversable navigable=]'s [=navigable/active window=], which is shared by all
4364+
descendent credentialless iframes.
4365+
4366+
In cases where fenced frames and credentialless iframes exist in the same tree, a child's nonce
4367+
will always take precedence over its parent's. For example:
4368+
4369+
* If a credentialless iframe is a child of a fenced frame, the [=page credentialless nonce=] will
4370+
be used to partition resources for that iframe.
4371+
4372+
* If a fenced frame is a child of a credentialless iframe, then the fenced frame's
4373+
[=fenced frame config instance/partition nonce=] will be used to partition resources.
4374+
4375+
In addition to resource partitioning, [=fenced frame config instance/partition nonce=] is also used
4376+
to revoke network access in fenced frames. Apply the following monkeypatches to the
4377+
[[!IFRAME-CREDENTIALLESS]] spec.
4378+
4379+
Add the following algorithm:
4380+
4381+
<div algorithm>
4382+
To <dfn for="browsing context">compute the effective partition nonce</dfn> given a boolean
4383+
|credentialless| and [=fenced frame config instance/partition nonce=]-or-null
4384+
|newFencedFrameNonce|:
4385+
4386+
1. If |credentialless| is true, return the associated [=browsing context=]'s [=top-level
4387+
browsing context=]'s [=page credentialless nonce=].
4388+
4389+
1. If |newFencedFrameNonce| is not null, return |newFencedFrameNonce|.
4390+
4391+
1. Let |instance| be the associated [=browsing context=]'s [=browsing context/fenced frame
4392+
config instance=].
4393+
4394+
1. Return |instance|'s [=fenced frame config instance/partition nonce=] if |instance| is not
4395+
null, and return null otherwise.
4396+
</div>
4397+
4398+
<div algorithm="create navigation params by fetching">
4399+
Rewrite the entirety of <a href=https://wicg.github.io/anonymous-iframe/#spec-navigation-partition-nonce>
4400+
section 6.1.9.1</a> as follows:
4401+
4402+
In [=create navigation params by fetching=], add a new step between 18 and 19 which reads:
4403+
4404+
19. Let <var ignore>partitionNonce</var> be the result of [=browsing context/computing the
4405+
effective partition nonce=] on <var ignore>browsingContext</var>, given the result of
4406+
computing the [=navigation's credentialless flag=] on <var ignore>browsingContext</var>, and
4407+
null.
4408+
4409+
Note: We pass null to [=browsing context/computing the effective partition nonce=] here because
4410+
we want navigation fetches originating from a fenced frame to use the same partition as the
4411+
fenced frame itself. After the navigation fetch completes and we initialize the document, we can
4412+
access the correct partition nonce via the [=fenced frame config instance=]'s
4413+
[=fenced frame config instance/partition nonce=].
4414+
4415+
Renumber step 19 to 20, and rewrite step 20.2.4 to read:
4416+
4417+
4. Set <var ignore>request</var>'s [=request/reserved client=] to a new [=environment=] whose
4418+
[=environment/id=] is a unique opaque string, [=environment/target browsing context=] is
4419+
<var ignore>navigable</var>'s [=navigable/active browsing context=], [=environment/
4420+
creation URL=] is <var ignore>currentURL</var>, [=environment/top-level creation URL=] is
4421+
<var ignore>topLevelCreationURL</var>, [=environment/top-level origin=] is <var ignore>
4422+
topLevelOrigin</var>, and [=environment/partition nonce=] is <var ignore>partitionNonce.</var>
4423+
</div>
4424+
4425+
<div algorithm="initialize the document object">
4426+
Modify the step added to <a href=https://wicg.github.io/anonymous-iframe/#spec-window-partition-nonce>
4427+
initialize the document object</a> to read:
4428+
4429+
6.9. Let <var ignore>partitionNonce</var> be the result of [=browsing context/computing the
4430+
effective partition nonce=] on <var ignore>browsingContext</var> given |navigationParams|'s
4431+
[=navigation params/credentialless=] and null if |navigationParams|'s [=navigation params/
4432+
fenced frame config instance=] is null else |navigationParams|'s [=navigation params/fenced
4433+
frame config instance=]'s [=fenced frame config instance/partition nonce=].
4434+
</div>
4435+
43364436
<h3 id=webrtc-monkeypatch>WebRTC</h3>
43374437

43384438
The [[WEBRTC]] specification defines "ECMAScript APIs in WebIDL to allow media and generic

0 commit comments

Comments
 (0)