Parent

Class/Module Index [+]

Quicksearch

Akami::WSSE

Akami::WSSE

Building Web Service Security.

Constants

PASSWORD_DIGEST_URI

PasswordDigest URI.

PASSWORD_TEXT_URI

PasswordText URI.

WSE_NAMESPACE

Namespace for WS Security Secext.

WSU_NAMESPACE

Namespace for WS Security Utility.

Attributes

created_at[RW]
digest[W]
expires_at[RW]
password[RW]
username[RW]

Public Instance Methods

[](key) click to toggle source

Returns a value from the WSSE Hash.

# File lib/akami/wsse.rb, line 26
def [](key)
  hash[key]
end
[]=(key, value) click to toggle source

Sets a value on the WSSE Hash.

# File lib/akami/wsse.rb, line 31
def []=(key, value)
  hash[key] = value
end
credentials(username, password, digest = false) click to toggle source

Sets authentication credentials for a wsse:UsernameToken header. Also accepts whether to use WSSE digest authentication.

# File lib/akami/wsse.rb, line 37
def credentials(username, password, digest = false)
  self.username = username
  self.password = password
  self.digest = digest
end
digest?() click to toggle source

Returns whether to use WSSE digest. Defaults to false.

# File lib/akami/wsse.rb, line 46
def digest?
  !!@digest
end
timestamp=(timestamp) click to toggle source

Sets whether to generate a wsu:Timestamp header.

# File lib/akami/wsse.rb, line 63
def timestamp=(timestamp)
  @wsu_timestamp = timestamp
end
timestamp?() click to toggle source

Returns whether to generate a wsu:Timestamp header.

# File lib/akami/wsse.rb, line 58
def timestamp?
  created_at || expires_at || @wsu_timestamp
end
to_xml() click to toggle source

Returns the XML for a WSSE header.

# File lib/akami/wsse.rb, line 68
def to_xml
  if username_token? && timestamp?
    Gyoku.xml wsse_username_token.merge!(wsu_timestamp) {
      |key, v1, v2| v1.merge!(v2) {
        |key, v1, v2| v1.merge!(v2)
      }
    }
  elsif username_token?
    Gyoku.xml wsse_username_token.merge!(hash)
  elsif timestamp?
    Gyoku.xml wsu_timestamp.merge!(hash)
  else
    ""
  end
end
username_token?() click to toggle source

Returns whether to generate a wsse:UsernameToken header.

# File lib/akami/wsse.rb, line 53
def username_token?
  username && password
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.