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.
115 116 117 118 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 115 def initialize(env) @request = ActionDispatch::Request.new(env || {}) @denied = false end |
Instance Method Details
#cookies ⇒ Object
124 125 126 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 124 def @request. end |
#denied? ⇒ Boolean
152 153 154 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 152 def denied? @denied end |
#head ⇒ Object
144 145 146 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 144 def head(*, **) @denied = true end |
#params ⇒ Object
132 133 134 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 132 def params @request.params end |
#performed? ⇒ Boolean
148 149 150 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 148 def performed? @denied end |
#redirect_to ⇒ Object
136 137 138 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 136 def redirect_to(*, **) @denied = true end |
#render ⇒ Object
140 141 142 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 140 def render(*, **) @denied = true end |
#request ⇒ Object
128 129 130 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 128 def request @request end |
#session ⇒ Object
120 121 122 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 120 def session @request.session end |