Module: Rack::Protection
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/base.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/version.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/encryptor.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/json_csrf.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/form_token.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/xss_header.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/http_origin.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/ip_spoofing.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/remote_token.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/frame_options.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/cookie_tossing.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/escaped_params.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/path_traversal.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/referrer_policy.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/remote_referrer.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/encrypted_cookie.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/strict_transport.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/session_hijacking.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/authenticity_token.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection/content_security_policy.rb
Defined Under Namespace
Modules: Encryptor Classes: AuthenticityToken, Base, ContentSecurityPolicy, CookieTossing, EncryptedCookie, EscapedParams, FormToken, FrameOptions, HttpOrigin, IPSpoofing, JsonCsrf, PathTraversal, ReferrerPolicy, RemoteReferrer, RemoteToken, SessionHijacking, StrictTransport, XSSHeader
Constant Summary collapse
- VERSION =
'3.0.4'
Class Method Summary collapse
Class Method Details
.new(app, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-protection-3.0.5/lib/rack/protection.rb', line 28 def self.new(app, = {}) # does not include: RemoteReferrer, AuthenticityToken and FormToken except = Array [:except] use_these = Array [:use] if .fetch(:without_session, false) except += %i[session_hijacking remote_token] end Rack::Builder.new do # Off by default, unless added use ::Rack::Protection::AuthenticityToken, if use_these.include? :authenticity_token use ::Rack::Protection::ContentSecurityPolicy, if use_these.include? :content_security_policy use ::Rack::Protection::CookieTossing, if use_these.include? :cookie_tossing use ::Rack::Protection::EscapedParams, if use_these.include? :escaped_params use ::Rack::Protection::FormToken, if use_these.include? :form_token use ::Rack::Protection::ReferrerPolicy, if use_these.include? :referrer_policy use ::Rack::Protection::RemoteReferrer, if use_these.include? :remote_referrer use ::Rack::Protection::StrictTransport, if use_these.include? :strict_transport # On by default, unless skipped use ::Rack::Protection::FrameOptions, unless except.include? :frame_options use ::Rack::Protection::HttpOrigin, unless except.include? :http_origin use ::Rack::Protection::IPSpoofing, unless except.include? :ip_spoofing use ::Rack::Protection::JsonCsrf, unless except.include? :json_csrf use ::Rack::Protection::PathTraversal, unless except.include? :path_traversal use ::Rack::Protection::RemoteToken, unless except.include? :remote_token use ::Rack::Protection::SessionHijacking, unless except.include? :session_hijacking use ::Rack::Protection::XSSHeader, unless except.include? :xss_header run app end.to_app end |