diaspora_federation 0.1.2 → 0.1.3

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: 9ba82f5232ef44f9731f00859c5a32fa8163570e
4
- data.tar.gz: 01c7f76df999d4a0f476cf7c0ddbbc4f1a86ef0a
3
+ metadata.gz: e56eee6e871dc16abaa0da7c604f9f9143e71871
4
+ data.tar.gz: 224950a212f0264c89ef06f9424562890402f241
5
5
  SHA512:
6
- metadata.gz: 49abed4f800587ea9f0a671cd1eccc74a3df06b58f9039e61a7540b8e809cf54b4b49f6e8d075e6fe943ffd687d10c2d0e48e250878d080e0c6370ff27979ee6
7
- data.tar.gz: 36c5a25c0744fda688707de4d0c469d90989a3fb016e1af39e030efa38dddc3d4b6c9a89be21d52245950f41b59fb030c8c5eeda3a96e8475cdfa6ff3057c2b7
6
+ metadata.gz: 5312e34a58235295100cb3ab411c9d98f02a176eb269d9a17e1dc1d4ba3f758c4709aa4be7412beb69d46f16f4c5b9a0fc26f9064d7d19e3c0412a1415b2a7cd
7
+ data.tar.gz: c8d038df9fb247670cbdc94385e80a758fc03a2ef2e37a3a9dd26ebc6c42973fa83234a2e2173110a0f74524a7ec256d0b54f8f31f8062d1286422c8afe6be4a
@@ -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
- xml_order.nil? ? self.class::LEGACY_SIGNATURE_ORDER : xml_order.reject {|name| name =~ /signature/ }
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
@@ -1,4 +1,4 @@
1
1
  module DiasporaFederation
2
2
  # the gem version
3
- VERSION = "0.1.2".freeze
3
+ VERSION = "0.1.3".freeze
4
4
  end
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.2
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-14 00:00:00.000000000 Z
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: