Policy container inheritance for service workers#34941
Merged
Merged
Conversation
wpt-pr-bot
approved these changes
Jul 22, 2022
wpt-pr-bot
left a comment
Collaborator
There was a problem hiding this comment.
The review process for this patch is being conducted in the Chromium project.
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-3766681
branch
2 times, most recently
from
July 25, 2022 16:41
4015ba8 to
ef5286d
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-3766681
branch
9 times, most recently
from
August 8, 2022 22:16
a087d27 to
d47ac46
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-3766681
branch
3 times, most recently
from
August 15, 2022 13:17
c17dc0a to
1efe79d
Compare
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-3766681
branch
11 times, most recently
from
August 25, 2022 17:30
4b6f3ae to
050769e
Compare
Project: https://docs.google.com/document/d/1mAuxWRLcmhghtCoapc30nLo0H12XTMZUJWqw079XOR8/edit?hl=en&forcehl=1 This is the part about service worker. Attach a PolicyContainerHost to ServiceWorkerVersion. This PolicyContainerHost is obtained: - for local schemes by cloning the creator’s PolicyContainerHost in ServiceWorkerRegisterJob::StartWorkerForUpdate - for network schemes by parsing the policies from the response headers inside ServiceWorkerNewScriptLoader::OnReceiveResponse (new script) or ServiceWorkerSingleScriptUpdateChecker::OnReceiveResponse (updated script). - for previously loaded script which is stored in the database, we write the policy container policies to db just like the existing service worker data, hence the changes around service worker database and protocol buffer. - The sandbox flags is represented as a int32 instead of a enum because protocol buffer enums can't be or'ed like a flag. - CSP is skipped in this CL because the type is quite complicated and require a lot more work. We don't seem to use the policy container CSP in the renderer anyway. - I added a test to make sure that the encoding and decoding works The policy container is then passed down to renderer and set as the execution context's policy container. This CL also fixes external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.serviceworker.html and external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.serviceworker.html because the passed down policy container contains the correct COEP. Follow-ups: merge CSPs into our policy container. Bug: 1177199 Change-Id: Ie90c02b8dd3e295c5456e7e2ff03685339277d6a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3766681 Commit-Queue: Jonathan Hao <phao@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/main@{#1039661}
chromium-wpt-export-bot
force-pushed
the
chromium-export-cl-3766681
branch
from
August 26, 2022 09:24
050769e to
be0be61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Project: https://docs.google.com/document/d/1mAuxWRLcmhghtCoapc30nLo0H12XTMZUJWqw079XOR8/edit?hl=en&forcehl=1
This is the part about service worker.
Attach a PolicyContainerHost to ServiceWorkerVersion. This
PolicyContainerHost is obtained:
ServiceWorkerRegisterJob::StartWorkerForUpdate
inside ServiceWorkerNewScriptLoader::OnReceiveResponse (new script) or
ServiceWorkerSingleScriptUpdateChecker::OnReceiveResponse (updated
script).
the policy container policies to db just like the existing service
worker data, hence the changes around service worker database and
protocol buffer. - The sandbox flags is represented as a int32 instead
of a enum because protocol buffer enums can't be or'ed like a flag.
require a lot more work. We don't seem to use the policy container CSP
in the renderer anyway.
The policy container is then passed down to renderer and set as the
execution context's policy container.
This CL also fixes
external/wpt/html/cross-origin-embedder-policy/reflection-credentialless.tentative.https.any.serviceworker.html
and
external/wpt/html/cross-origin-embedder-policy/reflection-require-corp.tentative.https.any.serviceworker.html
because the passed down policy container contains the correct COEP.
Follow-ups: merge CSPs into our policy container.
Bug: 1177199
Change-Id: Ie90c02b8dd3e295c5456e7e2ff03685339277d6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3766681
Commit-Queue: Jonathan Hao <phao@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1039661}