Method: AmazonFPS#initialize

Defined in:
lib/amazon_fps.rb

#initialize(credentials, opts = {}, sandbox = false) ⇒ AmazonFPS

Initializes the connection to AmazonFPS and sets up cryptographic signature features

Credentials hash should include:

AWSAccessKeyId

Your AWS Access Key

Opts hash can include:

:certificate_dir

Directory in which certificates live

:subject

Subject for x509 certificate



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/amazon_fps.rb', line 36

def initialize(credentials, opts={}, sandbox=false)
  @options = opts
  @endpoint_url = sandbox ? SANDBOX_ENDPOINT : LIVE_ENDPOINT
  @certificate_dir = @options[:certificate_dir] ? @options[:certificate_dir] : CERTIFICATE_DIR
  @aws = AmazonFPSPortType.new(@endpoint_url)
  @aws.wiredump_dev = STDERR if $DEBUG
  @aws.options["protocol.http.ssl_config.verify_mode"] = nil
  sign()
  @credentials = Credentials.new(credentials)
  @credentials.handlers.each do |h|
    @aws.headerhandler << h
  end
end