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
140 141 142 143 144 145 146 147 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 140 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
153 154 155 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 153 def patch_default_middlewares ::Sinatra::Base.singleton_class.prepend(DefaultMiddlewarePatch) end |
.patch_dispatch ⇒ Object
157 158 159 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 157 def patch_dispatch ::Sinatra::Base.prepend(DispatchPatch) end |
.patch_route ⇒ Object
161 162 163 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 161 def patch_route ::Sinatra::Base.prepend(RoutePatch) end |
.patched? ⇒ Boolean
132 133 134 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 132 def patched? Patcher.instance_variable_get(:@patched) end |
.setup_security ⇒ Object
149 150 151 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 149 def setup_security ::Sinatra::Base.singleton_class.prepend(AppSecSetupPatch) end |
.target_version ⇒ Object
136 137 138 |
# File 'lib/datadog/appsec/contrib/sinatra/patcher.rb', line 136 def target_version Integration.version end |