The existing `entire-payload` option sends a JSON representation of the
parsed request body. Add a new `raw-request-body` source to send the
raw request body.
Fixes#439
When matching variables in routes, gorilla/mux uses a default pattern of
"[^/]+", thereby prohibiting slashes in variable matching. Override the
default pattern to remove this restriction.
See https://github.com/gorilla/mux/blob/v1.8.0/regexp.go#L50Fixes#421
The payload-hash-* options are imprecisely named. Clarify their function
as HMAC validations by renaming them. The existing options will continue
to work but are deprecated. Log a warning if the old options are used.
All tests, examples, and documentation are updated.
Fixes#289
Detect if leading character in JSON payload is an array bracket. If
found, decode payload into an interface{} and then save the results into
payload["root"]. References to payload values would need to reference
the leading, "virtual" root node (i.e. "root.0.name").
Fixes#215
This commit incorporates some tests into the main TestWebhook framework. New features to TestWebhook:
- Check log output against Regexp
- Add Testing sub-tests
Updates #225
Two issues are addressed in this commit:
1. Instead of only sending the predefined environment arguments, this
commit appends the arguments to the existing OS environment. Fixes#53.
2. If an argument is not found in the payload, allow the command to run
and pass in an empty string as a placeholder. Fixes#54.
Additionally, I replaced `hook.ErrInvalidPayloadSignature` with a new
`SignatureError` type so that we can embed the signature in the error.
There's a lot in this commit.
1. Add `pass-environment-to-command` option that works much like
`pass-arguments-to-command`. You can see an example usage in the
"github" test case.
2. Add a test program called "hookecho" that is used to test the
webhook package instead of relying upon a system `echo` command.
3. Move hooks_test.json to a template so that we can update the path to
hookecho on the fly.
4. Don't return an error at the end of hook.MatchRule.Evaluate(). All
tests succeed for me now.