Skip to content
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

feat: add token support for client manager #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lakim
Copy link

@lakim lakim commented Oct 17, 2022

Fixes #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:
#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 #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClientManager for token-based clients?
1 participant