Open cat-bro opened 5 years ago
@Fatal1ty just wondering are there any plans to get it done?
I'll try my best to implement this soon. If you want this done asap, pull requests are welcome.
Please add option to pass APNs certificate(containing private key) as bytes instead of file path.
This would be nice to have. I have implemented something like the following in my own project, but it's not ideal:
import tempfile
from aioapns import APNs
keyfile = tempfile.NamedTemporaryFile()
keyfile.write(b"APNS_KEY")
keyfile.seek(0)
client = APNs(
key=keyfile.name,
# ...other config
)
keyfile.close()
Would be possible in future versions to allow the private key (
key
argument to APNs) to be a string instead of a file path, or to have a separate argument (e.g.key_string
) for this purpose?The use case for this is an application that keeps all of its private keys in an encrypted file in an external package. We don't want to keep a file containing the private key in the code base, or write temp files.