This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
= AnyWebHook

AnyWebhook (*awh*) is Python/WSGI webhook listener and handler. It simplifies
writing and acting upon incoming webhooks.

Awh splits webhook handling into _validating_ and _executing_. You must register
both validator and executor to handle webhooks. These are simple functions which
accept a request parameter containing incoming request data. Additionaly they
receive a dictionary which is filled with arbitrary data by response manipulator
(a function decorated with `@app.app` decorator). Many validators and executors
(for many different webhooks) can be registered. Any validator returning `True`
marks webhook as correct.

You can also affect application's response by registering a separate function
accepting incoming request and to-be-modified response parameter.

Simple application would look like this:

[[example-app]]
[source,python]
----
import json
import subprocess

from awh import Awh
from awh.operate import require, jsonpath

app = Awh()

@app.validator('foo')
def valid(request, data_dict):
payload = request.get_data(as_text=True)
j = json.loads(payload)

# validate incoming json somehow
require(jsonpath(j, 'password')[0].value == 'secretpass')
require(data_dict.get('foo') == 'bar')
return True


@app.executor('foo')
def execute(request, data_dict):
subprocess.call('deploy-app')


@app.app
def myapp(request, response, data_dict):
response.status_code = 404
data_dict['foo'] == 'bar'
----

For additional examples, see link:tests/apps[tests/apps].

== Deployment

In <<example-app>>, `app` is a WSGI application, which implements its interface
(i.e. a function accepting `environ` and `start_response` parameters). You
should point it to your WSGI server.
Release History

Release History

0.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
awh-0.2.1.tar.gz (12.9 kB) Copy SHA256 Checksum SHA256 Source Feb 8, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting