Class: Soteria::Utilities

Inherits:
Object
  • Object
show all
Defined in:
lib/soteria/utilities.rb

Constant Summary collapse

CREDENTIAL_TYPES =
{
    standard: 'STANDARD_OTP',
    certificate: 'CERTIFICATE',
    sms: 'SMS_OTP',
    voice: 'VOICE_OTP',
    service: 'SERVICE_OTP'
}

Class Method Summary collapse

Class Method Details

.create_client(wsdl, should_log, cert_file, cert_key, cert_key_password) ⇒ Object

Create a Savon client object to make calls.

Parameters:

  • wsdl (String)

    The absolute path to, or the URL of the WSDL file for this client.

  • should_log (Boolean)
  • cert_file (String)

    The absolute path to the certificate file.

  • cert_key (String)

    The absolute path to the certificate key file.

  • cert_key_password (String)

    The password fo the certificate key file.

See Also:

  • Savon::Client


24
25
26
27
28
29
30
31
32
33
34
# File 'lib/soteria/utilities.rb', line 24

def self.create_client(wsdl, should_log, cert_file, cert_key, cert_key_password)
  Savon.client(wsdl: wsdl,
               env_namespace: :soapenv,
               namespace: 'https://schemas.symantec.com/vip/2011/04/vipuserservices',
               log: should_log,
               ssl_version: :TLSv1,
               ssl_cert_file: cert_file,
               ssl_cert_key_file: cert_key,
               ssl_cert_key_password: cert_key_password,
               namespace_identifier: :vip)
end

.get_request_id(prefix) ⇒ String

Generate a request ID for a SOAP call.

Parameters:

  • prefix (String)

    The prefix for the request ID. This should tell the user what the call is.

Returns:

  • (String)

    A string that is the request ID for a call. The request ID is just used for debugging purposes.



10
11
12
13
# File 'lib/soteria/utilities.rb', line 10

def self.get_request_id(prefix)
  time = Time.new
  prefix + '_' + time.strftime('%Y%m%d%H%M%S')
end