-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Introduce SameOrigin and SameAgentCluster for [Serializable] #4940
Conversation
As introduced by whatwg/html#4940.
(I don't understand how both commits passed Travis whereas for the first commit PR Preview pointed out that there was an xref problem the second commit addresses.) |
A better design might be allowing either SameOrigin or SameOriginAndAgentCluster as that's the end goal. I.e., we don't really want folks setting SameAgentCluster as proposed without also setting SameOrigin. That would require @dtapuska weighing in and allowing some more time for objections though, as it'd immediately affect |
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.
Great stuff.
A better design might be allowing either SameOrigin or SameOriginAndAgentCluster as that's the end goal. I.e., we don't really want folks setting SameAgentCluster as proposed without also setting SameOrigin.
Right. Maybe we should land this with a warning and issue link, stating that we are actively investigating removing just-SameOrigin, and specs should strongly consider using only =(SameOrigin,SameAgentCluster)
or =SameOrigin
.
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.
Another thing I realized we do not handle is inheritance. The spec text says
Platform objects can be serializable objects if they implement only interfaces decorated with the [Serializable] IDL extended attribute
kind of implying that you should put it on everything in the inheritance chain, but we don't handle that really. And if we were to handle it we'd need to handle it for the SameOrigin/SameAgentCluster things as well.
My proposal is that we:
- Change the above sentence to talk about the primary interface.
- Check the primary interface in the processing model (for SameOrigin/SameAgentCluster, and also we could fix the current text which says "the appropriate serialization steps" to say "value's primary interface's serialization steps").
- Add a restriction that [Serializable] that it not be used on interfaces that inherit.
- Add a note saying that we could allow that in the future so let us know if you have a use case.
Also a lot of this applies to [Transferable] too.
Because all of this has the feeling of uncovering tech debt, I'll do a pull request for most of it separately, which this can then be based on.
e2ebf7a
to
9356e66
Compare
I wonder if @tabatkins thought about exporting syntax for this meanwhile, but we could also export this later. |
So going through the WebRTC use case again it seems that SameOrigin might not be adequate. In particular, partly due to document.domain / agent cluster key, replacing their setup with SameOrigin would mean two changes:
cc @jan-ivar |
I'm confused, why does SameOrigin give same-site + same-scheme, not same-origin? Should we rename it? |
I'm not sure I quite understand what's being discussed here. If you'd like something in Bikeshed, mind opening an issue on me explaining it in a little more detail? |
@domenic for serialization and deserialization it is same-origin, but due to @tabatkins I filed speced/bikeshed#1544. |
I think we may want to add a note or example explaining that limitation in some detail. (Assuming this ends up being something we want to merge.) I'm happy to help draft that if you'd prefer. But for now I'll wait until we have a clearer signal that this would be used by other specs. |
I've updated the note. Here's how I see this go down:
Pushing for 2 and 3 might be harder if the infrastructure is not formalized, but perhaps workable if it's essentially guaranteed to land if the experiments work out. |
I'm convinced this kind of fake restriction isn't worth it. Change agent cluster keying or bust. |
Useful for WebAssembly.Module and RTCCertificate. SharedArrayBuffer can reuse the underlying infrastructure.
Fixes #4939. Helps with #4920.
/structured-data.html ( diff )