New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add github resource #15
base: master
Are you sure you want to change the base?
Conversation
fc8e89c
to
54011b7
Compare
effbd14
to
5bfe41d
Compare
@mbj would you mind doing an initial TODO and (light) code review on this? |
db22a70
to
acc2cf4
Compare
I think that these both steps are the same. Afaik there is no way to validate correct JSON without parsing it. |
@dkubb I'd suggest to add a dedicated step validating the request content type and returning |
@dkubb Code wise I do not have flags right now. What I wounder is that so many types require to be composed by the IO monad. But thats a library choice by Airship. |
The |
This is handled by the framework. I register the allowed input media types, as well as provide a map of the input media types to handlers. There's a similar mechanism to specify output media types so the ideal representation can be negotiated for the client. |
The idea I had was to see if the request payload was syntactically valid. So if it was valid JSON at all. From there I was going to see if the JSON parsed with aeson into some predefined types; and that the JSON matches the expected schema. It may be that aeson forces me to do both at once, which I guess would be alright provided it fails fast in the presence of syntactic errors. |
AFAIK it allows exactly that. |
@mbj I remember now why I wanted to break syntactic and semantic validation; depending on which fails you want to return a |
AFAIK aeson has an API that allows you to distinguish between a JSON syntax error and a JSON structure mismatch. |
I'll try to look it up. |
a8469a5
to
670c5e9
Compare
4d3206b
to
1b3e27d
Compare
This branch adds a github resource. It will receive all push notifications from github, log them to a database and (in a future PR) trigger a build.
TODO
X-Hub-Signature
(signature) header is validX-Github-Event
(the event type) header is supportedX-Github-Delivery
(request id) as a UUID