rollbar 3.1.2 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34869f5fb3dc29aafe043984527ff94e183c7d8ddec4ea902560687ada4577aa
4
- data.tar.gz: '08895a2da93303ae28fa0675c13667fc7de9f6926464d6ac360939b9c2655409'
3
+ metadata.gz: 425ed5a051e9393cad69cf84b7d074daf3f2d07a57b28e64946f04254bb60cbe
4
+ data.tar.gz: bcf8046e12ccff28c5dab1e32c40cf5d5fee74a7b02602bc4a4735ff21306480
5
5
  SHA512:
6
- metadata.gz: 0ab65c5cc3f2e0b9ff4355d2cfe58753d9d1cc92a002aa3def7a9ed48ff3d03e3cfe7137b05e0793f1cf1c8cb5a8695a658a5622e1e4b7ad540368fca07a59c6
7
- data.tar.gz: 52f63b3739d2ac883253ff1dc04e1513665febbd900525e02584908f35dd15e8152e2db51a43c64e91dfde3400d6efe025756600d71c72c587475024a4d14250
6
+ metadata.gz: 64480f75431290bd39ba433f6c692ec86c0a727c8f3d4a95998b129786c5d368463e18d0f62ba3b4425a0fd468d612e67be1df0655bd1f72cc3615efeec84ed6
7
+ data.tar.gz: 8dfc0039125069aea04cb466a8de1674ffa16d9325d5fc54c3daea5265d62a2dbb29d227f9d48599c6233152b90ff60f4e015a5dd8a805c31c51222c96fcf3bc
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
11
 
12
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
13
13
 
14
- GEMFILE_RAILS_VERSION = '6.1.1'.freeze
14
+ GEMFILE_RAILS_VERSION = '~> 6.1.3'.freeze
15
15
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
16
16
  gem 'appraisal'
17
17
  gem 'jruby-openssl', :platform => :jruby
@@ -74,6 +74,7 @@ gem 'redis'
74
74
  gem 'resque', '< 2.0.0'
75
75
  gem 'rubocop', '~> 0.93.0', :require => false
76
76
  gem 'rubocop-performance', :require => false
77
+ gem 'secure_headers', '~> 6.3.2', :require => false
77
78
  gem 'sinatra'
78
79
  gem 'webmock', :require => false
79
80
  gemspec
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Rollbar-gem
2
- [![Build Status](https://travis-ci.org/rollbar/rollbar-gem.svg?branch=master)](https://travis-ci.org/rollbar/rollbar-gem/branches)
2
+ ![Build Status](https://github.com/rollbar/rollbar-gem/workflows/Rollbar-gem%20CI/badge.svg?tag=latest)
3
3
  [![Gem Version](https://badge.fury.io/rb/rollbar.svg)](http://badge.fury.io/rb/rollbar)
4
4
  [![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&target-version=latest)](https://dependabot.com/compatibility-score.html?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&new-version=latest)
5
5
 
@@ -1 +1 @@
1
- !function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.19.3/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}i.prototype.loadFull=function(r,e,o,n,t){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=a((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;i<a.length;++i)if("function"==typeof(l=a[i])){l(e);break}}"function"==typeof t&&t(e)}()}})),d.insertBefore(i,s)},i.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<p.length;++f)i.prototype[p[f]]=u(p[f]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var l=new c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var a=e.autoInstrument;return!1!==e.enabled&&(void 0===a||!0===a||"object"==typeof a&&a.network)&&r.addEventListener&&(r.addEventListener("load",l.captureLoad.bind(l)),r.addEventListener("DOMContentLoaded",l.captureDomContentLoaded.bind(l))),r[o]=l,l}))()}},Rollbar:c}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}}},function(r,e,o){"use strict";function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports=function(r,e,o){if(r){var t,a,l="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&n(e,r[a].prototype,o)}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
1
+ !function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.22.0/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}i.prototype.loadFull=function(r,e,o,n,t){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=a((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;i<a.length;++i)if("function"==typeof(l=a[i])){l(e);break}}"function"==typeof t&&t(e)}()}})),d.insertBefore(i,s)},i.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<p.length;++f)i.prototype[p[f]]=u(p[f]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var l=new c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var a=e.autoInstrument;return!1!==e.enabled&&(void 0===a||!0===a||"object"==typeof a&&a.network)&&r.addEventListener&&(r.addEventListener("load",l.captureLoad.bind(l)),r.addEventListener("DOMContentLoaded",l.captureDomContentLoaded.bind(l))),r[o]=l,l}))()}},Rollbar:c}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}}},function(r,e,o){"use strict";function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports=function(r,e,o){if(r){var t,a,l="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&n(e,r[a].prototype,o)}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
@@ -7,7 +7,7 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_
7
7
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
8
8
  gem 'jruby-openssl', :platform => :jruby
9
9
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
10
- gem 'rails', '3.0.20'
10
+ gem 'rails', '~> 3.0.20'
11
11
  gem 'hitimes', '< 1.2.2'
12
12
  gem 'mixlib-shellout', '<= 2.0.0'
13
13
  gem 'net-ssh', '<= 3.1.1'
@@ -30,6 +30,7 @@ platforms :rbx do
30
30
  end
31
31
 
32
32
  gem 'capistrano', :require => false
33
+ gem 'rexml', '<= 3.2.4'
33
34
  gem 'sucker_punch', '~> 2.0'
34
35
  gem 'shoryuken'
35
36
  gem 'codacy-coverage'
@@ -10,7 +10,7 @@ gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
10
10
  gem 'mixlib-shellout', '<= 2.0.0'
11
11
  gem 'net-ssh', '<= 3.1.1'
12
12
  gem 'public_suffix', '<= 2.0.5'
13
- gem 'rails', '3.1.12'
13
+ gem 'rails', '~> 3.1.12'
14
14
  gem 'rspec-rails', '~> 3.4'
15
15
  gem 'rake', '< 11'
16
16
 
@@ -29,6 +29,7 @@ platforms :rbx do
29
29
  end
30
30
 
31
31
  gem 'capistrano', :require => false
32
+ gem 'rexml', '<= 3.2.4'
32
33
  gem 'sucker_punch'
33
34
  gem 'shoryuken'
34
35
  gem 'codacy-coverage'
@@ -9,7 +9,7 @@ gem 'jruby-openssl', :platform => :jruby
9
9
  gem 'mixlib-shellout', '<= 2.0.0'
10
10
  gem 'net-ssh', '<= 3.1.1'
11
11
  gem 'public_suffix', '<= 2.0.5'
12
- gem 'rails', '3.2.22'
12
+ gem 'rails', '~> 3.2.22'
13
13
  gem 'rake'
14
14
  gem 'rspec-rails', '~> 3.4'
15
15
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
@@ -31,6 +31,7 @@ platforms :rbx do
31
31
  end
32
32
 
33
33
  gem 'capistrano', :require => false
34
+ gem 'rexml', '<= 3.2.4'
34
35
  gem 'sucker_punch', '~> 2.0'
35
36
  gem 'shoryuken'
36
37
  gem 'codacy-coverage'
@@ -9,7 +9,7 @@ gem 'jruby-openssl', :platform => :jruby
9
9
  gem 'mixlib-shellout', '<= 2.0.0'
10
10
  gem 'net-ssh', '<= 3.1.1'
11
11
  gem 'public_suffix', '<= 2.0.5'
12
- gem 'rails', '4.0.13'
12
+ gem 'rails', '~> 4.0.13'
13
13
  gem 'rake'
14
14
  gem 'rspec-rails', '~> 3.4'
15
15
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
@@ -9,7 +9,7 @@ gem 'jruby-openssl', :platform => :jruby
9
9
  gem 'mixlib-shellout', '<= 2.0.0'
10
10
  gem 'net-ssh', '<= 3.1.1'
11
11
  gem 'public_suffix', '<= 2.0.5'
12
- gem 'rails', '4.1.12'
12
+ gem 'rails', '~> 4.1.16'
13
13
  gem 'rake'
14
14
  gem 'rspec-rails', '~> 3.4'
15
15
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
@@ -9,7 +9,7 @@ gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
9
9
  gem 'jruby-openssl', :platform => :jruby
10
10
  gem 'net-ssh', '<= 3.1.1'
11
11
  gem 'public_suffix', '<= 2.0.5'
12
- gem 'rails', '4.2.8'
12
+ gem 'rails', '~> 4.2.11'
13
13
  gem 'rake'
14
14
  gem 'rspec-rails', '~> 3.4'
15
15
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
@@ -45,6 +45,7 @@ gem 'generator_spec'
45
45
  gem 'girl_friday', '>= 0.11.1'
46
46
  gem 'redis', '<= 3.3.5'
47
47
  gem 'resque'
48
+ gem 'secure_headers', '~> 6.3.2', :require => false
48
49
 
49
50
  unless is_jruby
50
51
  # JRuby doesn't support fork, which is required for this test helper.
@@ -46,6 +46,7 @@ gem 'generator_spec'
46
46
  gem 'girl_friday', '>= 0.11.1'
47
47
  gem 'redis', '<= 3.3.5'
48
48
  gem 'resque'
49
+ gem 'secure_headers', '~> 6.3.2', :require => false
49
50
 
50
51
  unless is_jruby
51
52
  # JRuby doesn't support fork, which is required for this test helper.
@@ -38,6 +38,7 @@ gem 'generator_spec'
38
38
  gem 'girl_friday', '>= 0.11.1'
39
39
  gem 'redis'
40
40
  gem 'resque'
41
+ gem 'secure_headers', '~> 6.3.2', :require => false
41
42
  gem 'simplecov', '<= 0.17.1'
42
43
 
43
44
  unless is_jruby
@@ -7,7 +7,7 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_
7
7
 
8
8
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
9
9
  gem 'jruby-openssl', :platform => :jruby
10
- gem 'rails', '6.0.2.1'
10
+ gem 'rails', '~> 6.0.2'
11
11
  gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
12
12
 
13
13
  gem 'rspec-rails', '~> 4.0.2'
@@ -35,6 +35,7 @@ gem 'generator_spec'
35
35
  gem 'girl_friday', '>= 0.11.1'
36
36
  gem 'redis'
37
37
  gem 'resque'
38
+ gem 'secure_headers', '~> 6.3.2', :require => false
38
39
  gem 'simplecov'
39
40
 
40
41
  unless is_jruby
@@ -6,7 +6,7 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_
6
6
 
7
7
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
8
8
  gem 'jruby-openssl', :platform => :jruby
9
- gem 'rails', '6.1.1'
9
+ gem 'rails', '~> 6.1.3'
10
10
  gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
11
11
 
12
12
  gem 'rspec-rails', '~> 4.0.2'
@@ -34,6 +34,7 @@ gem 'generator_spec'
34
34
  gem 'girl_friday', '>= 0.11.1'
35
35
  gem 'redis'
36
36
  gem 'resque'
37
+ gem 'secure_headers', '~> 6.3.2', :require => false
37
38
  gem 'simplecov'
38
39
 
39
40
  unless is_jruby
@@ -16,7 +16,9 @@ module Rollbar
16
16
  if result[:success] && (deploy_id = result[:data] && result[:data][:deploy_id])
17
17
  capistrano.set :rollbar_deploy_id, deploy_id
18
18
  else
19
- logger.error 'Unable to report deploy to Rollbar' + (result[:message] ? ': ' + result[:message] : '')
19
+ message = format_message('Unable to report deploy to Rollbar',
20
+ result[:message])
21
+ log_error(logger, message)
20
22
  end
21
23
  end
22
24
  end
@@ -42,7 +44,7 @@ module Rollbar
42
44
  yield
43
45
 
44
46
  rescue StandardError => e
45
- logger.error "Error reporting to Rollbar: #{e.inspect}"
47
+ log_error logger, "Error reporting to Rollbar: #{e.inspect}"
46
48
  end
47
49
 
48
50
  def deploy_update(capistrano, logger, dry_run, opts = {})
@@ -56,7 +58,9 @@ module Rollbar
56
58
  if result[:success]
57
59
  logger.info 'Updated deploy status in Rollbar'
58
60
  else
59
- logger.error 'Unable to update deploy status in Rollbar' + (result[:message] ? ': ' + result[:message] : '')
61
+ message = format_message('Unable to update deploy status in Rollbar',
62
+ result[:message])
63
+ log_error(logger, message)
60
64
  end
61
65
  end
62
66
  end
@@ -117,7 +121,7 @@ module Rollbar
117
121
  if capistrano.fetch(:rollbar_deploy_id)
118
122
  yield
119
123
  else
120
- logger.error 'Failed to update the deploy in Rollbar. No deploy id available.'
124
+ log_error logger, 'Failed to update the deploy in Rollbar. No deploy id available.'
121
125
  end
122
126
  end
123
127
 
@@ -134,6 +138,20 @@ module Rollbar
134
138
  logger.debug result[:request_info]
135
139
  logger.debug result[:response_info] if result[:response_info]
136
140
  end
141
+
142
+ def format_message(*args)
143
+ args.compact.join(': ')
144
+ end
145
+
146
+ def log_error(logger, message)
147
+ # Capistrano 2.x doesn't have the #error method,
148
+ # so we use #important if #error isn't present
149
+ if logger.respond_to?(:error)
150
+ logger.error message
151
+ elsif logger.respond_to?(:important)
152
+ logger.important message
153
+ end
154
+ end
137
155
  end
138
156
  end
139
157
  end
@@ -55,6 +55,7 @@ module Rollbar
55
55
  attr_accessor :uncaught_exception_level
56
56
  attr_accessor :scrub_headers
57
57
  attr_accessor :sidekiq_threshold
58
+ attr_accessor :sidekiq_use_scoped_block
58
59
  attr_reader :transform
59
60
  attr_accessor :verify_ssl_peer
60
61
  attr_accessor :use_async
@@ -139,6 +140,7 @@ module Rollbar
139
140
  @uncaught_exception_level = 'error'
140
141
  @scrub_headers = ['Authorization']
141
142
  @sidekiq_threshold = 0
143
+ @sidekiq_use_scoped_block = false
142
144
  @safely = false
143
145
  @transform = []
144
146
  @use_async = false
@@ -157,8 +157,7 @@ module Rollbar
157
157
  def script_tag(content, env)
158
158
  if (nonce = rails5_nonce(env))
159
159
  script_tag_content = "\n<script type=\"text/javascript\" nonce=\"#{nonce}\">#{content}</script>"
160
- elsif secure_headers_nonce?
161
- nonce = ::SecureHeaders.content_security_policy_script_nonce(::Rack::Request.new(env))
160
+ elsif (nonce = secure_headers_nonce(env))
162
161
  script_tag_content = "\n<script type=\"text/javascript\" nonce=\"#{nonce}\">#{content}</script>"
163
162
  else
164
163
  script_tag_content = "\n<script type=\"text/javascript\">#{content}</script>"
@@ -172,14 +171,18 @@ module Rollbar
172
171
  string
173
172
  end
174
173
 
175
- # Rails 5.2 Secure Content Policy
174
+ # Rails 5.2+ Secure Content Policy
176
175
  def rails5_nonce(env)
177
- # The nonce is the preferred method, however 'unsafe-inline' is also possible.
178
- # The app gets to decide, so we handle both. If the script_src key is missing,
179
- # Rails will not add the nonce to the headers, so we should not add it either.
180
- # If the 'unsafe-inline' value is present, the app should not add a nonce and
181
- # we should ignore it if they do.
182
- req = ::ActionDispatch::Request.new env
176
+ req = ::ActionDispatch::Request.new(env)
177
+
178
+ # Rails will only return a nonce if the app has set a nonce generator.
179
+ # So if we get a valid nonce here, we know we should use it.
180
+ #
181
+ # Having both 'unsafe-inline' and a nonce is a valid and preferred
182
+ # browser compatibility configuration.
183
+ #
184
+ # If the script_src key is missing, Rails will not add the nonce to the headers,
185
+ # so we detect this and will not add it in this case.
183
186
  req.respond_to?(:content_security_policy) &&
184
187
  req.content_security_policy &&
185
188
  req.content_security_policy.directives['script-src'] &&
@@ -187,13 +190,21 @@ module Rollbar
187
190
  end
188
191
 
189
192
  # Secure Headers gem
190
- def secure_headers_nonce?
191
- secure_headers.append_nonce?
193
+ def secure_headers_nonce(env)
194
+ req = ::Rack::Request.new(env)
195
+
196
+ return unless secure_headers(req).append_nonce?
197
+
198
+ ::SecureHeaders.content_security_policy_script_nonce(req)
192
199
  end
193
200
 
194
- def secure_headers
201
+ def secure_headers(req)
195
202
  return SecureHeadersFalse.new unless defined?(::SecureHeaders::Configuration)
196
203
 
204
+ # If the nonce key has been set, the app is using nonces for this request.
205
+ # If it hasn't, we shouldn't cause one to be added to script_src, so return now.
206
+ return SecureHeadersFalse.new unless secure_headers_nonce_key(req)
207
+
197
208
  config = ::SecureHeaders::Configuration
198
209
 
199
210
  secure_headers_cls = nil
@@ -211,6 +222,10 @@ module Rollbar
211
222
  secure_headers_cls.new
212
223
  end
213
224
 
225
+ def secure_headers_nonce_key(req)
226
+ defined?(::SecureHeaders::NONCE_KEY) && req.env[::SecureHeaders::NONCE_KEY]
227
+ end
228
+
214
229
  class SecureHeadersResolver
215
230
  def append_nonce?
216
231
  csp_needs_nonce?(find_csp)
@@ -9,7 +9,7 @@ Rollbar.plugins.define('sidekiq >= 3') do
9
9
 
10
10
  Sidekiq.configure_server do |config|
11
11
  config.server_middleware do |chain|
12
- chain.add Rollbar::Sidekiq::ClearScope
12
+ chain.add Rollbar::Sidekiq::ResetScope
13
13
  end
14
14
 
15
15
  config.error_handlers << proc do |e, context|
@@ -4,21 +4,39 @@ module Rollbar
4
4
  class Sidekiq
5
5
  PARAM_BLACKLIST = %w[backtrace error_backtrace error_message error_class].freeze
6
6
 
7
- class ClearScope
8
- def call(_worker, _msg, _queue)
9
- Rollbar.reset_notifier!
7
+ class ResetScope
8
+ def call(_worker, msg, _queue)
9
+ Rollbar.reset_notifier! # clears scope
10
10
 
11
- yield
11
+ return yield unless Rollbar.configuration.sidekiq_use_scoped_block
12
+
13
+ Rollbar.scoped(Rollbar::Sidekiq.job_scope(msg)) { yield }
12
14
  end
13
15
  end
14
16
 
15
- def self.handle_exception(ctx_hash, e)
16
- job_hash = ctx_hash && (ctx_hash[:job] || ctx_hash)
17
- return if skip_report?(job_hash, e)
17
+ def self.handle_exception(msg, e)
18
+ return if skip_report?(msg, e)
19
+
20
+ Rollbar.scope(job_scope(msg)).error(e, :use_exception_level_filters => true)
21
+ end
22
+
23
+ def self.skip_report?(msg, _e)
24
+ job_hash = job_hash_from_msg(msg)
25
+
26
+ return false if job_hash.nil?
27
+
28
+ # when rollbar middleware catches, sidekiq's retry_job processor hasn't set
29
+ # the retry_count for the current job yet, so adding 1 gives the actual retry count
30
+ actual_retry_count = job_hash.fetch('retry_count', -1) + 1
31
+ job_hash['retry'] && actual_retry_count < ::Rollbar.configuration.sidekiq_threshold
32
+ end
18
33
 
34
+ def self.job_scope(msg)
19
35
  scope = {
20
36
  :framework => "Sidekiq: #{::Sidekiq::VERSION}"
21
37
  }
38
+ job_hash = job_hash_from_msg(msg)
39
+
22
40
  unless job_hash.nil?
23
41
  params = job_hash.reject { |k| PARAM_BLACKLIST.include?(k) }
24
42
  scope[:request] = { :params => scrub_params(params) }
@@ -26,7 +44,7 @@ module Rollbar
26
44
  scope[:queue] = params['queue']
27
45
  end
28
46
 
29
- Rollbar.scope(scope).error(e, :use_exception_level_filters => true)
47
+ scope
30
48
  end
31
49
 
32
50
  def self.scrub_params(params)
@@ -38,22 +56,21 @@ module Rollbar
38
56
  Rollbar::Scrubbers::Params.call(options)
39
57
  end
40
58
 
41
- def self.skip_report?(job_hash, _e)
42
- return false if job_hash.nil?
43
-
44
- # when rollbar middleware catches, sidekiq's retry_job processor hasn't set
45
- # the retry_count for the current job yet, so adding 1 gives the actual retry count
46
- actual_retry_count = job_hash.fetch('retry_count', -1) + 1
47
- job_hash['retry'] && actual_retry_count < ::Rollbar.configuration.sidekiq_threshold
48
- end
49
-
59
+ # see https://github.com/mperham/sidekiq/wiki/Middleware#server-middleware
50
60
  def call(_worker, msg, _queue)
51
- Rollbar.reset_notifier!
61
+ Rollbar.reset_notifier! # clears scope
52
62
 
53
- yield
63
+ return yield unless Rollbar.configuration.sidekiq_use_scoped_block
64
+
65
+ Rollbar.scoped(Rollbar::Sidekiq.job_scope(msg)) { yield }
54
66
  rescue Exception => e
55
67
  Rollbar::Sidekiq.handle_exception(msg, e)
56
68
  raise
57
69
  end
70
+
71
+ def self.job_hash_from_msg(msg)
72
+ msg && (msg[:job] || msg)
73
+ end
74
+ private_class_method :job_hash_from_msg
58
75
  end
59
76
  end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = '3.1.2'.freeze
2
+ VERSION = '3.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rollbar, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-10 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Easy and powerful exception tracking for Ruby
14
14
  email:
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  requirements: []
164
- rubygems_version: 3.2.3
164
+ rubygems_version: 3.1.4
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: Reports exceptions to Rollbar