Bug 1518435 [wpt PR 14747] - SignedExchange: Verify if the response is cacheable by a shared cache, a=testonly
authorKunihiko Sakamoto <ksakamoto@chromium.org>
Thu, 31 Jan 2019 15:46:19 +0000
changeset 457910 6e83379f44072e7bcfe90e7a0be4081e466e5ed0
parent 457909 7a9a6b22b7ba554c9be5fa0634e2a2f955492888
child 457911 b79cff27bb8e0d47f872e7caf96d7a28f0f70988
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1518435, 14747, 919414, 1400422, 621030
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518435 [wpt PR 14747] - SignedExchange: Verify if the response is cacheable by a shared cache, a=testonly Automatic update from web-platform-tests SignedExchange: Verify if the response is cacheable by a shared cache This implements the step 5 of [1]. Signed exchange is not valid if response is not cacheable by a shared cache. [1] https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#cross-origin-trust Bug: 919414 Change-Id: I2ceef3c0e3899ae1b9bbe1e0bb644b601732cbe0 Reviewed-on: https://chromium-review.googlesource.com/c/1400422 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#621030} -- wpt-commits: 64bf9c62a12f55d61f209a329f93b0021964da04 wpt-pr: 14747
testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh
testing/web-platform/tests/signed-exchange/resources/sxg-noncacheable.sxg
testing/web-platform/tests/signed-exchange/resources/sxg-noncacheable.sxg.headers
testing/web-platform/tests/signed-exchange/sxg-noncacheable.tentative.html
--- a/testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh
+++ b/testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh
@@ -143,9 +143,25 @@ gen-signedexchange \
   -certUrl $cert_url_origin/signed-exchange/resources/$certfile.cbor \
   -validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
   -privateKey $keyfile \
   -date 2018-04-01T00:00:00Z \
   -expire 168h \
   -o sxg-inner-url-bom.sxg \
   -miRecordSize 100
 
+# Response has Cache-Control: no-store header.
+gen-signedexchange \
+  -version 1b2 \
+  -uri $inner_url_origin/signed-exchange/resources/inner-url.html \
+  -status 200 \
+  -responseHeader "Cache-Control: no-store" \
+  -content sxg-location.html \
+  -certificate $certfile \
+  -certUrl $cert_url_origin/signed-exchange/resources/$certfile.cbor \
+  -validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
+  -privateKey $keyfile \
+  -date 2018-04-01T00:00:00Z \
+  -expire 168h \
+  -o sxg-noncacheable.sxg \
+  -miRecordSize 100
+
 rm -fr $tmpdir
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..38be1eeb3aa041c267f7dc117314d5cb0a864cf2
GIT binary patch
literal 980
zc$}3|J#Q015H(O?{s0BVktQL@eb}){V*7$(=WNH=NgO+|LqW9Oo4Z^4?)KPSe+AJ{
z&`{FQfCLC6M2Bc1K~0B*5ET3Y3QB}T$z6;QRES+^HM4r}&Ai#=BRe5?lCjtoM~HxD
zR5g)YR<v*@GApT6O6A1%!IWWy9pu}fGT^k&FmRRlJ}|k@T*VQd8$0zl7CUxP2i&X_
zlJxnSQ7>%f?XJ}r4?K~!c71C*=^W(w){Ta^TB!|TZ`=(^Y-7D!sknx*PV)6p4?8MW
z^RzxJ7NOAeE0#CbT7$gkRQC=xl0D|)K?x_?>$*Oll?KQqCK2PP3w`Fl9ZVx-s-t+^
zp2<qY7htn6*Jn&(0~e}CWbUA3`m(Gog#Zjp{9SVh9XW83uqg8s5mNqD`*)KHAK6L(
zo`O4+O|>V*^!cE%x7u%8X4-A-y1i@O!Vx&AI%-=jC*RqGN@=IKKBz6MIz=AM!$bn~
zL^_#Fr?eGK%Stc`NLVwvTS}zTmo@G7qf*8L;ZU<sGMZ0|6NBy5KOO2ln=I@f6uefV
zYj3tIc9$+2%SW{ZW0~%6`B%44jWjnKDk8Y2moi)+(dUJvrd2TwN9PM!j00$&7cdfP
z^f^LT4q_aH-WQg<Qo{&4AV*+E-Lg+*E+~VYDI0uDP2$_tKbwk8mYKV_v0Z2$>=;s{
zycW+1B3xK2Ot=!Yq{hk6%gyGF@oVlmbpnd#IA$aeYw;oRO*&MNX&Qr&RwX=S1Dl)m
zfOGV${%z^wZu#r$^6I@i%KOaicaP3oe{%Hh)$?=5-@d?08)g@!If$5-Bz;Y~8JDD!
zObK5ADFJ07Jh-SuVm8d(bSXxHP(LG?6!*OdIlWRG2G*iP_@RYdw}WsmBZU#?Zy&52
v7Czs*@S;`T|Nh1Ol$p=f&%U|;@cYb%)7y7{z^zN!_^rhgEQDcBoqGETvd2~o
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/signed-exchange/resources/sxg-noncacheable.sxg.headers
@@ -0,0 +1,2 @@
+Content-Type: application/signed-exchange;v=b2
+X-Content-Type-Options: nosniff
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/signed-exchange/sxg-noncacheable.tentative.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<title>Loading SignedHTTPExchange with non-cacheable response must fail</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="./resources/sxg-util.js"></script>
+<body>
+<script>
+promise_test(async (t) => {
+  const sxgUrl = get_host_info().HTTPS_ORIGIN + '/signed-exchange/resources/sxg-noncacheable.sxg';
+  const message = await openSXGInIframeAndWaitForMessage(t, sxgUrl);
+  assert_equals(message.location, innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
+  assert_true(message.is_fallback);
+}, 'Loading SignedHTTPExchange with non-cacheable response must fail');
+
+</script>
+</body>