ecm-blockchain-api 1.1.3 → 1.1.4

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
  SHA256:
3
- metadata.gz: daa9f40990e779bf5525925813901857d249626aa400e2ef9037fd1e4b527d17
4
- data.tar.gz: 77cd800a10413a0c39ea86bcbf60568006a3954b38960b20b06d3255d2020dfc
3
+ metadata.gz: 69ac4ec129e487b074af65a7d9e2189877884063e8acc2a37b7a4456b40634dc
4
+ data.tar.gz: 352052ecf8d2f09e54b7c353f76b16b3ebccd80d504ac9644b2a56ae730ad022
5
5
  SHA512:
6
- metadata.gz: a53419646bfb377680c98f975fd72a2aa75526cbec05b293aafff5b1d51f34469551e9f792632be5f21dbdc79faf59d2af5a8b9bb482a928dbb4901d7f640ba9
7
- data.tar.gz: 1f6ce937d72e248e256333f505653b9ac771ad2e9fcd4e32d270423c055df4cdce9a91712a90e7711a4a556c5aa802cdbea9bf20b9be41a5f210b59806fc520e
6
+ metadata.gz: f877633c80d89a50b0556cd89cabdf908b68f730aeac98f337d1c222b035c54efc3ab5b9066d95a02c27ce29bb41ad305cbb96503b71846091e787de5ad48179
7
+ data.tar.gz: fdefade3224b08c53a6a6e14234ce3c873161f9eb9124c7441d381479b2af647ad8b0bf849592a5c23fa5b5c226d878067e3b12e73d69b902c40bffe9407e594
data/Gemfile.lock CHANGED
@@ -1,114 +1,129 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ecm-blockchain-api (1.1.2)
4
+ ecm-blockchain-api (1.1.3)
5
5
  activemodel (~> 7.0, >= 7.0.4.3)
6
6
  httparty (~> 0.22.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (7.1.4.2)
12
- activesupport (= 7.1.4.2)
13
- activesupport (7.1.4.2)
11
+ activemodel (7.2.3)
12
+ activesupport (= 7.2.3)
13
+ activesupport (7.2.3)
14
14
  base64
15
+ benchmark (>= 0.3)
15
16
  bigdecimal
16
- concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ concurrent-ruby (~> 1.0, >= 1.3.1)
17
18
  connection_pool (>= 2.2.5)
18
19
  drb
19
20
  i18n (>= 1.6, < 2)
21
+ logger (>= 1.4.2)
20
22
  minitest (>= 5.1)
21
- mutex_m
22
- tzinfo (~> 2.0)
23
- addressable (2.8.7)
24
- public_suffix (>= 2.0.2, < 7.0)
25
- ast (2.4.2)
26
- base64 (0.2.0)
27
- bigdecimal (3.1.8)
23
+ securerandom (>= 0.3)
24
+ tzinfo (~> 2.0, >= 2.0.5)
25
+ addressable (2.8.8)
26
+ public_suffix (>= 2.0.2, < 8.0)
27
+ ast (2.4.3)
28
+ base64 (0.3.0)
29
+ benchmark (0.5.0)
30
+ bigdecimal (4.0.1)
28
31
  coderay (1.1.3)
29
- concurrent-ruby (1.3.4)
30
- connection_pool (2.4.1)
31
- crack (1.0.0)
32
+ concurrent-ruby (1.3.6)
33
+ connection_pool (3.0.2)
34
+ crack (1.0.1)
32
35
  bigdecimal
33
36
  rexml
34
- csv (3.3.0)
35
- diff-lcs (1.5.1)
36
- drb (2.2.1)
37
- factory_bot (6.5.0)
38
- activesupport (>= 5.0.0)
39
- faker (3.5.1)
37
+ csv (3.3.5)
38
+ diff-lcs (1.6.2)
39
+ drb (2.2.3)
40
+ factory_bot (6.5.6)
41
+ activesupport (>= 6.1.0)
42
+ faker (3.5.3)
40
43
  i18n (>= 1.8.11, < 2)
41
- hashdiff (1.1.1)
44
+ hashdiff (1.2.1)
42
45
  httparty (0.22.0)
43
46
  csv
44
47
  mini_mime (>= 1.0.0)
45
48
  multi_xml (>= 0.5.2)
46
- i18n (1.14.6)
49
+ i18n (1.14.8)
47
50
  concurrent-ruby (~> 1.0)
48
- json (2.7.4)
49
- language_server-protocol (3.17.0.3)
51
+ io-console (0.8.2)
52
+ json (2.18.0)
53
+ language_server-protocol (3.17.0.5)
54
+ lint_roller (1.1.0)
55
+ logger (1.7.0)
50
56
  method_source (1.1.0)
51
57
  mini_mime (1.1.5)
52
- minitest (5.25.1)
53
- multi_xml (0.6.0)
54
- mutex_m (0.2.0)
55
- parallel (1.26.3)
56
- parser (3.3.5.0)
58
+ minitest (6.0.1)
59
+ prism (~> 1.5)
60
+ multi_xml (0.8.1)
61
+ bigdecimal (>= 3.1, < 5)
62
+ parallel (1.27.0)
63
+ parser (3.3.10.1)
57
64
  ast (~> 2.4.1)
58
65
  racc
59
- pry (0.14.2)
66
+ prism (1.8.0)
67
+ pry (0.16.0)
60
68
  coderay (~> 1.1)
61
69
  method_source (~> 1.0)
62
- public_suffix (6.0.1)
70
+ reline (>= 0.6.0)
71
+ public_suffix (7.0.2)
63
72
  racc (1.8.1)
64
73
  rainbow (3.1.1)
65
- rake (13.2.1)
66
- regexp_parser (2.9.2)
67
- rexml (3.3.9)
68
- rspec (3.13.0)
74
+ rake (13.3.1)
75
+ regexp_parser (2.11.3)
76
+ reline (0.6.3)
77
+ io-console (~> 0.5)
78
+ rexml (3.4.4)
79
+ rspec (3.13.2)
69
80
  rspec-core (~> 3.13.0)
70
81
  rspec-expectations (~> 3.13.0)
71
82
  rspec-mocks (~> 3.13.0)
72
- rspec-core (3.13.2)
83
+ rspec-core (3.13.6)
73
84
  rspec-support (~> 3.13.0)
74
- rspec-expectations (3.13.3)
85
+ rspec-expectations (3.13.5)
75
86
  diff-lcs (>= 1.2.0, < 2.0)
76
87
  rspec-support (~> 3.13.0)
77
- rspec-mocks (3.13.2)
88
+ rspec-mocks (3.13.7)
78
89
  diff-lcs (>= 1.2.0, < 2.0)
79
90
  rspec-support (~> 3.13.0)
80
- rspec-support (3.13.1)
81
- rubocop (1.67.0)
91
+ rspec-support (3.13.6)
92
+ rubocop (1.82.1)
82
93
  json (~> 2.3)
83
- language_server-protocol (>= 3.17.0)
94
+ language_server-protocol (~> 3.17.0.2)
95
+ lint_roller (~> 1.1.0)
84
96
  parallel (~> 1.10)
85
97
  parser (>= 3.3.0.2)
86
98
  rainbow (>= 2.2.2, < 4.0)
87
- regexp_parser (>= 2.4, < 3.0)
88
- rubocop-ast (>= 1.32.2, < 2.0)
99
+ regexp_parser (>= 2.9.3, < 3.0)
100
+ rubocop-ast (>= 1.48.0, < 2.0)
89
101
  ruby-progressbar (~> 1.7)
90
- unicode-display_width (>= 2.4.0, < 3.0)
91
- rubocop-ast (1.32.3)
92
- parser (>= 3.3.1.0)
102
+ unicode-display_width (>= 2.4.0, < 4.0)
103
+ rubocop-ast (1.49.0)
104
+ parser (>= 3.3.7.2)
105
+ prism (~> 1.7)
93
106
  ruby-progressbar (1.13.0)
94
107
  ruby2_keywords (0.0.5)
95
- schemacop (3.0.29)
108
+ schemacop (3.0.36)
96
109
  activesupport (>= 4.0)
97
110
  ruby2_keywords (>= 0.0.4)
111
+ securerandom (0.4.1)
98
112
  shoulda-matchers (5.3.0)
99
113
  activesupport (>= 5.2.0)
100
114
  tzinfo (2.0.6)
101
115
  concurrent-ruby (~> 1.0)
102
- unicode-display_width (2.6.0)
103
- webmock (3.24.0)
116
+ unicode-display_width (3.2.0)
117
+ unicode-emoji (~> 4.1)
118
+ unicode-emoji (4.2.0)
119
+ webmock (3.26.1)
104
120
  addressable (>= 2.8.0)
105
121
  crack (>= 0.3.2)
106
122
  hashdiff (>= 0.4.0, < 2.0.0)
107
123
 
108
124
  PLATFORMS
109
125
  aarch64-linux
110
- arm64-darwin-23
111
- x86_64-darwin-19
126
+ ruby
112
127
 
113
128
  DEPENDENCIES
114
129
  activemodel (~> 7.0, >= 7.0.4.3)
@@ -124,5 +139,63 @@ DEPENDENCIES
124
139
  shoulda-matchers (~> 5.0)
125
140
  webmock
126
141
 
142
+ CHECKSUMS
143
+ activemodel (7.2.3)
144
+ activesupport (7.2.3)
145
+ addressable (2.8.8)
146
+ ast (2.4.3)
147
+ base64 (0.3.0)
148
+ benchmark (0.5.0)
149
+ bigdecimal (4.0.1)
150
+ coderay (1.1.3)
151
+ concurrent-ruby (1.3.6)
152
+ connection_pool (3.0.2)
153
+ crack (1.0.1)
154
+ csv (3.3.5)
155
+ diff-lcs (1.6.2)
156
+ drb (2.2.3)
157
+ ecm-blockchain-api (1.1.3)
158
+ factory_bot (6.5.6)
159
+ faker (3.5.3)
160
+ hashdiff (1.2.1)
161
+ httparty (0.22.0)
162
+ i18n (1.14.8)
163
+ io-console (0.8.2)
164
+ json (2.18.0)
165
+ language_server-protocol (3.17.0.5)
166
+ lint_roller (1.1.0)
167
+ logger (1.7.0)
168
+ method_source (1.1.0)
169
+ mini_mime (1.1.5)
170
+ minitest (6.0.1)
171
+ multi_xml (0.8.1)
172
+ parallel (1.27.0)
173
+ parser (3.3.10.1)
174
+ prism (1.8.0)
175
+ pry (0.16.0)
176
+ public_suffix (7.0.2)
177
+ racc (1.8.1)
178
+ rainbow (3.1.1)
179
+ rake (13.3.1)
180
+ regexp_parser (2.11.3)
181
+ reline (0.6.3)
182
+ rexml (3.4.4)
183
+ rspec (3.13.2)
184
+ rspec-core (3.13.6)
185
+ rspec-expectations (3.13.5)
186
+ rspec-mocks (3.13.7)
187
+ rspec-support (3.13.6)
188
+ rubocop (1.82.1)
189
+ rubocop-ast (1.49.0)
190
+ ruby-progressbar (1.13.0)
191
+ ruby2_keywords (0.0.5)
192
+ schemacop (3.0.36)
193
+ securerandom (0.4.1)
194
+ shoulda-matchers (5.3.0)
195
+ tzinfo (2.0.6)
196
+ unicode-display_width (3.2.0)
197
+ unicode-emoji (4.2.0)
198
+ webmock (3.26.1)
199
+
127
200
  BUNDLED WITH
128
- 2.4.22
201
+ 4.0.4
data/README.md CHANGED
@@ -64,7 +64,7 @@ custom_attributes = [{ name: "verified", value: "false" }]
64
64
  ECMBlockchain::CA.update(identity, custom_attributes)
65
65
 
66
66
  # Delete a member
67
- ECMBlockchain::CA.delete("user@org1.example.com")
67
+ ECMBlockchain::CA.revoke("user@org1.example.com")
68
68
  ```
69
69
 
70
70
  ```ruby
@@ -20,7 +20,10 @@ Gem::Specification.new do |spec|
20
20
  # Specify which files should be added to the gem when it is released.
21
21
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
22
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
23
+ `git ls-files -z`
24
+ .split("\x0")
25
+ .reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
26
+ .reject { |f| f.end_with?(".gem") }
24
27
  end
25
28
  spec.bindir = "exe"
26
29
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
@@ -9,6 +9,11 @@ module ECMBlockchain
9
9
  asset(request( :post, "/#{identity}#{ASSET_URL}", data ))
10
10
  end
11
11
 
12
+ def timestamp(identity, data)
13
+ verify_file(data)
14
+ asset(request( :patch, "/#{identity}#{ASSET_URL}/document_timestamp", data ))
15
+ end
16
+
12
17
  # def batch_create(identity, data)
13
18
  # verify_batch_assets(data)
14
19
  # request( :post, "/#{identity}#{ASSET_BATCH_URL}", data ).
@@ -43,6 +48,10 @@ module ECMBlockchain
43
48
  ECMBlockchain::AssetModel.verify(asset)
44
49
  end
45
50
 
51
+ def verify_file(file)
52
+ ECMBlockchain::DataFile.verify(file)
53
+ end
54
+
46
55
  def verify_batch_assets(arr)
47
56
  arr.find_all { |asset| verify_asset(asset) }
48
57
  end
@@ -1,5 +1,6 @@
1
1
  require 'active_model'
2
2
  require 'json'
3
+ require 'ostruct'
3
4
 
4
5
  module ECMBlockchain
5
6
  class AssetModel
@@ -1,3 +1,5 @@
1
+ require 'ostruct'
2
+
1
3
  module ECMBlockchain
2
4
  class DataFile
3
5
  include ActiveModel::Validations
@@ -7,6 +9,24 @@ module ECMBlockchain
7
9
 
8
10
  validates :identifier, :base64, presence: true
9
11
 
12
+ class << self
13
+ def verify(data={})
14
+ file = self.new(data)
15
+ raise ECMBlockchain::Error.raise_error(
16
+ OpenStruct.new(
17
+ code: 422,
18
+ body: {
19
+ error: {
20
+ message: file.errors.full_messages.first,
21
+ details: ''
22
+ }
23
+ }.to_json
24
+ )
25
+ ) unless file.valid?
26
+ file
27
+ end
28
+ end
29
+
10
30
  def initialize(data={})
11
31
  data ||= {}
12
32
  @identifier = data[:identifier]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ECMBlockchain
4
- VERSION = "1.1.3"
4
+ VERSION = "1.1.4"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm-blockchain-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wardy
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-29 00:00:00.000000000 Z
10
+ date: 2026-01-23 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: httparty