youknowone / itunes-iap

Apple iTunes In-app purchase verification tool
http://itunes-iap.readthedocs.io
Other
136 stars 50 forks source link

Allow providing an override env in Request.verify #35

Closed mmeisinger closed 7 years ago

mmeisinger commented 7 years ago

Enable specifying an explicit override environment "env" in the Request.verify() and call in order to avoid a pop from the environment stack. This makes cases with thread concurrency deterministic and avoids the Environment.current() stack access.

Example:

import itunesiap
response = itunesiap.verify(receipt, apple_shared_secret, env=itunesiap.env.production)
codecov-io commented 7 years ago

Codecov Report

Merging #35 into master will increase coverage by 0.07%.

@@            Coverage Diff             @@
##           master      #35      +/-   ##
==========================================
+ Coverage    89.3%   89.36%   +0.07%     
==========================================
  Files           8        8              
  Lines         327      329       +2     
==========================================
+ Hits          292      294       +2     
  Misses         35       35

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 81f31e7...910ec00. Read the comment docs.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.07%) to 89.362% when pulling 910ec006096706069c3dd7257ed8d59df4c68793 on mmeisinger:override_env into 81f31e7d4fdd19cba5e10d6aa02c8053f1ace67f on youknowone:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.07%) to 89.362% when pulling 910ec006096706069c3dd7257ed8d59df4c68793 on mmeisinger:override_env into 81f31e7d4fdd19cba5e10d6aa02c8053f1ace67f on youknowone:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.07%) to 89.362% when pulling 910ec006096706069c3dd7257ed8d59df4c68793 on mmeisinger:override_env into 81f31e7d4fdd19cba5e10d6aa02c8053f1ace67f on youknowone:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.07%) to 89.362% when pulling 910ec006096706069c3dd7257ed8d59df4c68793 on mmeisinger:override_env into 81f31e7d4fdd19cba5e10d6aa02c8053f1ace67f on youknowone:master.

youknowone commented 7 years ago

Thanks, this is a nice fix for the mis-designed env api.

youknowone commented 7 years ago

The global environment stack is deprecated now. Now this is the major way to run itunesiap.