Module: Datadog::AppSec::Contrib::Devise::Patcher
- Includes:
- Patcher
- Defined in:
- lib/datadog/appsec/contrib/devise/patcher.rb,
lib/datadog/appsec/contrib/devise/patcher/rememberable_patch.rb,
lib/datadog/appsec/contrib/devise/patcher/authenticatable_patch.rb,
lib/datadog/appsec/contrib/devise/patcher/registration_controller_patch.rb
Overview
Patcher for AppSec on Devise
Defined Under Namespace
Modules: AuthenticatablePatch, RegistrationControllerPatch, RememberablePatch
Class Method Summary
collapse
Class Method Details
.patch ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/datadog/appsec/contrib/devise/patcher.rb', line 26
def patch
patch_authenticatable_strategy
patch_rememberable_strategy
patch_registration_controller
Patcher.instance_variable_set(:@patched, true)
end
|
.patch_authenticatable_strategy ⇒ Object
34
35
36
|
# File 'lib/datadog/appsec/contrib/devise/patcher.rb', line 34
def patch_authenticatable_strategy
::Devise::Strategies::Authenticatable.prepend(AuthenticatablePatch)
end
|
.patch_registration_controller ⇒ Object
46
47
48
49
50
|
# File 'lib/datadog/appsec/contrib/devise/patcher.rb', line 46
def patch_registration_controller
::ActiveSupport.on_load(:after_initialize) do
::Devise::RegistrationsController.prepend(RegistrationControllerPatch)
end
end
|
.patch_rememberable_strategy ⇒ Object
38
39
40
41
42
43
44
|
# File 'lib/datadog/appsec/contrib/devise/patcher.rb', line 38
def patch_rememberable_strategy
return unless ::Devise::STRATEGIES.include?(:rememberable)
::Devise::Models::Rememberable ::Devise::Strategies::Rememberable.prepend(RememberablePatch)
end
|
.patched? ⇒ Boolean
18
19
20
|
# File 'lib/datadog/appsec/contrib/devise/patcher.rb', line 18
def patched?
Patcher.instance_variable_get(:@patched)
end
|
.target_version ⇒ Object
22
23
24
|
# File 'lib/datadog/appsec/contrib/devise/patcher.rb', line 22
def target_version
Integration.version
end
|