-
Notifications
You must be signed in to change notification settings - Fork 339
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
Add Apple JWT Token based authentication #43
Conversation
Nice! I think the changes are simple and easy to understand! The API hasn't changed significantly either, a new method to get a client based on Token is as simple as it can get. I can look into helping out with the tests, however, it does depend on how much time I get :( |
@sideshow Any idea when this will be merged in? |
Within the next week hopefully! Just adding some tests. |
Do you have some news about tests? 😀 |
54be2cd
to
d680462
Compare
40fc7ef
to
7f17f3a
Compare
@sideshow Tests look 👌 I expect this will be merged soon, then? If you want a final review or would like me to look at anything in particular, I'm happy to help! |
Thanks @vivangkumar Yeah it's close. Two things i would appreciate help with;
And of course anything else i've missed :) |
You also can change to catch the 403 from apple and add the autogenerator to update token before expiration. So it will call token.Generate on each time.Tick |
We have been running in production for a year and a half using the legacy apns against multiple app targets. Not high volume but high variability. We already use dgrijalva/jwt-go for other authentication purposes. We most eagerly await your release of token based authentication. We are willing to be production test agents for you. |
I have run into the same issue as @nathany did in his buford library golang/go#13774 We need to find a decent enough workaround to this issue golang/go#13774 before I can merge this. The problem is that Apple for some reason send a The problem is that if you send a second push notification (which opens another stream) before they have adjusted the setting, it will result in errors. And unfortunately because the http2 transport doesn't yet respect the I have tested this on the development and production APNs gateways and the same happens for both. |
hey, just checking, what is the status of this pull request? |
@ddimitrov90 We are blocked on not having access to the number of allowed concurrent streams sent from Apple. That's going to require some work on Go's x/net/http2 library, which will first require learning how it works. So it's a ways off 😦
The reason is to do with authentication:
It makes sense, it's just makes the API somewhat difficult to work with. |
7f17f3a
to
b2315eb
Compare
@sideshow My pardon, but code that works for most cases until it's not – it sounds very dangerous for me. Personally, I think the merge of this code is a trap for newcomers and their production environments. |
So, this has been merged and is now part of the master branch golang/net@1c05540. @sideshow, how does that affect this ticket? |
@sideshow any updates here? |
@nordicdyno I agree with you, it would be a trap and would be painful to explain. Decided against it in the end. @luismfonseca @felipejfc - Cool good to see progress. I'm not sure if this gets us all the way there but will try it out later this week to determine exactly what we need to do. |
@luismfonseca @felipejfc |
@sideshow why you don't merge master with the Key Auth ?! |
Any update on this? Thanks! |
f26d6f5
to
2cf793a
Compare
2cf793a
to
3afa5a2
Compare
Finally merged!! Have tested this on production and development gateways and it no longer returns errors as it was before. cc/ @vivangkumar @xjewer @ddimitrov90 @nordicdyno @luismfonseca @felipejfc @ehsannm @Xzya |
Awesome @sideshow! Thanks! |
💃 |
FYI https://go-review.googlesource.com/c/net/+/151857/ "http2: revert Transport's strict interpretation of MAX_CONCURRENT_STREAMS" |
Work in progress for the purpose of gathering feedback on the API