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

Spec partition nonce functionality #149

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
66 changes: 66 additions & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ spec: url; for:/; type: dfn; text: url
"deliveredBy": [
"https://wicg.io/"
]
},
"iframe-credentialless": {
"authors": [
"Arthur Sonzogni",
"Camille Lamy"
],
"href": "https://wicg.github.io/anonymous-iframe/",
"title": "Iframe credentialless",
"status": "CG-DRAFT",
"publisher": "WICG",
"deliveredBy": [
"https://wicg.io/"
]
}
}
</pre>
Expand Down Expand Up @@ -264,6 +277,10 @@ spec: attribution-reporting; urlPrefix: https://wicg.github.io/attribution-repor
spec: turtledove; urlPrefix: https://wicg.github.io/turtledove/
type: dfn
text: construct a pending fenced frame config; url: construct-a-pending-fenced-frame-config
spec: iframe-credentialless; urlPrefix: https://wicg.github.io/anonymous-iframe/
type: dfn
for: navigation params
text: credentialless; url: navigation-params-credentialless
</pre>

<style>
Expand Down Expand Up @@ -3990,6 +4007,55 @@ at the expense of some utility.
</wpt>
</div>

<h3 id=credentialless-monkeypatch>Iframe credentialless</h3>

The [[!IFRAME-CREDENTIALLESS]] specification defines a new object, the [=page credentialless
nonce=]. At a high level, the [=fenced frame config instance/partition nonce=] serves the same
purpose as the [=page credentialless nonce=] (partitioning storage and network), but scoped to each
fenced frame rather than to each credentialless iframe. The [=fenced frame config instance/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is page credentialless nonce really scoped to each credentialless iframe? The definition you link to seems to be tied to a top-level browsing context, which spans many iframes.

partition nonce=] is also used to revoke network access in fenced frames. Perform the following
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
partition nonce=] is also used to revoke network access in fenced frames. Perform the following
partition nonce=] is also used to revoke network access in fenced frames. Apply the following

monkeypatches to the [[!IFRAME-CREDENTIALLESS]] spec.

Add the following algorithm:
gtanzer marked this conversation as resolved.
Show resolved Hide resolved

<div algorithm>
To <dfn for="browsing context">compute the effective partition nonce</dfn> given a boolean
|credentialless| and [=fenced frame config instance/partition nonce=]-or-null
|newFencedFrameNonce|:

1. If |credentialless| is true, return the associated [=browsing context=]'s [=top-level
browsing context=]'s [=page credentialless nonce=].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the usage of "top-level browsing context" here will be fenced — is that intentional? That's because this specification does not override HTML's definition of top-level browsing context, which just iteratively reaches upward via the "parent" property, never the "unfenced parent" property.

If you want the unfenced version, you'll need to grab a navigable's top-level traversable and get its browsing context and grab its page credentialless nonce.

I just wanted to raise this in case it was unexpected. WDYT?

It seems like this algorithm prefers:

  1. A "fenced" page redentialless nonce, when we're in a credentialless iframe
  2. A "new" fenced frame nonce, when it exists
  3. The "old" navigated-away-from browsing context's fenced frame partition nonce, when we're in a fenced frame whose browsing context is apparently being navigated away from. (Is that right?)

Actually (3) above is a little confusing or surprising to me. Below on L4031 we're always grabbing the current browsing context's fenced frame config instance's nonce, even when said browsing context is I guess being navigated away from? Am I missing something?


1. If |newFencedFrameNonce| is not null, return |newFencedFrameNonce|.

1. Let |instance| be the associated [=browsing context=]'s [=browsing context/fenced frame
config instance=].

1. Return |instance|'s [=fenced frame config instance/partition nonce=] if |instance| is not
null, and return null otherwise.
</div>

<div algorithm="process a navigate fetch">
Modify the step added to <a href=https://wicg.github.io/anonymous-iframe/#spec-navigation-partition-nonce>
process a navigate fetch</a> to read:

13. Let <var ignore>partitionNonce</var> be the result of [=browsing context/computing the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to triple check here — the partitionNonce returned from the "computing" algorithm can be null. Can all of the consumers of this (presumably in the iframe credentialless spec) consume null in this case? Just want to make sure we're not in a position where we're passing null around to things that only accept/expect a populated nonce.

effective partition nonce=] on <var ignore>browsingContext</var> given <var ignore>
credentialless</var> and <var ignore>sourceSnapshotParams</var>'s [=source snapshot params/
target fenced frame config=].
</div>

<div algorithm="initialize the document object">
Modify the step added to <a href=https://wicg.github.io/anonymous-iframe/#spec-window-partition-nonce>
initialize the document object</a> to read:

6.9. Let <var ignore>partitionNonce</var> be the result of [=browsing context/computing the
effective partition nonce=] on <var ignore>browsingContext</var> given |navigationParams|'s
[=navigation params/credentialless=] and null if |navigationParams|'s [=navigation params/
fenced frame config instance=] is null else |navigationParams|'s [=navigation params/fenced
frame config instance=]'s [=fenced frame config instance/partition nonce=].
</div>

<h3 id=webrtc-monkeypatch>WebRTC</h3>

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