Module: Datadog::AppSec::Contrib::Sinatra::Patcher
- Includes:
- Patcher
- Defined in:
- lib/datadog/appsec/contrib/sinatra/patcher.rb
Overview
Patcher for AppSec on Sinatra
Class Method Summary collapse
- .patch ⇒ Object
- .patch_default_middlewares ⇒ Object
- .patch_dispatch ⇒ Object
- .patch_route ⇒ Object
- .patched? ⇒ Boolean
- .setup_security ⇒ Object
- .target_version ⇒ Object
Class Method Details
.patch ⇒ Object
138 139 140 141 142 143 144 145 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 138 def patch Gateway::Watcher.watch patch_default_middlewares patch_dispatch patch_route setup_security Patcher.instance_variable_set(:@patched, true) end |
.patch_default_middlewares ⇒ Object
151 152 153 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 151 def patch_default_middlewares ::Sinatra::Base.singleton_class.prepend(DefaultMiddlewarePatch) end |
.patch_dispatch ⇒ Object
155 156 157 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 155 def patch_dispatch ::Sinatra::Base.prepend(DispatchPatch) end |
.patch_route ⇒ Object
159 160 161 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 159 def patch_route ::Sinatra::Base.prepend(RoutePatch) end |
.patched? ⇒ Boolean
130 131 132 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 130 def patched? Patcher.instance_variable_get(:@patched) end |
.setup_security ⇒ Object
147 148 149 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 147 def setup_security ::Sinatra::Base.singleton_class.prepend(AppSecSetupPatch) end |
.target_version ⇒ Object
134 135 136 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 134 def target_version Integration.version end |