def _postWithNewSignature(self, data, key=None): ts, message, sig = self._makeMessage(data, key) resp = self.client.post(reverse('sentry-api-store'), message, content_type='application/octet-stream', HTTP_X_SENTRY_AUTH=get_auth_header(sig, ts, '_postWithSignature', key), ) return resp
def test_success(self): data = { 'message': 'hello', 'server_name': 'not_dcramer.local', 'level': 40, 'site': 'not_a_real_site' } ts, message, sig = self._makeMessage(data) packet = get_auth_header(sig, ts, 'udpTest') + '\n\n' + message self.assertEquals(None, self.server.handle(packet, self.address))
def _postWithHeader(self, data, key=None, secret=None): if key is None: key = self.projectkey.public_key secret = self.projectkey.secret_key message = self._makeMessage(data) resp = self.client.post(reverse('sentry-api-store'), message, content_type='application/octet-stream', HTTP_X_SENTRY_AUTH=get_auth_header('_postWithHeader', key, secret), ) return resp
def test_success(self): data = {'message': 'hello', 'server_name': 'not_dcramer.local', 'level': 40, 'site': 'not_a_real_site'} ts, message, sig = self._makeMessage(data) packet = get_auth_header(sig, ts, 'udpTest') + '\n\n' + message self.assertEquals(None, self.server.handle(packet, self.address))
def test_success(self): data = {'message': 'hello', 'server_name': 'not_dcramer.local', 'level': 40, 'site': 'not_a_real_site'} message = self._makeMessage(data) header = get_auth_header('udpTest', api_key=self.pk.public_key, secret_key=self.pk.secret_key) packet = header + '\n\n' + message self.assertEquals(None, self.server.handle(packet, self.address))