Module: Savon::WSSE
- Included in:
- SOAP
- Defined in:
- lib/savon/wsse.rb
Overview
Savon::WSSE
Includes support methods for adding WSSE authentication to a SOAP request.
Constant Summary collapse
- WSENamespace =
Namespace for WS Security Secext.
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
- WSUNamespace =
Namespace for WS Security Utility.
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
Class Attribute Summary collapse
-
.digest ⇒ Object
writeonly
Sets whether to use WSSE digest by default.
-
.password ⇒ Object
Accessor for the default WSSE password.
-
.username ⇒ Object
Accessor for the default WSSE username.
Class Method Summary collapse
-
.digest? ⇒ Boolean
Returns whether to use WSSE digest by default.
Instance Method Summary collapse
-
#wsse? ⇒ Boolean
Returns whether WSSE authentication was set via options.
-
#wsse_header(xml) ⇒ Object
Takes a Builder::XmlMarkup instance and appends a WSSE header.
Class Attribute Details
.digest=(value) ⇒ Object (writeonly)
Sets whether to use WSSE digest by default.
32 33 34 |
# File 'lib/savon/wsse.rb', line 32 def digest=(value) @digest = value end |
.password ⇒ Object
Accessor for the default WSSE password.
29 30 31 |
# File 'lib/savon/wsse.rb', line 29 def password @password end |
.username ⇒ Object
Accessor for the default WSSE username.
26 27 28 |
# File 'lib/savon/wsse.rb', line 26 def username @username end |
Class Method Details
.digest? ⇒ Boolean
Returns whether to use WSSE digest by default.
35 36 37 |
# File 'lib/savon/wsse.rb', line 35 def digest? @digest end |
Instance Method Details
#wsse? ⇒ Boolean
Returns whether WSSE authentication was set via options.
42 43 44 45 |
# File 'lib/savon/wsse.rb', line 42 def wsse? [:wsse] = {} unless [:wsse].kind_of? Hash wsse_username && wsse_password end |
#wsse_header(xml) ⇒ Object
Takes a Builder::XmlMarkup instance and appends a WSSE header.
48 49 50 51 52 53 54 55 56 |
# File 'lib/savon/wsse.rb', line 48 def wsse_header(xml) [:wsse] = {} unless [:wsse].kind_of? Hash xml.wsse :Security, "xmlns:wsse" => WSENamespace do xml.wsse :UsernameToken, "xmlns:wsu" => WSUNamespace do wsse_nodes xml end end end |