-
Notifications
You must be signed in to change notification settings - Fork 88
Add 'unsafe-webtransport-hashes' keyword to connect-src #791
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
base: main
Are you sure you want to change the base?
Conversation
annevk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable overall. @antosart probably needs to review.
antosart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also need to adapt the post-request check? The interaction between fetch an webtransport is not totally clear to me, but I guess it would also go through https://fetch.spec.whatwg.org/#ref-for-should-block-response%E2%91%A0 ?
|
Also, we probably need WPTs. @mikewest after conversations at TPAC, do we already have an updated process for changes to the spec? |
|
No, it's been on my list since TPAC, but I haven't gotten a proposal out yet. Certainly will require WPT coverage and signals from other vendors, though. I think we have the latter here, but not the former? |
|
I've added the post-request check and used " (Unless there are any takers) I'll work on WPT next! |
|
Build is failing on "No 'dfn' refs found for 'webtransport-hashes'" which are provided by whatwg/fetch#1896. WPT tests are in https://phabricator.services.mozilla.com/D276378. |
|
Thank you. Let's wait for whatwg/fetch#1896. to be merged then. A comment on the WPT, which I'll leave here for simplicity: Could you wait for the violation to be reported (only if CSP is expected to block, of course) in order to avoid flakiness of the test? Also, could you avoid the variable logs and instead separate the assertions? Something like: (feel free to improve further). |
|
Thanks for the feedback @antosart. But wouldn't that relax the test, which also tests that the event is NOT always fired?
Awaiting the event would cause timeouts on failure instead of reporting said failure like the other CSP tests do.
|
|
Ah sorry. I was thinking about reports (which have a history of making tests flaky) but you are actually testing securitypolicyviolations, which should be fired deterministically (it should be enough to let the message loop run enough times). I'll take that back :) |
|
@antosart no the feedback was good. I've restructured the tests to be less timing dependent and match existing CSP tests. They now await the event with a 1 second timeout, same as logTest.js (once I understood it properly). Thanks! |
|
Aligned with upstream name tweak. Should be good to merge right after whatwg/fetch#1896. |
|
Tests merged in web-platform-tests/wpt#57217. |
|
Thanks. IIUC there is a typo in the third test case in |
For use by WebTransport and CSP: - w3c/webtransport#711 - w3c/webappsec-csp#791 Fixes #1880.
|
Hi @antosart, apologies for the late response. Yes your fix corrects the WPT to match the text... Unfortunately, I suspect it's my text that is wrong, not the WPT. I believe the WPT (before your fix) matched our intent stated in #683 (comment). I'll update the text tomorrow. Sorry for the churn on this. Thank goodness for tests, and your keen eye! |
…ault-src directive is present, not otherwise
Fixes #683. Assumes a
unsafe-WebTransport-hash listflagon request (seems simplest post w3c/webtransport#697).@dveditz @annevk @martinthomson WDYT?
Preview | Diff