Class: AlexaRuby::Certificates

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_ruby/request/base_request/validator/certificates.rb

Overview

SSL certificates validator

Instance Method Summary collapse

Constructor Details

#initialize(certificates_chain_url, signature, request) ⇒ Certificates

Setup new certificates chain

Parameters:

  • certificates_chain_url (String)

    SSL certificates chain URL

  • signature (String)

    HTTP request signature

  • request (String)

    plain HTTP request body



13
14
15
16
17
# File 'lib/alexa_ruby/request/base_request/validator/certificates.rb', line 13

def initialize(certificates_chain_url, signature, request)
  download_certificates(certificates_chain_url)
  @signature = signature
  @request = request
end

Instance Method Details

#valid?Boolean

Check if it is a valid certificates chain and request signature

Returns:

  • (Boolean)


22
23
24
# File 'lib/alexa_ruby/request/base_request/validator/certificates.rb', line 22

def valid?
  active? && amazon? && verified?
end