Class: RuboCop::Cop::Legion::Framework::SinatraHostAuth
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Legion::Framework::SinatraHostAuth
- Defined in:
- lib/rubocop/cop/legion/framework/sinatra_host_auth.rb
Overview
Detects Sinatra::Base subclasses that do not call ‘set :host_authorization`. Sinatra 4.0+ rejects all requests without this configuration, returning HTTP 403.
Constant Summary collapse
- MSG =
'Sinatra 4.0+ requires `set :host_authorization, permitted: :any` or all requests get 403.'- SEVERITY =
:convention
Instance Method Summary collapse
Instance Method Details
#on_class(node) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/rubocop/cop/legion/framework/sinatra_host_auth.rb', line 31 def on_class(node) return unless sinatra_base_subclass?(node) return if (node) add_offense(node, severity: SEVERITY) end |