From ed7b1442ef5d248c6af8e8045f46c8a474cc8f81 Mon Sep 17 00:00:00 2001 From: Weston Schmidt Date: Wed, 27 Feb 2019 11:08:08 -0800 Subject: [PATCH 1/4] Fix issue \#126 so the entire body is used for the signature calculation. --- src/caduceus/outboundSender.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/caduceus/outboundSender.go b/src/caduceus/outboundSender.go index 3e0b6ded..c25f2ba3 100644 --- a/src/caduceus/outboundSender.go +++ b/src/caduceus/outboundSender.go @@ -461,6 +461,7 @@ func (obs *CaduceusOutboundSender) send(secret, acceptType string, msg *wrp.Mess defer obs.workers.Release() payload := msg.Payload + body := payload var payloadReader *bytes.Reader // Use the internal content type unless the accept type is wrp @@ -473,10 +474,9 @@ func (obs *CaduceusOutboundSender) send(secret, acceptType string, msg *wrp.Mess buffer := bytes.NewBuffer([]byte{}) encoder := wrp.NewEncoder(buffer, wrp.Msgpack) encoder.Encode(msg) - payloadReader = bytes.NewReader(buffer.Bytes()) - default: - payloadReader = bytes.NewReader(payload) + body = buffer.Bytes() } + payloadReader = bytes.NewReader(body) req, err := http.NewRequest("POST", obs.id, payloadReader) if nil != err { @@ -505,7 +505,7 @@ func (obs *CaduceusOutboundSender) send(secret, acceptType string, msg *wrp.Mess if "" != secret { s := hmac.New(sha1.New, []byte(secret)) - s.Write(payload) + s.Write(body) sig := fmt.Sprintf("sha1=%s", hex.EncodeToString(s.Sum(nil))) req.Header.Set("X-Webpa-Signature", sig) } From ffb9ee21019574440527b48046d1168d2deea8dd Mon Sep 17 00:00:00 2001 From: Weston Schmidt Date: Wed, 27 Feb 2019 11:22:46 -0800 Subject: [PATCH 2/4] Update the changelog. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df3f31db..c083a599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - +## [0.1.3] - 2019-02-27 +### Changed +- Fix for [issue 126](https://github.com/Comcast/caduceus/issues/126) + ## [0.1.2] - 2019-02-21 ### Added - Fix for delivering events as json or msgpack based events [issue 113](https://github.com/Comcast/caduceus/issues/113) From f96752056943bab70ffccbe9876149e2d739c04e Mon Sep 17 00:00:00 2001 From: Weston Schmidt Date: Wed, 27 Feb 2019 11:24:07 -0800 Subject: [PATCH 3/4] Fix the changelog linkage. --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c083a599..a13cb0a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Initial creation -[Unreleased]: https://github.com/Comcast/caduceus/compare/0.1.2...HEAD +[Unreleased]: https://github.com/Comcast/caduceus/compare/0.1.3...HEAD +[0.1.2]: https://github.com/Comcast/caduceus/compare/0.1.2...0.1.3 [0.1.2]: https://github.com/Comcast/caduceus/compare/0.1.1...0.1.2 [0.1.1]: https://github.com/Comcast/caduceus/compare/0.0.1...0.1.1 [0.0.1]: https://github.com/Comcast/caduceus/compare/0.0.0...0.0.1 From f015489800454fd45821f49e87027d36ca4c232b Mon Sep 17 00:00:00 2001 From: Weston Schmidt Date: Wed, 27 Feb 2019 11:24:56 -0800 Subject: [PATCH 4/4] Fix the changelog linkage. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a13cb0a8..9fee2af3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Initial creation [Unreleased]: https://github.com/Comcast/caduceus/compare/0.1.3...HEAD -[0.1.2]: https://github.com/Comcast/caduceus/compare/0.1.2...0.1.3 +[0.1.3]: https://github.com/Comcast/caduceus/compare/0.1.2...0.1.3 [0.1.2]: https://github.com/Comcast/caduceus/compare/0.1.1...0.1.2 [0.1.1]: https://github.com/Comcast/caduceus/compare/0.0.1...0.1.1 [0.0.1]: https://github.com/Comcast/caduceus/compare/0.0.0...0.0.1