akami 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d17edac634460b7b9cee2f6113d89c2713813a4
4
- data.tar.gz: f5e4aea68fbb2c589b4016998244180a0a124e3f
3
+ metadata.gz: 825ae5faa9ad5fa6de8a41b5cafaf9440c1ed815
4
+ data.tar.gz: eb85cd1306247a20e0197a6243f4655814c1ff66
5
5
  SHA512:
6
- metadata.gz: db43635bac8d3f6246bc5c265ee90ba55d258cd22fa2522a6f2c8c328973bf09d8e1bcb8991e3aef978076a68be28a6beda9a3d22e0cbd4170730b1698ebff35
7
- data.tar.gz: c7d2242e8205bf0952dfc058026aa37544941c6cda31efc67329baa283aa90229736066ddf00832a9d80f93bcb3336314f801c9b2b2d8e0b17daf8635d642fca
6
+ metadata.gz: 68eca4d3c681de14d7b263214f1572cea56890783daf3dfb7f9fd72e1489f61119e38cce7baae1eac854d22b5afd8bb35fc82f2563c54550006136357a32fb62
7
+ data.tar.gz: 8888ee881ba31dea74e698f232dd63c72b420d4c01d1aee5ffd06b231d3361026e49ee87571dfcbcb3d1623a3c404a8e92f374c7850058cc0a9818fb2e9a6552
@@ -1,5 +1,5 @@
1
1
  module Akami
2
2
 
3
- VERSION = "1.2.1"
3
+ VERSION = "1.2.2"
4
4
 
5
5
  end
@@ -28,6 +28,8 @@ module Akami
28
28
  # PasswordDigest URI.
29
29
  PASSWORD_DIGEST_URI = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"
30
30
 
31
+ BASE64_URI = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
32
+
31
33
  # Returns a value from the WSSE Hash.
32
34
  def [](key)
33
35
  hash[key]
@@ -116,7 +118,7 @@ module Akami
116
118
  "wsse:Nonce" => Base64.encode64(nonce),
117
119
  "wsu:Created" => timestamp,
118
120
  "wsse:Password" => digest_password,
119
- :attributes! => { "wsse:Password" => { "Type" => PASSWORD_DIGEST_URI } }
121
+ :attributes! => { "wsse:Password" => { "Type" => PASSWORD_DIGEST_URI }, "wsse:Nonce" => { "EncodingType" => BASE64_URI } }
120
122
  # clear the nonce after each use
121
123
  @nonce = nil
122
124
  else
@@ -25,6 +25,11 @@ describe Akami do
25
25
  "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"
26
26
  end
27
27
 
28
+ it "contains the namespace for Base64 Encoding type" do
29
+ Akami::WSSE::BASE64_URI.should ==
30
+ "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
31
+ end
32
+
28
33
  describe "#credentials" do
29
34
  it "sets the username" do
30
35
  wsse.credentials "username", "password"
@@ -121,7 +126,7 @@ describe Akami do
121
126
  end
122
127
 
123
128
  it "does not contain a wsse:Nonce tag" do
124
- wsse.to_xml.should_not match(/<wsse:Nonce>.*<\/wsse:Nonce>/)
129
+ wsse.to_xml.should_not match(/<wsse:Nonce.*>.*<\/wsse:Nonce>/)
125
130
  end
126
131
 
127
132
  it "does not contain a wsu:Created tag" do
@@ -148,8 +153,8 @@ describe Akami do
148
153
  wsse.to_xml.should_not include("password")
149
154
  end
150
155
 
151
- it "contains a wsse:Nonce tag" do
152
- wsse.to_xml.should match(/<wsse:Nonce>[^<]+<\/wsse:Nonce>/)
156
+ it "contains the Nonce base64 type attribute" do
157
+ wsse.to_xml.should include(Akami::WSSE::BASE64_URI)
153
158
  end
154
159
 
155
160
  it "contains a wsu:Created tag" do
@@ -166,7 +171,7 @@ describe Akami do
166
171
  it "should reset the nonce every time" do
167
172
  created_at = Time.now
168
173
  Timecop.freeze created_at do
169
- nonce_regexp = /<wsse:Nonce>([^<]+)<\/wsse:Nonce>/
174
+ nonce_regexp = /<wsse:Nonce.*>([^<]+)<\/wsse:Nonce>/
170
175
  nonce_first = Base64.decode64(nonce_regexp.match(wsse.to_xml)[1])
171
176
  nonce_second = Base64.decode64(nonce_regexp.match(wsse.to_xml)[1])
172
177
  nonce_first.should_not == nonce_second
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: akami
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-01 00:00:00.000000000 Z
11
+ date: 2014-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gyoku