Esempio n. 1
0
 def get_response(self, event, body):
     if isinstance(body, dict):
         body = json.dumps(body)
     signature = handlers.make_signature(body)
     return app.post('/webhook', body,
         {'X-Github-Event': event,
          'X-Hub-Signature': signature})
Esempio n. 2
0
 def get_response(self, event, body):
     if isinstance(body, dict):
         body = json.dumps(body)
     signature = handlers.make_signature(body)
     return app.post('/webhook', body, {
         'X-Github-Event': event,
         'X-Hub-Signature': signature
     })
Esempio n. 3
0
 def test_webhook_bad_sig(self):
     body = json.dumps({'action': 'blah'})
     signature = handlers.make_signature(body + 'foo')
     app.post('/webhook',
              body, {
                  'X-Github-Event': 'test',
                  'X-Hub-Signature': signature
              },
              status=400)
Esempio n. 4
0
 def get_response(self, event, body):
     if isinstance(body, dict):
         body = json.dumps(body)
     signature = handlers.make_signature(body)
     resp = app.post('/webhook', body,
         {'X-Github-Event': event,
          'X-Hub-Signature': signature})
     for task in self.taskqueue.get_filtered_tasks():
         deferred.run(task.payload)
     return resp
Esempio n. 5
0
 def get(self):
     """Receives the warmup request."""
     self.response.headers['Content-Type'] = 'text/plain'
     handlers.make_signature('load the secret!')
     self.response.write('Warmup successful')
Esempio n. 6
0
 def test_webhook_bad_sig(self):
     body = json.dumps({'action': 'blah'})
     signature = handlers.make_signature(body + 'foo')
     app.post('/webhook', body,
         {'X-Github-Event': 'test',
          'X-Hub-Signature': signature}, status=400)