Class: Mbeditor::ChannelAuthentication::AuthProbe
- Inherits:
-
Object
- Object
- Mbeditor::ChannelAuthentication::AuthProbe
- Defined in:
- app/channels/mbeditor/channel_authentication.rb
Overview
Minimal controller-like context for evaluating authenticate_with off the
cable connection. Any render/redirect/head marks the request as denied,
mirroring a controller's performed? halt semantics.
Instance Method Summary collapse
- #cookies ⇒ Object
- #denied? ⇒ Boolean
- #head ⇒ Object
-
#initialize(env) ⇒ AuthProbe
constructor
A new instance of AuthProbe.
- #params ⇒ Object
- #performed? ⇒ Boolean
- #redirect_to ⇒ Object
- #render ⇒ Object
- #request ⇒ Object
- #session ⇒ Object
Constructor Details
#initialize(env) ⇒ AuthProbe
Returns a new instance of AuthProbe.
81 82 83 84 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 81 def initialize(env) @request = ActionDispatch::Request.new(env || {}) @denied = false end |
Instance Method Details
#cookies ⇒ Object
90 91 92 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 90 def @request. end |
#denied? ⇒ Boolean
118 119 120 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 118 def denied? @denied end |
#head ⇒ Object
110 111 112 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 110 def head(*, **) @denied = true end |
#params ⇒ Object
98 99 100 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 98 def params @request.params end |
#performed? ⇒ Boolean
114 115 116 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 114 def performed? @denied end |
#redirect_to ⇒ Object
102 103 104 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 102 def redirect_to(*, **) @denied = true end |
#render ⇒ Object
106 107 108 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 106 def render(*, **) @denied = true end |
#request ⇒ Object
94 95 96 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 94 def request @request end |
#session ⇒ Object
86 87 88 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 86 def session @request.session end |