def test_crack_receipt_new_called(self, trunion_verify, settings): # Check that we can decode our receipt and get a dictionary back. self.app.update(manifest_url='http://a.com') verify.decode_receipt( 'jwt_public_key~' + create_receipt(self.app, self.user, str(uuid.uuid4()))) assert trunion_verify.called
def test_crack_receipt_new_called(self, trunion_verify, settings): # Check that we can decode our receipt and get a dictionary back. self.app.update(type=amo.ADDON_WEBAPP, manifest_url='http://a.com') verify.decode_receipt( 'jwt_public_key~' + create_receipt( self.app, self.user, str(uuid.uuid4()))) assert trunion_verify.called
def test_crack_receipt(self): # Check that we can decode our receipt and get a dictionary back. self.app.update(manifest_url="http://a.com") purchase = self.make_purchase() receipt = create_receipt(purchase.webapp, purchase.user, purchase.uuid) result = verify.decode_receipt(receipt) eq_(result["typ"], u"purchase-receipt")
def test_crack_receipt(self): # Check that we can decode our receipt and get a dictionary back. self.addon.update(type=amo.ADDON_WEBAPP, manifest_url='http://a.com') purchase = self.make_purchase() receipt = create_receipt(purchase.addon, purchase.user, purchase.uuid) result = verify.decode_receipt(receipt) eq_(result['typ'], u'purchase-receipt')
def test_verify(request, status): try: result = decode_receipt(request.body) # TODO: insert type and url checks here. if result: return {'status': status} except: log.error('Decoding test receipt', exc_info=True) return {'status': 'invalid'}
def test_issue_expired(self): data = {'receipt_type': 'expired', 'manifest_url': 'http://foo.com/'} res = self.client.post(self.issue, data=data) data = decode_receipt(json.loads(res.content)['receipt'] .encode('ascii')) eq_(data['verify'], absolutify(reverse('receipt.test.verify', kwargs={'status': 'expired'}))) ok_(data['exp'] > (calendar.timegm(time.gmtime()) + (60 * 60 * 24) - TEST_LEEWAY))
def test_expired_cert(self, mthd): mthd.side_effect = ExpiredSignatureError assert "typ" in verify.decode_receipt(".~" + sample)
def test_crack_receipt(self): # Check that we can decode our receipt and get a dictionary back. self.addon.update(type=amo.ADDON_WEBAPP, manifest_url='http://a.com') receipt = self.make_install().receipt result = verify.decode_receipt(receipt) eq_(result['typ'], u'purchase-receipt')
def test_crack_receipt_new_called(self, trunion_verify, settings): # Check that we can decode our receipt and get a dictionary back. self.addon.update(type=amo.ADDON_WEBAPP, manifest_url='http://a.com') verify.decode_receipt('.~' + sample) assert trunion_verify.called
def test_crack_receipt(self): # Check that we can decode our receipt and get a dictionary back. self.addon.update(type=amo.ADDON_WEBAPP, manifest_url="http://a.com") receipt = create_receipt(self.make_install().pk) result = verify.decode_receipt(receipt) eq_(result["typ"], u"purchase-receipt")
def test_expired_cert(self, mthd): mthd.side_effect = ExpiredSignatureError assert 'typ' in verify.decode_receipt('.~' + sample)
def test_expired_cert(self, mthd): mthd.side_effect = ExpiredSignatureError assert 'typ' in verify.decode_receipt( 'jwt_public_key~' + create_receipt(self.app, self.user, str(uuid.uuid4())))
def test_expired_cert(self, mthd): mthd.side_effect = ExpiredSignatureError assert 'typ' in verify.decode_receipt( 'jwt_public_key~' + create_receipt( self.app, self.user, str(uuid.uuid4())))
def test_issue_expired(self): data = {"receipt_type": "expired", "manifest_url": "http://foo.com/"} res = self.client.post(self.issue, data=data) data = decode_receipt(json.loads(res.content)["receipt"].encode("ascii")) eq_(data["verify"], absolutify(reverse("receipt.test.verify", kwargs={"status": "expired"}))) ok_(data["exp"] > (calendar.timegm(time.gmtime()) + (60 * 60 * 24) - TEST_LEEWAY))
def test_crack_receipt_new_called(self, trunion_verify, settings): # Check that we can decode our receipt and get a dictionary back. self.app.update(manifest_url="http://a.com") verify.decode_receipt("jwt_public_key~" + create_receipt(self.app, self.user, str(uuid.uuid4()))) assert trunion_verify.called