ecm-blockchain-api 1.1.2 → 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 +4 -4
- data/.DS_Store +0 -0
- data/.docker/entrypoint.sh +1 -0
- data/Dockerfile +18 -0
- data/Gemfile.lock +127 -53
- data/README.md +3 -3
- data/bin/console +2 -2
- data/compose.yaml +13 -0
- data/ecm-blockchain-api.gemspec +4 -1
- data/lib/ecm-blockchain-api/asset.rb +9 -0
- data/lib/ecm-blockchain-api/models/asset_model.rb +1 -0
- data/lib/ecm-blockchain-api/models/data_file_model.rb +20 -0
- data/lib/ecm-blockchain-api/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 69ac4ec129e487b074af65a7d9e2189877884063e8acc2a37b7a4456b40634dc
|
|
4
|
+
data.tar.gz: 352052ecf8d2f09e54b7c353f76b16b3ebccd80d504ac9644b2a56ae730ad022
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f877633c80d89a50b0556cd89cabdf908b68f730aeac98f337d1c222b035c54efc3ab5b9066d95a02c27ce29bb41ad305cbb96503b71846091e787de5ad48179
|
|
7
|
+
data.tar.gz: fdefade3224b08c53a6a6e14234ce3c873161f9eb9124c7441d381479b2af647ad8b0bf849592a5c23fa5b5c226d878067e3b12e73d69b902c40bffe9407e594
|
data/.DS_Store
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
./bin/console
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
ARG PLATFORM=linux/arm64
|
|
2
|
+
FROM --platform=$PLATFORM ruby:3.2.5-slim
|
|
3
|
+
|
|
4
|
+
RUN apt-get update -qq && apt-get install -y build-essential git
|
|
5
|
+
|
|
6
|
+
WORKDIR '/gem'
|
|
7
|
+
COPY . /gem
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
RUN gem install bundler -v '2.5.18'
|
|
11
|
+
RUN gem update --system
|
|
12
|
+
|
|
13
|
+
RUN bundle install
|
|
14
|
+
|
|
15
|
+
# COPY .docker/entrypoint.sh /usr/bin/
|
|
16
|
+
# RUN chmod +x /usr/bin/entrypoint.sh
|
|
17
|
+
# ENTRYPOINT ["entrypoint.sh"]
|
|
18
|
+
CMD ["./bin/console"]
|
data/Gemfile.lock
CHANGED
|
@@ -1,113 +1,129 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ecm-blockchain-api (1.1.
|
|
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.
|
|
12
|
-
activesupport (= 7.
|
|
13
|
-
activesupport (7.
|
|
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.
|
|
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
|
-
|
|
22
|
-
tzinfo (~> 2.0)
|
|
23
|
-
addressable (2.8.
|
|
24
|
-
public_suffix (>= 2.0.2, <
|
|
25
|
-
ast (2.4.
|
|
26
|
-
base64 (0.
|
|
27
|
-
|
|
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.
|
|
30
|
-
connection_pool (
|
|
31
|
-
crack (1.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.
|
|
35
|
-
diff-lcs (1.
|
|
36
|
-
drb (2.2.
|
|
37
|
-
factory_bot (6.5.
|
|
38
|
-
activesupport (>=
|
|
39
|
-
faker (3.5.
|
|
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.
|
|
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.
|
|
49
|
+
i18n (1.14.8)
|
|
47
50
|
concurrent-ruby (~> 1.0)
|
|
48
|
-
|
|
49
|
-
|
|
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 (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
66
|
+
prism (1.8.0)
|
|
67
|
+
pry (0.16.0)
|
|
60
68
|
coderay (~> 1.1)
|
|
61
69
|
method_source (~> 1.0)
|
|
62
|
-
|
|
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.
|
|
66
|
-
regexp_parser (2.
|
|
67
|
-
|
|
68
|
-
|
|
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.
|
|
83
|
+
rspec-core (3.13.6)
|
|
73
84
|
rspec-support (~> 3.13.0)
|
|
74
|
-
rspec-expectations (3.13.
|
|
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.
|
|
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.
|
|
81
|
-
rubocop (1.
|
|
91
|
+
rspec-support (3.13.6)
|
|
92
|
+
rubocop (1.82.1)
|
|
82
93
|
json (~> 2.3)
|
|
83
|
-
language_server-protocol (
|
|
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.
|
|
88
|
-
rubocop-ast (>= 1.
|
|
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, <
|
|
91
|
-
rubocop-ast (1.
|
|
92
|
-
parser (>= 3.3.
|
|
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.
|
|
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.
|
|
103
|
-
|
|
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
|
-
|
|
110
|
-
|
|
125
|
+
aarch64-linux
|
|
126
|
+
ruby
|
|
111
127
|
|
|
112
128
|
DEPENDENCIES
|
|
113
129
|
activemodel (~> 7.0, >= 7.0.4.3)
|
|
@@ -123,5 +139,63 @@ DEPENDENCIES
|
|
|
123
139
|
shoulda-matchers (~> 5.0)
|
|
124
140
|
webmock
|
|
125
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
|
+
|
|
126
200
|
BUNDLED WITH
|
|
127
|
-
|
|
201
|
+
4.0.4
|
data/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Client library to connect and transact with your [ECM Blockchain network](https:
|
|
|
7
7
|
Add this line to your application's Gemfile:
|
|
8
8
|
|
|
9
9
|
```ruby
|
|
10
|
-
gem '
|
|
10
|
+
gem 'ecm-blockchain-api'
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
And then execute:
|
|
@@ -16,7 +16,7 @@ And then execute:
|
|
|
16
16
|
|
|
17
17
|
Or install through a CLI with:
|
|
18
18
|
|
|
19
|
-
$ gem install
|
|
19
|
+
$ gem install ecm-blockchain-api
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
Configure the library by initializing it with your access token.
|
|
@@ -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.
|
|
67
|
+
ECMBlockchain::CA.revoke("user@org1.example.com")
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
```ruby
|
data/bin/console
CHANGED
|
@@ -10,9 +10,9 @@ require "ecm-blockchain-api"
|
|
|
10
10
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
11
|
# require "pry"
|
|
12
12
|
# Pry.start
|
|
13
|
-
ECMBlockchain.base_url = "
|
|
13
|
+
ECMBlockchain.base_url = ""
|
|
14
14
|
# ECMBlockchain.access_token = ""
|
|
15
|
-
ECMBlockchain.access_token = "
|
|
15
|
+
ECMBlockchain.access_token = ""
|
|
16
16
|
|
|
17
17
|
require "pry"
|
|
18
18
|
Pry.start
|
data/compose.yaml
ADDED
data/ecm-blockchain-api.gemspec
CHANGED
|
@@ -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
|
|
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,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]
|
metadata
CHANGED
|
@@ -1,14 +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.
|
|
4
|
+
version: 1.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wardy
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2026-01-23 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: httparty
|
|
@@ -80,18 +79,22 @@ executables: []
|
|
|
80
79
|
extensions: []
|
|
81
80
|
extra_rdoc_files: []
|
|
82
81
|
files:
|
|
82
|
+
- ".DS_Store"
|
|
83
|
+
- ".docker/entrypoint.sh"
|
|
83
84
|
- ".gitignore"
|
|
84
85
|
- ".gitlab-ci.yml"
|
|
85
86
|
- ".rspec"
|
|
86
87
|
- ".rubocop.yml"
|
|
87
88
|
- ".tool-versions"
|
|
88
89
|
- CHANGELOG.md
|
|
90
|
+
- Dockerfile
|
|
89
91
|
- Gemfile
|
|
90
92
|
- Gemfile.lock
|
|
91
93
|
- README.md
|
|
92
94
|
- Rakefile
|
|
93
95
|
- bin/console
|
|
94
96
|
- bin/setup
|
|
97
|
+
- compose.yaml
|
|
95
98
|
- ecm-blockchain-api.gemspec
|
|
96
99
|
- lib/ecm-blockchain-api.rb
|
|
97
100
|
- lib/ecm-blockchain-api/asset.rb
|
|
@@ -118,7 +121,6 @@ metadata:
|
|
|
118
121
|
homepage_uri: https://www.ecmsecure.com
|
|
119
122
|
source_code_uri: https://github.com/ecmsecure/ecm-blockchain-api
|
|
120
123
|
changelog_uri: https://github.com/ecmsecure/ecm-blockchain-api/blob/main/CHANGELOG.md
|
|
121
|
-
post_install_message:
|
|
122
124
|
rdoc_options: []
|
|
123
125
|
require_paths:
|
|
124
126
|
- lib
|
|
@@ -133,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
133
135
|
- !ruby/object:Gem::Version
|
|
134
136
|
version: '0'
|
|
135
137
|
requirements: []
|
|
136
|
-
rubygems_version: 3.
|
|
137
|
-
signing_key:
|
|
138
|
+
rubygems_version: 3.6.3
|
|
138
139
|
specification_version: 4
|
|
139
140
|
summary: ECM Distributed Ledger & Blockchain API
|
|
140
141
|
test_files: []
|