diaspora_federation 0.1.2 → 0.1.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 +6 -0
- data/lib/diaspora_federation/entities/relayable.rb +8 -3
- data/lib/diaspora_federation/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e56eee6e871dc16abaa0da7c604f9f9143e71871
|
4
|
+
data.tar.gz: 224950a212f0264c89ef06f9424562890402f241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5312e34a58235295100cb3ab411c9d98f02a176eb269d9a17e1dc1d4ba3f758c4709aa4be7412beb69d46f16f4c5b9a0fc26f9064d7d19e3c0412a1415b2a7cd
|
7
|
+
data.tar.gz: c8d038df9fb247670cbdc94385e80a758fc03a2ef2e37a3a9dd26ebc6c42973fa83234a2e2173110a0f74524a7ec256d0b54f8f31f8062d1286422c8afe6be4a
|
data/Changelog.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 0.1.3
|
2
|
+
|
3
|
+
## Refactor
|
4
|
+
|
5
|
+
* Improve handling of `xml_order` in relayables [36a787d](https://github.com/diaspora/diaspora_federation/commit/36a787dd87f9770e16fbc1bbc0a6c0d6f059e727) [ba129aa](https://github.com/diaspora/diaspora_federation/commit/ba129aafa38f978f69565d39b7a881a245b03bab) [41de99b](https://github.com/diaspora/diaspora_federation/commit/41de99bd5e4ed2779d574183a58f9ac9550c658a)
|
6
|
+
|
1
7
|
# 0.1.2
|
2
8
|
|
3
9
|
## Refactor
|
@@ -72,7 +72,7 @@ module DiasporaFederation
|
|
72
72
|
# @param [Hash] additional_xml_elements additional xml elements
|
73
73
|
# @see DiasporaFederation::Entity#initialize
|
74
74
|
def initialize(data, xml_order=nil, additional_xml_elements={})
|
75
|
-
@xml_order = xml_order
|
75
|
+
@xml_order = xml_order.try(:reject) {|name| name =~ /signature/ }
|
76
76
|
@additional_xml_elements = additional_xml_elements
|
77
77
|
|
78
78
|
super(data)
|
@@ -153,7 +153,7 @@ module DiasporaFederation
|
|
153
153
|
# @return [Hash] sorted xml elements with updated signatures
|
154
154
|
def xml_elements
|
155
155
|
xml_data = super.merge(additional_xml_elements)
|
156
|
-
signature_order.map {|element| [element, xml_data[element]] }.to_h.tap do |xml_elements|
|
156
|
+
signature_order.map {|element| [element, xml_data[element] || ""] }.to_h.tap do |xml_elements|
|
157
157
|
xml_elements[:author_signature] = author_signature || sign_with_author
|
158
158
|
xml_elements[:parent_author_signature] = parent_author_signature || sign_with_parent_author_if_available.to_s
|
159
159
|
end
|
@@ -162,7 +162,12 @@ module DiasporaFederation
|
|
162
162
|
# The order for signing
|
163
163
|
# @return [Array]
|
164
164
|
def signature_order
|
165
|
-
|
165
|
+
if xml_order
|
166
|
+
prop_names = self.class.class_props.keys.map(&:to_s)
|
167
|
+
xml_order.map {|name| prop_names.include?(name) ? name.to_sym : name }
|
168
|
+
else
|
169
|
+
self.class::LEGACY_SIGNATURE_ORDER
|
170
|
+
end
|
166
171
|
end
|
167
172
|
|
168
173
|
# @return [String] signature data string
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diaspora_federation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Neff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -214,4 +214,3 @@ signing_key:
|
|
214
214
|
specification_version: 4
|
215
215
|
summary: diaspora* federation library
|
216
216
|
test_files: []
|
217
|
-
has_rdoc:
|