apple / app-store-server-library-python

MIT License
147 stars 31 forks source link

Fix deprecation cryptography deprecation warning in tests #94

Closed WFT closed 2 months ago

WFT commented 2 months ago

This use of the cryptography package generates a warning, seen below.

/Users/Will/dev/forks/app-store-server-library-python/tests/util.py:22: CryptographyDeprecationWarning: Curve argument must be an instance of an EllipticCurve class. Did you pass a class by mistake? This will be an exception in a future version of cryptography.
  public_key = ec.generate_private_key(ec.SECP256R1).public_key().public_bytes(encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.SubjectPublicKeyInfo).decode()

I noticed this while preparing https://github.com/apple/app-store-server-library-python/pull/93 & thought I'd toss this up as well. It passes the tests on my local machine, now without this warning.