Sha256: 4b810d82d25aba05158256f715de037edf65f5c1e798cf951636d672e1c2018e

Contents?: true

Size: 1.43 KB

Versions: 6

Compression:

Stored size: 1.43 KB

Contents

=begin

    This file is part of the Arachni-RPC project and may be subject to
    redistribution and commercial restrictions. Please see the Arachni-RPC
    web site for more information on licensing and terms of use.

=end

require_relative 'message'

module Arachni
module RPC

# Represents an RPC request.
#
# It's here only for formalization purposes, it's not actually sent over the wire.
#
# What is sent is a hash generated by {#prepare_for_tx}. which is in the form of:
#
#
#     {
#         # RPC message in the form of 'handler.method'.
#         'message' => msg,
#         # Optional array of arguments for the remote method.
#         'args'    => args,
#         # Optional authentication token.
#         'token'   => token
#     }
#
# Any client that has SSL support and can serialize a Hash just like the one
# above can communicate with the RPC server.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
class Request < Message

    # @return   [String]
    #   RPC message in the form of 'handler.method'.
    attr_accessor :message

    # @return   [Array]
    #   Optional arguments for the remote method.
    attr_accessor :args

    # @return   [String]
    #   Optional authentication token.
    attr_accessor :token

    # @return   [Proc]
    #   Callback to be invoked on the response.
    attr_accessor :callback

    private

    def transmit?( attr )
        ![ :@callback ].include?( attr )
    end

end

end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arachni-rpc-0.2.1.4 lib/arachni/rpc/request.rb
arachni-rpc-0.2.1.3 lib/arachni/rpc/request.rb
arachni-rpc-0.2.1.2 lib/arachni/rpc/request.rb
arachni-rpc-0.2.1.1 lib/arachni/rpc/request.rb
arachni-rpc-0.2.1 lib/arachni/rpc/request.rb
arachni-rpc-0.2.0 lib/arachni/rpc/request.rb