bugsnag-haskell 0.0.2.2 → 0.0.3.0
raw patch · 4 files changed
+33/−27 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Network.Bugsnag.BeforeNotify: defaultBeforeNotify :: BeforeNotify
+ Network.Bugsnag.BeforeNotify: updateEventFromWaiRequestUnredacted :: Request -> BeforeNotify
Files
- CHANGELOG.md +14/−1
- bugsnag-haskell.cabal +2/−2
- src/Network/Bugsnag/BeforeNotify.hs +15/−20
- src/Network/Bugsnag/Settings.hs +2/−4
CHANGELOG.md view
@@ -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 @@ ## [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
bugsnag-haskell.cabal view
@@ -4,10 +4,10 @@ -- -- 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
src/Network/Bugsnag/BeforeNotify.hs view
@@ -2,7 +2,6 @@ module Network.Bugsnag.BeforeNotify ( BeforeNotify- , defaultBeforeNotify -- * Modifying the Exception , updateException@@ -19,6 +18,7 @@ , updateEventFromOriginalException , updateEventFromSession , updateEventFromWaiRequest+ , updateEventFromWaiRequestUnredacted -- * Modifying the Request , redactRequestHeaders@@ -50,25 +50,6 @@ 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 @@ 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
src/Network/Bugsnag/Settings.hs view
@@ -51,9 +51,7 @@ , 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 @@ , bsAppVersion = Nothing , bsReleaseStage = ProductionReleaseStage , bsNotifyReleaseStages = [ProductionReleaseStage]- , bsBeforeNotify = defaultBeforeNotify+ , bsBeforeNotify = id , bsIgnoreException = const False , bsHttpManager = manager , bsCodeIndex = Nothing