Class: Msf::RPC::JSON::Notification

Inherits:
Request
  • Object
show all
Defined in:
lib/msf/core/rpc/json/request.rb

Overview

Represents a JSON-RPC Notification. This is an EM::Deferrable class and instances respond to #callback and #errback to store callback actions.

Constant Summary

Constants inherited from Request

Request::JSON_MEDIA_TYPE, Request::JSON_RPC_ERROR_RESPONSE_MEMBER_TYPES, Request::JSON_RPC_ERROR_RESPONSE_REQUIRED_MEMBERS, Request::JSON_RPC_RESPONSE_MEMBER_TYPES, Request::JSON_RPC_RESPONSE_REQUIRED_MEMBERS, Request::JSON_RPC_VERSION

Instance Method Summary collapse

Methods inherited from Request

#send

Constructor Details

#initialize(uri, api_token: nil, method:, params: nil, namespace: nil, symbolize_names: true, private_key_file: nil, cert_chain_file: nil, verify_peer: nil) ⇒ Notification

Instantiate a Notification.

Parameters:

  • uri (URI::HTTP)

    the JSON-RPC service URI

  • api_token (String) (defaults to: nil)

    the API token. Default: nil

  • method (String)

    the JSON-RPC method name.

  • params (Array, Hash) (defaults to: nil)

    the JSON-RPC method parameters. Default: nil

  • namespace (String) (defaults to: nil)

    the namespace for the JSON-RPC method. The namespace will be prepended to the method name with a period separator. Default: nil

  • symbolize_names (Boolean) (defaults to: true)

    If true, symbols are used for the names (keys) when processing JSON objects; otherwise, strings are used. Default: true

  • private_key_file (String) (defaults to: nil)

    the SSL private key file used for the HTTPS request. Default: nil

  • cert_chain_file (String) (defaults to: nil)

    the SSL cert chain file used for the HTTPS request. Default: nil

  • verify_peer (Boolean) (defaults to: nil)

    indicates whether a server should request a certificate from a peer, to be verified by user code. Default: nil



211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/msf/core/rpc/json/request.rb', line 211

def initialize(uri, api_token: nil, method:, params: nil, namespace: nil,
               symbolize_names: true, private_key_file: nil,
               cert_chain_file: nil, verify_peer: nil)
  super(uri,
        api_token: api_token,
        method: method,
        params: params,
        namespace: namespace,
        symbolize_names: symbolize_names,
        is_notification: true,
        private_key_file: private_key_file,
        cert_chain_file: cert_chain_file,
        verify_peer: verify_peer)
end