PyAPNs2 icon indicating copy to clipboard operation
PyAPNs2 copied to clipboard

Add option to pass Auth Key as base64 string

Open dunkmann00 opened this issue 3 years ago • 0 comments

Pass the base64 encoded Auth Key string to TokenCredentials rather than the file path. This can be useful when the Auth Key is not stored in a file for security reasons.

This also adds a test to ensure that passing in a base64 encoded string is equivalent to passing it in as a file.

I found this option necessary when I wanted to use PyAPNs2 on Heroku. I didn't want to check in the .p8 Auth Key file because the repo I use is also public on Github. A solution would be to encode the file as base64 and then store it as an environment variable in Heroku. This would provide access to the Auth Key while not needing to include it in the repo.

dunkmann00 avatar May 09 '22 22:05 dunkmann00