Class: Wallaby::Configuration::Security Deprecated
- Inherits:
-
Object
- Object
- Wallaby::Configuration::Security
- Defined in:
- lib/wallaby/configuration/security.rb
Overview
Deprecated.
Constant Summary collapse
- DEFAULT_CURRENT_USER =
Default block to return nil for current user
-> {}
- DEFAULT_AUTHENTICATE =
Default block to return nil
-> { true }
Instance Method Summary collapse
- #authenticate ⇒ Object deprecated Deprecated.
- #authenticate? ⇒ Boolean deprecated Deprecated.
- #current_user ⇒ Object deprecated Deprecated.
- #current_user? ⇒ Boolean deprecated Deprecated.
- #email_method ⇒ Object deprecated Deprecated.
- #email_method=(_email_method) ⇒ Object deprecated Deprecated.
- #logout_method ⇒ Object deprecated Deprecated.
- #logout_method=(_logout_method) ⇒ Object deprecated Deprecated.
- #logout_path ⇒ Object deprecated Deprecated.
- #logout_path=(_logout_path) ⇒ Object deprecated Deprecated.
Instance Method Details
#authenticate ⇒ Object
Deprecated.
87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/wallaby/configuration/security.rb', line 87 def authenticate Deprecator.alert 'config.security.authenticate', from: '0.3.0', alternative: <<~INSTRUCTION Please change #authenticate_wallaby_user! from the controller instead, for example: class Admin::ApplicationController < Wallaby::ResourcesController def authenticate_wallaby_user! authenticate_or_request_with_http_basic do |username, password| username == 'too_simple' && password == 'too_naive' end end end INSTRUCTION end |
#authenticate? ⇒ Boolean
Deprecated.
102 103 104 105 106 |
# File 'lib/wallaby/configuration/security.rb', line 102 def authenticate? Deprecator.alert 'config.security.authenicate?', from: '0.3.0', alternative: <<~INSTRUCTION Please use controller#authenticate_wallaby_user! instead. INSTRUCTION end |
#current_user ⇒ Object
Deprecated.
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/wallaby/configuration/security.rb', line 67 def current_user Deprecator.alert 'config.security.current_user', from: '0.3.0', alternative: <<~INSTRUCTION Please change #wallaby_user from the controller instead, for example: class Admin::ApplicationController < Wallaby::ResourcesController def wallaby_user User.find_by_email session[:user_email] end end INSTRUCTION end |
#current_user? ⇒ Boolean
Deprecated.
80 81 82 83 84 |
# File 'lib/wallaby/configuration/security.rb', line 80 def current_user? Deprecator.alert 'config.security.current_user?', from: '0.3.0', alternative: <<~INSTRUCTION Please use controller#wallaby_user instead. INSTRUCTION end |
#email_method ⇒ Object
Deprecated.
49 50 51 52 53 |
# File 'lib/wallaby/configuration/security.rb', line 49 def email_method Deprecator.alert 'config.security.email_method', from: '0.3.0', alternative: <<~INSTRUCTION Please use controller_class.email_method instead. INSTRUCTION end |
#email_method=(_email_method) ⇒ Object
Deprecated.
56 57 58 59 60 61 62 63 64 |
# File 'lib/wallaby/configuration/security.rb', line 56 def email_method=(_email_method) Deprecator.alert 'config.security.email_method=', from: '0.3.0', alternative: <<~INSTRUCTION Please use #email_method= from the controller instead, for example: class Admin::ApplicationController < Wallaby::ResourcesController self.email_method = 'email_address' end INSTRUCTION end |
#logout_method ⇒ Object
Deprecated.
31 32 33 34 35 |
# File 'lib/wallaby/configuration/security.rb', line 31 def logout_method Deprecator.alert 'config.security.logout_method', from: '0.3.0', alternative: <<~INSTRUCTION Please use controller_class.logout_method instead. INSTRUCTION end |
#logout_method=(_logout_method) ⇒ Object
Deprecated.
38 39 40 41 42 43 44 45 46 |
# File 'lib/wallaby/configuration/security.rb', line 38 def logout_method=(_logout_method) Deprecator.alert 'config.security.logout_method=', from: '0.3.0', alternative: <<~INSTRUCTION Please use #logout_method= from the controller instead, for example: class Admin::ApplicationController < Wallaby::ResourcesController self.logout_method = 'put' end INSTRUCTION end |
#logout_path ⇒ Object
Deprecated.
13 14 15 16 17 |
# File 'lib/wallaby/configuration/security.rb', line 13 def logout_path Deprecator.alert 'config.security.logout_path', from: '0.3.0', alternative: <<~INSTRUCTION Please use controller_class.logout_path instead. INSTRUCTION end |
#logout_path=(_logout_path) ⇒ Object
Deprecated.
20 21 22 23 24 25 26 27 28 |
# File 'lib/wallaby/configuration/security.rb', line 20 def logout_path=(_logout_path) Deprecator.alert 'config.security.logout_path=', from: '0.3.0', alternative: <<~INSTRUCTION Please use #logout_path= from the controller instead, for example: class Admin::ApplicationController < Wallaby::ResourcesController self.logout_path = 'destroy_admin_user_session_path' end INSTRUCTION end |