Class: Docusign::IntegratorsKeyAuthHeaderHandler

Inherits:
SOAP::Header::SimpleHandler
  • Object
show all
Defined in:
lib/docusign/integrators_key_auth_header_handler.rb

Constant Summary collapse

NAMESPACE =
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ IntegratorsKeyAuthHeaderHandler

Returns a new instance of IntegratorsKeyAuthHeaderHandler.



24
25
26
27
28
# File 'lib/docusign/integrators_key_auth_header_handler.rb', line 24

def initialize(options={})
  self.attributes = options
  
  super(XSD::QName.new(NAMESPACE, 'Security'))
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



22
23
24
# File 'lib/docusign/integrators_key_auth_header_handler.rb', line 22

def attributes
  @attributes
end

Instance Method Details

#on_simple_outboundObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/docusign/integrators_key_auth_header_handler.rb', line 30

def on_simple_outbound
  if attributes[:integrators_key] && attributes[:email]
    {
      'UsernameToken' => {
        'Username' => "[#{attributes[:integrators_key]}]#{attributes[:email]}", 
        'Password' => attributes[:password]
      }
    }
  end
end