Module: Rack::Protection

### Home Classes Methods

### In Files

- lib/rack/protection.rb
- lib/rack/protection/authenticity_token.rb
- lib/rack/protection/base.rb
- lib/rack/protection/escaped_params.rb
- lib/rack/protection/form_token.rb
- lib/rack/protection/frame_options.rb
- lib/rack/protection/http_origin.rb
- lib/rack/protection/ip_spoofing.rb
- lib/rack/protection/json_csrf.rb
- lib/rack/protection/path_traversal.rb
- lib/rack/protection/remote_referrer.rb
- lib/rack/protection/remote_token.rb
- lib/rack/protection/session_hijacking.rb
- lib/rack/protection/version.rb
- lib/rack/protection/xss_header.rb

### Namespace

- MODULE Rack::Protection::VERSION
- CLASS Rack::Protection::AuthenticityToken
- CLASS Rack::Protection::Base
- CLASS Rack::Protection::EscapedParams
- CLASS Rack::Protection::FormToken
- CLASS Rack::Protection::FrameOptions
- CLASS Rack::Protection::HttpOrigin
- CLASS Rack::Protection::IPSpoofing
- CLASS Rack::Protection::JsonCsrf
- CLASS Rack::Protection::PathTraversal
- CLASS Rack::Protection::RemoteReferrer
- CLASS Rack::Protection::RemoteToken
- CLASS Rack::Protection::SessionHijacking
- CLASS Rack::Protection::XSSHeader

### Methods

- ::new
- ::version

### Class/Module Index

Quicksearch

- Rack
- Rack::Protection
- Rack::Protection::AuthenticityToken
- Rack::Protection::Base
- Rack::Protection::EscapedParams
- Rack::Protection::FormToken
- Rack::Protection::FrameOptions
- Rack::Protection::HttpOrigin
- Rack::Protection::IPSpoofing
- Rack::Protection::JsonCsrf
- Rack::Protection::PathTraversal
- Rack::Protection::RemoteReferrer
- Rack::Protection::RemoteToken
- Rack::Protection::SessionHijacking
- Rack::Protection::VERSION
- Rack::Protection::XSSHeader

No matching classes.

# Rack::Protection

### Constants

SIGNATURE
VERSION

### Public Class Methods

new(app, options = {}) click to toggle source

    # File lib/rack/protection.rb, line 20
    def self.new(app, options = {})
      # does not include: RemoteReferrer, AuthenticityToken and FormToken
      except = Array options[:except]
      use_these = Array options[:use]
      Rack::Builder.new do
        use ::Rack::Protection::RemoteReferrer,   options if use_these.include? :remote_referrer
        use ::Rack::Protection::AuthenticityToken,options if use_these.include? :authenticity_token
        use ::Rack::Protection::FormToken,        options if use_these.include? :form_token
        use ::Rack::Protection::FrameOptions,     options unless except.include? :frame_options
        use ::Rack::Protection::HttpOrigin,       options unless except.include? :http_origin
        use ::Rack::Protection::IPSpoofing,       options unless except.include? :ip_spoofing
        use ::Rack::Protection::JsonCsrf,         options unless except.include? :json_csrf
        use ::Rack::Protection::PathTraversal,    options unless except.include? :path_traversal
        use ::Rack::Protection::RemoteToken,      options unless except.include? :remote_token
        use ::Rack::Protection::SessionHijacking, options unless except.include? :session_hijacking
        use ::Rack::Protection::XSSHeader,        options unless except.include? :xss_header
        run app
      end.to_app
    end

version() click to toggle source

    # File lib/rack/protection/version.rb, line 3
    def self.version
      VERSION
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.