-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | GitHub WebHook Handler -- @package github-webhook-handler @version 0.0.2 module GitHub.WebHook.Handler data Handler m Handler :: Maybe String -> m ByteString -> (ByteString -> m (Maybe ByteString)) -> (Either Error (UUID, Event) -> m ()) -> Handler m -- | Optional key which is used to authenticate the incoming request. hSecretKey :: Handler m -> Maybe String -- | Action which is used to read the request body. hBody :: Handler m -> m ByteString -- | Action which is used to retrieve a particular header from the request. hHeader :: Handler m -> ByteString -> m (Maybe ByteString) -- | Action which is executed once we've processed all the information in -- the request. GitHub includes a unique UUID in each request. hAction :: Handler m -> Either Error (UUID, Event) -> m () data Error -- | The incoming request is not well-formed. If that happens it means -- GitHub screwed something up, or changed the format of the request. InvalidRequest :: Error -- | The request looks valid but we failed to parse the payload. This could -- be because our parsing code is wrong, or because GitHub added a new -- event type which we don't handle yet. ParseError :: !Text -> Error -- | We were expecting a signed request but no signature was included. Such -- requests are rejected beause we don't want to accept requests from -- untrusted sources. UnsignedRequest :: Error -- | A signature was included in the request but it did not match the -- secret key which was providid to the handler. Usually points to a -- configuration error on either end. InvalidSignature :: Error runHandler :: Monad m => Handler m -> m ()