Sha256: edd954833b172812fc6cf1db542f7c0cc339c0135dd31c71167136947914b14f

Contents?: true

Size: 707 Bytes

Versions: 10

Compression:

Stored size: 707 Bytes

Contents

require 'orange-core/middleware/base'

module Orange::Middleware
  # The RadiusParser middleware will parse all outgoing content with 
  # Radius.
  #
  # For more details on how Radius works, see http://radius.rubyforge.org/
  # This middleware also loads a resource: "Orange::Radius", for the
  # purpose of exposing the context object.
  class RadiusParser < Base
    def init(opts = {})
      @contexts = opts[:contexts] || [:live]
      orange.load Orange::Radius.new, :radius
    end
    
    # Passes packet then parses the return
    def packet_call(packet)
      pass packet
      orange[:radius].parse packet if @contexts.include? packet['route.context']
      packet.finish
    end
    
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
orange-0.2.4 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.2.3 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.1.10 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.1.8 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.1.7 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.1.4 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.1.2 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.1.0 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.0.15 lib/orange-more/slices/middleware/radius_parser.rb
orange-0.0.14 lib/orange-more/slices/middleware/radius_parser.rb