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.
52 53 54 55 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 52 def initialize(env) @request = ActionDispatch::Request.new(env || {}) @denied = false end |
Instance Method Details
#cookies ⇒ Object
61 62 63 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 61 def @request. end |
#denied? ⇒ Boolean
89 90 91 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 89 def denied? @denied end |
#head ⇒ Object
81 82 83 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 81 def head(*, **) @denied = true end |
#params ⇒ Object
69 70 71 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 69 def params @request.params end |
#performed? ⇒ Boolean
85 86 87 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 85 def performed? @denied end |
#redirect_to ⇒ Object
73 74 75 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 73 def redirect_to(*, **) @denied = true end |
#render ⇒ Object
77 78 79 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 77 def render(*, **) @denied = true end |
#request ⇒ Object
65 66 67 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 65 def request @request end |
#session ⇒ Object
57 58 59 |
# File 'app/channels/mbeditor/channel_authentication.rb', line 57 def session @request.session end |