akami 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/akami/version.rb +1 -1
- data/lib/akami/wsse.rb +20 -23
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1103cb0692c129241fbfd8360ab1dcfc96157c9ad7f2a28987ea3848ec06ab2
|
4
|
+
data.tar.gz: d2e9cfc6c384c697be541aceda1bb3a4dc5e9654db159eca3fbc795dfc5d2671
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3bd5f7aa12bc379c4434dc880a23f9897a722ae2dd09352fb50a0bf807e932abc26d2703dfd2bcea463216fb746d499ce2eb80cff978b1feeb23404749a0253
|
7
|
+
data.tar.gz: 84f9de77fef2521fa98df2c52f5e32b71f72b909da82f77a586e3aa746f8883610983b712c7ba11ff7833c409e72d243762358dfd6a46eead757ec9938b607e7
|
data/CHANGELOG.md
CHANGED
data/lib/akami/version.rb
CHANGED
data/lib/akami/wsse.rb
CHANGED
@@ -90,25 +90,24 @@ module Akami
|
|
90
90
|
|
91
91
|
# Returns the XML for a WSSE header.
|
92
92
|
def to_xml
|
93
|
-
if signature?
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
}
|
100
|
-
}
|
101
|
-
elsif username_token?
|
102
|
-
Gyoku.xml wsse_username_token.merge!(hash)
|
103
|
-
elsif timestamp?
|
104
|
-
Gyoku.xml wsu_timestamp.merge!(hash)
|
105
|
-
else
|
106
|
-
""
|
107
|
-
end
|
93
|
+
h = wsse_signature if signature? && signature.have_document?
|
94
|
+
h = merge_hashes_with_keys(h, wsu_timestamp) if timestamp?
|
95
|
+
h = merge_hashes_with_keys(h, wsse_username_token) if username_token?
|
96
|
+
|
97
|
+
return '' unless h
|
98
|
+
Gyoku.xml h
|
108
99
|
end
|
109
100
|
|
110
101
|
private
|
111
102
|
|
103
|
+
def merge_hashes_with_keys(hash_one, hash_two)
|
104
|
+
return hash_two unless hash_one
|
105
|
+
keys = hash_one["wsse:Security"][:order!] | hash_two["wsse:Security"][:order!]
|
106
|
+
Akami::HashHelper.deep_merge!(hash_one, hash_two)
|
107
|
+
hash_one["wsse:Security"][:order!] = keys
|
108
|
+
hash_one
|
109
|
+
end
|
110
|
+
|
112
111
|
# Returns a Hash containing wsse:UsernameToken details.
|
113
112
|
def wsse_username_token
|
114
113
|
if digest?
|
@@ -135,7 +134,7 @@ module Akami
|
|
135
134
|
# First key/value is tag/hash
|
136
135
|
tag, hash = signature_hash.shift
|
137
136
|
|
138
|
-
security_hash nil, tag, hash, signature_hash
|
137
|
+
security_hash nil, tag, hash, signature_hash, true
|
139
138
|
end
|
140
139
|
|
141
140
|
# Returns a Hash containing wsu:Timestamp details.
|
@@ -147,21 +146,20 @@ module Akami
|
|
147
146
|
|
148
147
|
# Returns a Hash containing wsse/wsu Security details for a given
|
149
148
|
# +namespace+, +tag+ and +hash+.
|
150
|
-
def security_hash(namespace, tag, hash, extra_info = {})
|
149
|
+
def security_hash(namespace, tag, hash, extra_info = {}, signature_request=false)
|
151
150
|
key = [namespace, tag].compact.join(":")
|
152
151
|
|
153
152
|
sec_hash = {
|
154
153
|
"wsse:Security" => {
|
155
|
-
key => hash
|
154
|
+
key => hash,
|
155
|
+
:order! => [key]
|
156
156
|
},
|
157
157
|
:attributes! => { "wsse:Security" => { "xmlns:wsse" => WSE_NAMESPACE } }
|
158
158
|
}
|
159
159
|
|
160
|
-
unless extra_info.empty?
|
161
|
-
sec_hash["wsse:Security"].merge!(extra_info)
|
162
|
-
end
|
160
|
+
sec_hash["wsse:Security"].merge!(extra_info) unless extra_info.empty?
|
163
161
|
|
164
|
-
if
|
162
|
+
if signature_request
|
165
163
|
sec_hash[:attributes!].merge!("soapenv:mustUnderstand" => "1")
|
166
164
|
else
|
167
165
|
sec_hash["wsse:Security"].merge!(:attributes! => { key => { "wsu:Id" => "#{tag}-#{count}", "xmlns:wsu" => WSU_NAMESPACE } })
|
@@ -201,6 +199,5 @@ module Akami
|
|
201
199
|
def hash
|
202
200
|
@hash ||= Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
|
203
201
|
end
|
204
|
-
|
205
202
|
end
|
206
203
|
end
|
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.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gyoku
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: base64
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
126
|
requirements:
|
113
127
|
- - ">="
|
114
128
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
129
|
+
version: 3.0.0
|
116
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
131
|
requirements:
|
118
132
|
- - ">="
|