feat: add token support for client manager
Fixes https://github.com/sideshow/apns2/issues/98
Description
This PR adds support for JWT token based clients to the client manager.
We are using apns2 to send Push Notifications to different applications (multiple team ids, multiple APNS keys, etc).
We have been using this PR from @bdandy in production for months without any issue:
https://github.com/sideshow/apns2/pull/160
But we need to upgrade apns2 to the latest version in order to fix a known CVE in github.com/dgrijalva/jwt-go.
This PR ports https://github.com/sideshow/apns2/pull/160 on master and adds tests.
More info
Using a client manager for token based clients is important in order to reuse connections as much as possible.
Also, Apple documentation clearly states:
APNs does not support authentication tokens from multiple developer accounts over a single connection.
For now, we use the token as the cache key, but we might want to test using the Team ID in order to respect what is recommanded by Apple.
Any plan to merge this one @sideshow ? 🙏
may I ask why this pr has not been merged? Does the token mode require client management?
Any update to merge this PR @sideshow ?