-
Notifications
You must be signed in to change notification settings - Fork 41
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
Provide support for subscription association #182
Conversation
ensure that it describes a valid point on the P-256 curve). If the | ||
<code><a>applicationServerKey</a></code> value is invalid, reject <var>promise</var> with | ||
an <code><a href= | ||
"http://heycam.github.io/webidl/#invalidaccesserror">InvalidAccessError</a></code> and |
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.
nit: https
LGTM I prefer using a BufferSource because (a) the UA generally won't have to do anything with the key, and (b) there is no ubiquitous support for uncompressed EC points across Web Crypto implementations. I'm guessing that the common case will become something like: const APPLICATION_SERVER_KEY = new Uint8Array([
0x04, 0x00, 0x00, 0x00, ...
]); Which is much more developer friendly than loading a CryptoKey object (which, in Chrome, requires converting to a JWK object prior to importing :-/). Thank you! :) |
One question that came to mind - developers tend to call subscribe() multiple times, also as a means to get an existing subscription, since the API only supports once. What happens when calling subscribe() with an |
Ahh, good point. I'll add a commit for that. Another question that occurs, similar to the above, do we want the value to be available for inspection? That seems relatively harmless, but it means that it will be serialized, which I'm not sure about. |
How would we confirm that the Regarding exposing it again - it could be added to I could live with not exposing it for a v1 as well, but I suspect that we'll get use-cases for it pretty quickly (e.g. "do I have to cycle my subscription"). |
There's an alternative design that this suggests: subscribe with different options creates a new subscription. I think that exposing the options would be good. We can probably exclude them from the serializer. I'll open an issue to track both the change in options (throw an error) and the exposing of the current options. Might as well incrementally improve, and allow you time to work out how to expose stuff. |
I think that this is better than #180 on balance. It's a little simpler.