summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrickBrisbin <>2018-12-03 19:06:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-12-03 19:06:00 (GMT)
commit18ba5e737f11b9fec4c03cc795f5ec6eceebd58d (patch)
tree0be2551e14f9d7ff1c6065005f429b3db4dc6f27
parent24bb644ffa1c5426b4446f9ab38ce75941dc7e13 (diff)
version 0.0.3.00.0.3.0
-rw-r--r--CHANGELOG.md15
-rw-r--r--bugsnag-haskell.cabal4
-rw-r--r--src/Network/Bugsnag/BeforeNotify.hs35
-rw-r--r--src/Network/Bugsnag/Settings.hs6
4 files changed, 33 insertions, 27 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f18724..80ce57e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,16 @@
-## [*Unreleased*](https://github.com/pbrisbin/bugsnag-haskell/compare/v0.0.2.1...master)
+## [*Unreleased*](https://github.com/pbrisbin/bugsnag-haskell/compare/v0.0.3.0...master)
None
+## [v0.0.3.0](https://github.com/pbrisbin/bugsnag-haskell/compare/v0.0.2.2...v0.0.3.0)
+
+- Fix sensitive request header redacting
+- Remove `defaultBeforeNotify`
+
+## [v0.0.2.2](https://github.com/pbrisbin/bugsnag-haskell/compare/v0.0.2.1...v0.0.2.2)
+
+Packaging changes only.
+
## [v0.0.2.1](https://github.com/pbrisbin/bugsnag-haskell/compare/v0.0.2.0...v0.0.2.1)
- Set StackFrame as in-project based on the `CodeIndex` when present
@@ -21,6 +30,10 @@ None
## [v0.0.1.3](https://github.com/pbrisbin/bugsnag-haskell/compare/v0.0.1.2...v0.0.1.3)
- Redact sensitive request headers by default [#31](https://github.com/pbrisbin/bugsnag-haskell/issues/31)
+
+ **NOTE**: this wasn't actually working at this point. It is actually fixed in
+ v0.0.3.0.
+
- Deprecate Settings that should be `BeforeNotify` values [#32](https://github.com/pbrisbin/bugsnag-haskell/issues/32)
- `bugsnagShouldNotify` operates after any `BeforeNotify` changes
diff --git a/bugsnag-haskell.cabal b/bugsnag-haskell.cabal
index f2984b9..da8cad6 100644
--- a/bugsnag-haskell.cabal
+++ b/bugsnag-haskell.cabal
@@ -4,10 +4,10 @@ cabal-version: 1.18
--
-- see: https://github.com/sol/hpack
--
--- hash: 9d3efcbebe43626f478362471399c56726138a8e3f993f6bb61dbad0a69bc61e
+-- hash: 5358213d15bc36742a81c0406bbf708c01be7b9579ab67a42049f7e25cd4a77f
name: bugsnag-haskell
-version: 0.0.2.2
+version: 0.0.3.0
synopsis: Bugsnag error reporter for Haskell
description: Please see README.md
category: Web
diff --git a/src/Network/Bugsnag/BeforeNotify.hs b/src/Network/Bugsnag/BeforeNotify.hs
index a44a050..b9f8482 100644
--- a/src/Network/Bugsnag/BeforeNotify.hs
+++ b/src/Network/Bugsnag/BeforeNotify.hs
@@ -2,7 +2,6 @@
module Network.Bugsnag.BeforeNotify
( BeforeNotify
- , defaultBeforeNotify
-- * Modifying the Exception
, updateException
@@ -19,6 +18,7 @@ module Network.Bugsnag.BeforeNotify
, updateEventFromOriginalException
, updateEventFromSession
, updateEventFromWaiRequest
+ , updateEventFromWaiRequestUnredacted
-- * Modifying the Request
, redactRequestHeaders
@@ -50,25 +50,6 @@ import Network.Wai (Request)
type BeforeNotify = BugsnagEvent -> BugsnagEvent
--- | Used as @'bsBeforeNotify'@ the default Settings value
---
--- Redacts the following Request headers:
---
--- - Authorization
--- - Cookie
--- - X-XSRF-TOKEN (CSRF token header used by Yesod)
---
--- N.B. If you override the value on @'BugsnagSettings'@, you probably want to
--- maintain this as well:
---
--- @
--- settings { 'bsBeforeNotify' = 'defaultBeforeNotify' . myBeforeNotify }
--- @
---
-defaultBeforeNotify :: BeforeNotify
-defaultBeforeNotify =
- redactRequestHeaders ["Authorization", "Cookie", "X-XSRF-TOKEN"]
-
-- | Modify just the Exception part of an Event
--
-- This may be used to set more specific information for exception types in
@@ -159,8 +140,22 @@ updateEventFromOriginalException f event = fromMaybe event $ do
pure $ f yourException event
-- | Set the events @'BugsnagEvent'@ and @'BugsnagDevice'@
+--
+-- This function redacts the following Request headers:
+--
+-- - Authorization
+-- - Cookie
+-- - X-XSRF-TOKEN (CSRF token header used by Yesod)
+--
+-- To avoid this, use @'updateEventFromWaiRequestUnredacted'@.
+--
updateEventFromWaiRequest :: Request -> BeforeNotify
updateEventFromWaiRequest wrequest =
+ redactRequestHeaders ["Authorization", "Cookie", "X-XSRF-TOKEN"]
+ . updateEventFromWaiRequestUnredacted wrequest
+
+updateEventFromWaiRequestUnredacted :: Request -> BeforeNotify
+updateEventFromWaiRequestUnredacted wrequest =
let
mdevice = bugsnagDeviceFromWaiRequest wrequest
request = bugsnagRequestFromWaiRequest wrequest
diff --git a/src/Network/Bugsnag/Settings.hs b/src/Network/Bugsnag/Settings.hs
index 1933fb4..5c360aa 100644
--- a/src/Network/Bugsnag/Settings.hs
+++ b/src/Network/Bugsnag/Settings.hs
@@ -51,9 +51,7 @@ data BugsnagSettings = BugsnagSettings
, bsBeforeNotify :: BeforeNotify
-- ^ Modify any events before they are sent
--
- -- For example to attach a user, or set the context. By default, we use
- -- @'redactRequestHeaders'@ to strip some sensitive Headers from the
- -- Request.
+ -- For example to attach a user, or set the context.
--
, bsIgnoreException :: BugsnagException -> Bool
-- ^ Exception filtering
@@ -84,7 +82,7 @@ bugsnagSettings apiKey manager = BugsnagSettings
, bsAppVersion = Nothing
, bsReleaseStage = ProductionReleaseStage
, bsNotifyReleaseStages = [ProductionReleaseStage]
- , bsBeforeNotify = defaultBeforeNotify
+ , bsBeforeNotify = id
, bsIgnoreException = const False
, bsHttpManager = manager
, bsCodeIndex = Nothing