Closed wibblymat closed 6 years ago
Reviewed.
Forgot to ask: tests?
Has this been tested? Does this implementation work with chrome? I also added support for VAPID on top of this library, but it is only working in firefox. On chrome, FCM is sending back a 400 "UnauthorizedRegistration" error.
I've just tested this with Firefox 50.0.2 and Chrome 55.0.2883.75, it works fine!
Will this be merged someday? Is this library defunct because of the raise of the web-push Node.JS lib?
@davinche:
You get an UnauthorizedRegistration
400 response if the manifest contains a gcm_sender_id
key for Chrome and I use applicationServerKey
when subscribing and NewVapidRequest()
from this pull request.
I guess this comes from the fact that an Authorization: key=XYZ
is expected when using a GCM SenderID and this header is used with a JWT when using VAPID. That and the end-point that does not mention the subscription id.
@ofavre The UnauthorizedRegistration error I was getting was actually caused by the JWT Header serialization. More details can be found in my reply to this stackoverflow post: http://stackoverflow.com/questions/39336523/webpushvapid-request-fails-with-400-unauthorizedregistration
The gist of it all is that json/encoding libary in Go produced a marshalled JWT header that is different than what chrome expected. Apparently order of the fields mattered ¯_(ツ)_/¯. I think this is a bug in chrome.
This PR avoids it all by including a static string: https://github.com/GoogleChrome/push-encryption-go/blob/d00644ee80b2c526918c0a6a88c63d4206fccb0a/webpush/vapid.go#L31
Any update on this?
@avinassh I have been waiting for the vapid support too. In the meantime, this library has been helping me out.
@gauntface I'll take this PR and apply all suggestions. Will ping for a review.
@x1ddos thank you Alex. I'll get to work on a PR for integration tests (expect awful Go)
@avinassh @anaskhan96 apologies for the delay on all of this. I've inherited the project and once we have tests and VAPID set up I'll be moving this over to web-push-libs org so it can get wider community eyes and support.
Hi any updates on this? Thanks,
I would recommend using: https://github.com/SherClockHolmes/webpush-go
This module had a number of quirks / issues that feels wasted to develop this module when the other seems further ahead in it's implementation
Going to deprecate this project in favor of https://github.com/SherClockHolmes/webpush-go
I was surprised to find the other day that we never resolved the VAPID PR (#11).
Since the comment thread had stalled, I've put together this smaller counter-proposal that is hopefully less controversial.
@costinm @crhym3 @gauntface