Closed shigmas closed 7 years ago
Am I off base? Is this a useless thing to support?
No, it's not. I had plans for adding support for tokens authentication but did not find some time for it. Thanks for your contribution, it's merged in ae835a195f5ed06004604503ecaf11d20cce6128
Cool. Thanks!
This would make supporting multiple applications easier.
If it's alright, I'd like to add this. I don't know if it's overarchitecting, but I was thinking of replacing the cert_file parameter in APNsClient's init with a new Credentials class instance. There would be two subclasses: the CertificateCredentials and TokenCredentials. (Since tokens are meant to be reused (currently, for up to an hour), clients could come and go, as long as someone is holding on to the credentials instance.) Both classes would implement get_connection and get_authentication_header methods.
We could keep the old API too, and create the credential class if that parameter is a string: