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

Pass cryptographic nonce metadata to Fetch #990

Merged
merged 1 commit into from
Apr 6, 2016
Merged

Pass cryptographic nonce metadata to Fetch #990

merged 1 commit into from
Apr 6, 2016

Conversation

mikewest
Copy link
Member

@mikewest mikewest commented Apr 5, 2016

In order for CSP to correctly block/allow requests, HTML needs to teach
Fetch about the cryptographic nonce metadata that ought to be associated
with script requests.

whatwg/fetch#273

@mikewest
Copy link
Member Author

mikewest commented Apr 5, 2016

Part 2/3. CSSOM is next.

@mikewest
Copy link
Member Author

mikewest commented Apr 5, 2016

CSSOM changes require clarity around #968. Will address at some point in the future.

@@ -58517,6 +58518,9 @@ o............A....e
<li><p>Let <var>CORS setting</var> be the current state of the element's <code
data-x="attr-script-crossorigin">crossorigin</code> content attribute.</p></li>

<li><p>Let <var>crytographic nonce metadata</var> be the current state of the element's <code
data-x="attr-script-nonce">nonce</code> content attribute.</p></li>
Copy link
Member

Choose a reason for hiding this comment

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

value, this attribute has no states.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to line up with other attribute checks in this algorithm.

@annevk
Copy link
Member

annevk commented Apr 5, 2016

@mikewest it seems you didn't update all call sites of the algorithms. These are also used by workers. Presumably those need to pass the empty string?

@@ -58574,7 +58584,8 @@ o............A....e
</li>

<li><p><span>Fetch a module script tree</span> given <var>url</var>, <var>credentials
mode</var>, "<code data-x="">script</code>", and <var>settings</var>.</p></li>
mode</var>, <var>cryptographic nonce metadata</var>, "<code data-x="">script</code>", and
Copy link
Member

Choose a reason for hiding this comment

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

typo: should be "cryptographic nonce", not "cryptographic nonce metadata". Here and above.

@domenic
Copy link
Member

domenic commented Apr 5, 2016

This LGTM besides the typo and the issue @annevk mentioned with the other call sites of the script fetching algorithms.

@domenic domenic assigned mikewest and unassigned domenic Apr 5, 2016
@mikewest
Copy link
Member Author

mikewest commented Apr 6, 2016

@mikewest it seems you didn't update all call sites of the algorithms. These are also used by workers. Presumably those need to pass the empty string?

That's "fetch a classic worker script", right? I didn't update that algorithm, as we're not currently doing anything nonce-related for Workers. If/when we do, I'd certainly throw a patch your way.

@mikewest
Copy link
Member Author

mikewest commented Apr 6, 2016

Ah, I see. The Worker processing model calls into "fetch a module script tree". I need to pass in an empty string there. If only specs had compiler errors...

In order for CSP to correctly block/allow requests, HTML needs to teach
Fetch about the cryptographic nonce metadata that ought to be associated
with script requests.

whatwg/fetch#273
@mikewest
Copy link
Member Author

mikewest commented Apr 6, 2016

Updated with the typo @domenic noted, and squished. Was that the only algorithm I missed, @annevk, or did you see more?

@annevk annevk merged commit 5479e07 into whatwg:master Apr 6, 2016
@annevk
Copy link
Member

annevk commented Apr 6, 2016

It was just the one, thanks. By the way, you no longer have to squash since GitHub has a new feature that allows us to use the fancy green button to do that while preserving linear history. It's like we're living in the future.

@mikewest
Copy link
Member Author

mikewest commented Apr 6, 2016

I love the future! Thanks.

@mikewest mikewest deleted the nonce branch April 6, 2016 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants