baza.rb 0.11.2 → 0.13.0
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/Gemfile +4 -3
- data/Gemfile.lock +128 -50
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +1 -1
- data/REUSE.toml +0 -1
- data/Rakefile +3 -4
- data/baza.rb.gemspec +1 -1
- data/bazarb-zerocracy.json +794 -0
- data/lib/baza-rb/fake.rb +8 -8
- data/lib/baza-rb/version.rb +3 -3
- data/lib/baza-rb.rb +13 -15
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb8fe624db9622c507078a1d4018750e3c78343d2a0baa23d19904752293acde
|
|
4
|
+
data.tar.gz: 9da42159fb98666f61abe4cb12db282b3f54b8dd2729584f54b7e91e3152c7e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab3ab9f70d603b9717c0737a1a5c8396cd0e3602969adebc532d0ec806e5bf2e9ea3c92618691c796c41c5acd73db22ed1a653911c431937729c2979e52ccfa2
|
|
7
|
+
data.tar.gz: 1be3726da07593b544b7c4940f82b7ff291547a112cbc6f60292763909d95b7df396f0fe024fefbeef72b321f22c9d5a0611183ad5b55c3308a802d65132cae8
|
data/Gemfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
source 'https://rubygems.org'
|
|
@@ -8,17 +8,18 @@ gemspec
|
|
|
8
8
|
|
|
9
9
|
gem 'base64', '~>0.3', require: false
|
|
10
10
|
gem 'factbase', '~>0.16', require: false
|
|
11
|
-
gem 'minitest', '~>
|
|
11
|
+
gem 'minitest', '~>6.0', require: false
|
|
12
12
|
gem 'minitest-reporters', '~>1.7', require: false
|
|
13
13
|
gem 'online', '~>0.1', require: false
|
|
14
14
|
gem 'os', '~>1.1', require: false
|
|
15
|
+
gem 'pact', '~>1.65', require: false
|
|
15
16
|
gem 'puma', '~>7.0', require: false
|
|
16
17
|
gem 'qbash', '~>0.4', require: false
|
|
17
18
|
gem 'rack', '~>3.1', require: false
|
|
18
19
|
gem 'rackup', '~>2.2', require: false
|
|
19
20
|
gem 'rake', '~>13.2', require: false
|
|
20
21
|
gem 'random-port', '~>0.7', require: false
|
|
21
|
-
gem 'rdoc', '
|
|
22
|
+
gem 'rdoc', '7.1.0', require: false # GPL
|
|
22
23
|
gem 'rubocop', '~>1.73', require: false
|
|
23
24
|
gem 'rubocop-minitest', '~>0.38', require: false
|
|
24
25
|
gem 'rubocop-performance', '~>1.23', require: false
|
data/Gemfile.lock
CHANGED
|
@@ -21,24 +21,28 @@ GEM
|
|
|
21
21
|
public_suffix (>= 2.0.2, < 8.0)
|
|
22
22
|
ansi (1.5.0)
|
|
23
23
|
ast (2.4.3)
|
|
24
|
+
awesome_print (1.9.2)
|
|
24
25
|
backtrace (0.4.1)
|
|
25
26
|
base64 (0.3.0)
|
|
26
|
-
bigdecimal (
|
|
27
|
+
bigdecimal (4.0.1)
|
|
27
28
|
builder (3.3.0)
|
|
28
29
|
crack (1.0.1)
|
|
29
30
|
bigdecimal
|
|
30
31
|
rexml
|
|
31
|
-
date (3.5.
|
|
32
|
+
date (3.5.1)
|
|
32
33
|
decoor (0.1.0)
|
|
34
|
+
diff-lcs (1.6.2)
|
|
33
35
|
docile (1.4.1)
|
|
34
|
-
elapsed (0.2.
|
|
36
|
+
elapsed (0.2.2)
|
|
35
37
|
loog (~> 0.6)
|
|
36
38
|
tago (~> 0.1)
|
|
37
39
|
ellipsized (0.3.0)
|
|
38
|
-
erb (6.0.
|
|
40
|
+
erb (6.0.1)
|
|
39
41
|
ethon (0.15.0)
|
|
40
42
|
ffi (>= 1.15.0)
|
|
41
|
-
|
|
43
|
+
expgen (0.1.1)
|
|
44
|
+
parslet
|
|
45
|
+
factbase (0.19.3)
|
|
42
46
|
backtrace (~> 0.4)
|
|
43
47
|
decoor (~> 0.1)
|
|
44
48
|
ellipsized (~> 0.3)
|
|
@@ -53,62 +57,113 @@ GEM
|
|
|
53
57
|
faraday-net_http (>= 2.0, < 3.5)
|
|
54
58
|
json
|
|
55
59
|
logger
|
|
56
|
-
faraday-http-cache (2.
|
|
60
|
+
faraday-http-cache (2.6.1)
|
|
57
61
|
faraday (>= 0.8)
|
|
58
|
-
faraday-multipart (1.
|
|
62
|
+
faraday-multipart (1.2.0)
|
|
59
63
|
multipart-post (~> 2.0)
|
|
60
64
|
faraday-net_http (3.4.2)
|
|
61
65
|
net-http (~> 0.5)
|
|
62
|
-
faraday-retry (2.
|
|
66
|
+
faraday-retry (2.4.0)
|
|
63
67
|
faraday (~> 2.0)
|
|
64
|
-
ffi (1.17.
|
|
65
|
-
ffi (1.17.
|
|
66
|
-
ffi (1.17.
|
|
67
|
-
ffi (1.17.
|
|
68
|
+
ffi (1.17.3-aarch64-linux-gnu)
|
|
69
|
+
ffi (1.17.3-aarch64-linux-musl)
|
|
70
|
+
ffi (1.17.3-arm-linux-gnu)
|
|
71
|
+
ffi (1.17.3-arm-linux-musl)
|
|
72
|
+
ffi (1.17.3-arm64-darwin)
|
|
73
|
+
ffi (1.17.3-x86_64-darwin)
|
|
74
|
+
ffi (1.17.3-x86_64-linux-gnu)
|
|
75
|
+
ffi (1.17.3-x86_64-linux-musl)
|
|
76
|
+
find_a_port (1.0.1)
|
|
68
77
|
hashdiff (1.2.1)
|
|
69
|
-
iri (0.11.
|
|
70
|
-
json (2.
|
|
78
|
+
iri (0.11.7)
|
|
79
|
+
json (2.18.0)
|
|
80
|
+
jsonpath (1.1.5)
|
|
81
|
+
multi_json
|
|
71
82
|
language_server-protocol (3.17.0.5)
|
|
72
83
|
lint_roller (1.1.0)
|
|
73
84
|
logger (1.7.0)
|
|
74
|
-
loog (0.
|
|
85
|
+
loog (0.7.2)
|
|
86
|
+
ellipsized
|
|
75
87
|
logger (~> 1.0)
|
|
76
|
-
minitest (
|
|
88
|
+
minitest (6.0.1)
|
|
89
|
+
prism (~> 1.5)
|
|
77
90
|
minitest-reporters (1.7.1)
|
|
78
91
|
ansi
|
|
79
92
|
builder
|
|
80
93
|
minitest (>= 5.0)
|
|
81
94
|
ruby-progressbar
|
|
95
|
+
multi_json (1.19.1)
|
|
82
96
|
multipart-post (2.4.1)
|
|
83
97
|
mustermann (3.0.4)
|
|
84
98
|
ruby2_keywords (~> 0.0.1)
|
|
85
|
-
net-http (0.
|
|
99
|
+
net-http (0.9.1)
|
|
86
100
|
uri (>= 0.11.1)
|
|
87
101
|
nio4r (2.7.5)
|
|
88
|
-
nokogiri (1.
|
|
102
|
+
nokogiri (1.19.0-aarch64-linux-gnu)
|
|
89
103
|
racc (~> 1.4)
|
|
90
|
-
nokogiri (1.
|
|
104
|
+
nokogiri (1.19.0-aarch64-linux-musl)
|
|
91
105
|
racc (~> 1.4)
|
|
92
|
-
nokogiri (1.
|
|
106
|
+
nokogiri (1.19.0-arm-linux-gnu)
|
|
93
107
|
racc (~> 1.4)
|
|
94
|
-
nokogiri (1.
|
|
108
|
+
nokogiri (1.19.0-arm-linux-musl)
|
|
95
109
|
racc (~> 1.4)
|
|
96
|
-
|
|
110
|
+
nokogiri (1.19.0-arm64-darwin)
|
|
111
|
+
racc (~> 1.4)
|
|
112
|
+
nokogiri (1.19.0-x86_64-darwin)
|
|
113
|
+
racc (~> 1.4)
|
|
114
|
+
nokogiri (1.19.0-x86_64-linux-gnu)
|
|
115
|
+
racc (~> 1.4)
|
|
116
|
+
nokogiri (1.19.0-x86_64-linux-musl)
|
|
117
|
+
racc (~> 1.4)
|
|
118
|
+
online (0.3.0)
|
|
119
|
+
openssl (>= 3)
|
|
97
120
|
timeout (~> 0.4)
|
|
121
|
+
openssl (4.0.0)
|
|
98
122
|
os (1.1.4)
|
|
99
123
|
others (0.1.1)
|
|
124
|
+
pact (1.67.3)
|
|
125
|
+
jsonpath (~> 1.0)
|
|
126
|
+
pact-mock_service (~> 3.0, >= 3.3.1)
|
|
127
|
+
pact-support (~> 1.21, >= 1.21.2)
|
|
128
|
+
rack
|
|
129
|
+
rack-proxy
|
|
130
|
+
rack-test (>= 0.6.3, < 3.0.0)
|
|
131
|
+
rainbow (~> 3.1)
|
|
132
|
+
rspec (~> 3.0)
|
|
133
|
+
string_pattern (~> 2.0)
|
|
134
|
+
thor (>= 0.20, < 2.0)
|
|
135
|
+
webrick (~> 1.8)
|
|
136
|
+
zeitwerk (~> 2.3)
|
|
137
|
+
pact-mock_service (3.12.4)
|
|
138
|
+
find_a_port (~> 1.0.1)
|
|
139
|
+
json
|
|
140
|
+
logger (< 2.0)
|
|
141
|
+
pact-support (~> 1.16, >= 1.16.4)
|
|
142
|
+
rack (>= 3.0, < 4.0)
|
|
143
|
+
rackup (~> 2.0)
|
|
144
|
+
rspec (>= 2.14)
|
|
145
|
+
thor (>= 0.19, < 2.0)
|
|
146
|
+
webrick (~> 1.8)
|
|
147
|
+
pact-support (1.21.2)
|
|
148
|
+
awesome_print (~> 1.9)
|
|
149
|
+
diff-lcs (~> 1.5)
|
|
150
|
+
expgen (~> 0.1)
|
|
151
|
+
jsonpath (~> 1.0)
|
|
152
|
+
rainbow (~> 3.1.1)
|
|
153
|
+
string_pattern (~> 2.0)
|
|
100
154
|
parallel (1.27.0)
|
|
101
|
-
parser (3.3.10.
|
|
155
|
+
parser (3.3.10.1)
|
|
102
156
|
ast (~> 2.4.1)
|
|
103
157
|
racc
|
|
104
|
-
|
|
105
|
-
|
|
158
|
+
parslet (2.0.0)
|
|
159
|
+
prism (1.9.0)
|
|
160
|
+
psych (5.3.1)
|
|
106
161
|
date
|
|
107
162
|
stringio
|
|
108
|
-
public_suffix (7.0.
|
|
109
|
-
puma (7.
|
|
163
|
+
public_suffix (7.0.2)
|
|
164
|
+
puma (7.2.0)
|
|
110
165
|
nio4r (~> 2.0)
|
|
111
|
-
qbash (0.
|
|
166
|
+
qbash (0.7.2)
|
|
112
167
|
backtrace (> 0)
|
|
113
168
|
elapsed (> 0)
|
|
114
169
|
loog (> 0)
|
|
@@ -119,23 +174,40 @@ GEM
|
|
|
119
174
|
base64 (>= 0.1.0)
|
|
120
175
|
logger (>= 1.6.0)
|
|
121
176
|
rack (>= 3.0.0, < 4)
|
|
177
|
+
rack-proxy (0.7.7)
|
|
178
|
+
rack
|
|
122
179
|
rack-session (2.1.1)
|
|
123
180
|
base64 (>= 0.1.0)
|
|
124
181
|
rack (>= 3.0.0)
|
|
125
|
-
|
|
182
|
+
rack-test (2.2.0)
|
|
183
|
+
rack (>= 1.3)
|
|
184
|
+
rackup (2.3.1)
|
|
126
185
|
rack (>= 3)
|
|
127
186
|
rainbow (3.1.1)
|
|
128
187
|
rake (13.3.1)
|
|
129
188
|
random-port (0.7.6)
|
|
130
189
|
tago (~> 0.0)
|
|
131
|
-
rdoc (
|
|
190
|
+
rdoc (7.1.0)
|
|
132
191
|
erb
|
|
133
192
|
psych (>= 4.0.0)
|
|
134
193
|
tsort
|
|
135
194
|
regexp_parser (2.11.3)
|
|
136
195
|
retries (0.0.5)
|
|
137
196
|
rexml (3.4.4)
|
|
138
|
-
|
|
197
|
+
rspec (3.13.2)
|
|
198
|
+
rspec-core (~> 3.13.0)
|
|
199
|
+
rspec-expectations (~> 3.13.0)
|
|
200
|
+
rspec-mocks (~> 3.13.0)
|
|
201
|
+
rspec-core (3.13.6)
|
|
202
|
+
rspec-support (~> 3.13.0)
|
|
203
|
+
rspec-expectations (3.13.5)
|
|
204
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
205
|
+
rspec-support (~> 3.13.0)
|
|
206
|
+
rspec-mocks (3.13.7)
|
|
207
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
208
|
+
rspec-support (~> 3.13.0)
|
|
209
|
+
rspec-support (3.13.7)
|
|
210
|
+
rubocop (1.84.0)
|
|
139
211
|
json (~> 2.3)
|
|
140
212
|
language_server-protocol (~> 3.17.0.2)
|
|
141
213
|
lint_roller (~> 1.1.0)
|
|
@@ -143,12 +215,12 @@ GEM
|
|
|
143
215
|
parser (>= 3.3.0.2)
|
|
144
216
|
rainbow (>= 2.2.2, < 4.0)
|
|
145
217
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
146
|
-
rubocop-ast (>= 1.
|
|
218
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
147
219
|
ruby-progressbar (~> 1.7)
|
|
148
220
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
149
|
-
rubocop-ast (1.
|
|
221
|
+
rubocop-ast (1.49.0)
|
|
150
222
|
parser (>= 3.3.7.2)
|
|
151
|
-
prism (~> 1.
|
|
223
|
+
prism (~> 1.7)
|
|
152
224
|
rubocop-minitest (0.38.2)
|
|
153
225
|
lint_roller (~> 1.1)
|
|
154
226
|
rubocop (>= 1.75.0, < 2.0)
|
|
@@ -178,16 +250,19 @@ GEM
|
|
|
178
250
|
rack-protection (= 4.2.1)
|
|
179
251
|
rack-session (>= 2.0.0, < 3)
|
|
180
252
|
tilt (~> 2.0)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
253
|
+
string_pattern (2.3.0)
|
|
254
|
+
regexp_parser (~> 2.5, >= 2.5.0)
|
|
255
|
+
stringio (3.2.0)
|
|
256
|
+
tago (0.7.0)
|
|
257
|
+
thor (1.5.0)
|
|
258
|
+
tilt (2.7.0)
|
|
259
|
+
timeout (0.6.0)
|
|
185
260
|
tsort (0.2.0)
|
|
186
261
|
typhoeus (1.5.0)
|
|
187
262
|
ethon (>= 0.9.0, < 0.16.0)
|
|
188
263
|
unicode-display_width (3.2.0)
|
|
189
264
|
unicode-emoji (~> 4.1)
|
|
190
|
-
unicode-emoji (4.
|
|
265
|
+
unicode-emoji (4.2.0)
|
|
191
266
|
uri (1.1.1)
|
|
192
267
|
wait_for (0.1.1)
|
|
193
268
|
webmock (3.26.1)
|
|
@@ -196,32 +271,35 @@ GEM
|
|
|
196
271
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
197
272
|
webrick (1.9.2)
|
|
198
273
|
yaml (0.4.0)
|
|
199
|
-
yard (0.9.
|
|
274
|
+
yard (0.9.38)
|
|
275
|
+
zeitwerk (2.7.4)
|
|
200
276
|
|
|
201
277
|
PLATFORMS
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
x86_64-darwin
|
|
208
|
-
x86_64-linux
|
|
278
|
+
aarch64-linux-gnu
|
|
279
|
+
aarch64-linux-musl
|
|
280
|
+
arm-linux-gnu
|
|
281
|
+
arm-linux-musl
|
|
282
|
+
arm64-darwin
|
|
283
|
+
x86_64-darwin
|
|
284
|
+
x86_64-linux-gnu
|
|
285
|
+
x86_64-linux-musl
|
|
209
286
|
|
|
210
287
|
DEPENDENCIES
|
|
211
288
|
base64 (~> 0.3)
|
|
212
289
|
baza.rb!
|
|
213
290
|
factbase (~> 0.16)
|
|
214
|
-
minitest (~>
|
|
291
|
+
minitest (~> 6.0)
|
|
215
292
|
minitest-reporters (~> 1.7)
|
|
216
293
|
online (~> 0.1)
|
|
217
294
|
os (~> 1.1)
|
|
295
|
+
pact (~> 1.65)
|
|
218
296
|
puma (~> 7.0)
|
|
219
297
|
qbash (~> 0.4)
|
|
220
298
|
rack (~> 3.1)
|
|
221
299
|
rackup (~> 2.2)
|
|
222
300
|
rake (~> 13.2)
|
|
223
301
|
random-port (~> 0.7)
|
|
224
|
-
rdoc (=
|
|
302
|
+
rdoc (= 7.1.0)
|
|
225
303
|
rubocop (~> 1.73)
|
|
226
304
|
rubocop-minitest (~> 0.38)
|
|
227
305
|
rubocop-performance (~> 1.23)
|
|
@@ -235,4 +313,4 @@ DEPENDENCIES
|
|
|
235
313
|
yard (~> 0.9)
|
|
236
314
|
|
|
237
315
|
BUNDLED WITH
|
|
238
|
-
2.
|
|
316
|
+
2.6.8
|
data/LICENSE.txt
CHANGED
data/LICENSES/MIT.txt
CHANGED
data/REUSE.toml
CHANGED
data/Rakefile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require 'os'
|
|
@@ -29,17 +29,16 @@ Rake::TestTask.new(:test) do |t|
|
|
|
29
29
|
t.libs << 'lib' << 'test'
|
|
30
30
|
t.pattern = 'test/**/test_*.rb'
|
|
31
31
|
t.warning = true
|
|
32
|
-
t.verbose = false
|
|
33
32
|
t.options = ARGV.join(' ').match(/(?:^| )(-- .*)$/)
|
|
34
33
|
end
|
|
35
34
|
|
|
36
35
|
desc 'Run them via Ruby, one by one'
|
|
37
36
|
task :picks do
|
|
38
37
|
next if OS.windows?
|
|
39
|
-
|
|
38
|
+
Dir['lib/**/*.rb'].each do |f|
|
|
40
39
|
qbash(
|
|
41
40
|
"bundle exec ruby #{Shellwords.escape(f)} -- --offline",
|
|
42
|
-
|
|
41
|
+
stdout: $stdout, env: { 'RACK_ENV' => 'picks' }
|
|
43
42
|
)
|
|
44
43
|
end
|
|
45
44
|
end
|
data/baza.rb.gemspec
CHANGED
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
{
|
|
2
|
+
"consumer": {
|
|
3
|
+
"name": "BazaRb"
|
|
4
|
+
},
|
|
5
|
+
"provider": {
|
|
6
|
+
"name": "Zerocracy"
|
|
7
|
+
},
|
|
8
|
+
"interactions": [
|
|
9
|
+
{
|
|
10
|
+
"description": "a pull request",
|
|
11
|
+
"providerState": "job #42 exists",
|
|
12
|
+
"request": {
|
|
13
|
+
"method": "get",
|
|
14
|
+
"path": "/pull/42.fb",
|
|
15
|
+
"matchingRules": {
|
|
16
|
+
"$.path": {
|
|
17
|
+
"match": "regex",
|
|
18
|
+
"regex": "^\\/pull\\/[1-9][0-9]*\\.fb$"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"response": {
|
|
23
|
+
"status": 200,
|
|
24
|
+
"headers": {}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"description": "a request for CSRF token",
|
|
29
|
+
"request": {
|
|
30
|
+
"method": "get",
|
|
31
|
+
"path": "/csrf"
|
|
32
|
+
},
|
|
33
|
+
"response": {
|
|
34
|
+
"status": 200,
|
|
35
|
+
"headers": {},
|
|
36
|
+
"body": "csrf-token-example",
|
|
37
|
+
"matchingRules": {
|
|
38
|
+
"$.body": {
|
|
39
|
+
"match": "regex",
|
|
40
|
+
"regex": "^.+$"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"description": "a durable lock request",
|
|
47
|
+
"providerState": "durable #42 exists",
|
|
48
|
+
"request": {
|
|
49
|
+
"method": "post",
|
|
50
|
+
"path": "/durables/42/lock",
|
|
51
|
+
"headers": {
|
|
52
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
53
|
+
},
|
|
54
|
+
"body": "_csrf=csrf-token-example&owner=the-owner",
|
|
55
|
+
"matchingRules": {
|
|
56
|
+
"$.path": {
|
|
57
|
+
"match": "regex",
|
|
58
|
+
"regex": "^\\/durables\\/[1-9][0-9]*\\/lock$"
|
|
59
|
+
},
|
|
60
|
+
"$.body._csrf": {
|
|
61
|
+
"match": "regex",
|
|
62
|
+
"regex": "^.+$"
|
|
63
|
+
},
|
|
64
|
+
"$.body.owner": {
|
|
65
|
+
"match": "regex",
|
|
66
|
+
"regex": "^.+$"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"response": {
|
|
71
|
+
"status": 302,
|
|
72
|
+
"headers": {}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"description": "a stdout request",
|
|
77
|
+
"providerState": "job #42 exists",
|
|
78
|
+
"request": {
|
|
79
|
+
"method": "get",
|
|
80
|
+
"path": "/stdout/42.txt",
|
|
81
|
+
"matchingRules": {
|
|
82
|
+
"$.path": {
|
|
83
|
+
"match": "regex",
|
|
84
|
+
"regex": "^\\/stdout\\/[1-9][0-9]*\\.txt$"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"response": {
|
|
89
|
+
"status": 200,
|
|
90
|
+
"headers": {
|
|
91
|
+
"Content-Type": "text/plain"
|
|
92
|
+
},
|
|
93
|
+
"body": "hello, друг!"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"description": "a lock request that fails",
|
|
98
|
+
"providerState": "product \"foo\" is locked",
|
|
99
|
+
"request": {
|
|
100
|
+
"method": "post",
|
|
101
|
+
"path": "/lock/foo",
|
|
102
|
+
"headers": {
|
|
103
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
104
|
+
},
|
|
105
|
+
"body": "_csrf=csrf-token-example&owner=the-owner",
|
|
106
|
+
"matchingRules": {
|
|
107
|
+
"$.path": {
|
|
108
|
+
"match": "regex",
|
|
109
|
+
"regex": "^\\/lock\\/[a-z0-9]+$"
|
|
110
|
+
},
|
|
111
|
+
"$.body._csrf": {
|
|
112
|
+
"match": "regex",
|
|
113
|
+
"regex": "^.+$"
|
|
114
|
+
},
|
|
115
|
+
"$.body.owner": {
|
|
116
|
+
"match": "regex",
|
|
117
|
+
"regex": "^.+$"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"response": {
|
|
122
|
+
"status": 409,
|
|
123
|
+
"headers": {}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"description": "a lock request",
|
|
128
|
+
"providerState": "product \"foo\" exists",
|
|
129
|
+
"request": {
|
|
130
|
+
"method": "post",
|
|
131
|
+
"path": "/lock/foo",
|
|
132
|
+
"headers": {
|
|
133
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
134
|
+
},
|
|
135
|
+
"body": "_csrf=csrf-token-example&owner=the-owner",
|
|
136
|
+
"matchingRules": {
|
|
137
|
+
"$.path": {
|
|
138
|
+
"match": "regex",
|
|
139
|
+
"regex": "^\\/lock\\/[a-z0-9]+$"
|
|
140
|
+
},
|
|
141
|
+
"$.body._csrf": {
|
|
142
|
+
"match": "regex",
|
|
143
|
+
"regex": "^.+$"
|
|
144
|
+
},
|
|
145
|
+
"$.body.owner": {
|
|
146
|
+
"match": "regex",
|
|
147
|
+
"regex": "^.+$"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"response": {
|
|
152
|
+
"status": 302,
|
|
153
|
+
"headers": {}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"description": "an exit code request",
|
|
158
|
+
"providerState": "job #42 exists",
|
|
159
|
+
"request": {
|
|
160
|
+
"method": "get",
|
|
161
|
+
"path": "/exit/42.txt",
|
|
162
|
+
"matchingRules": {
|
|
163
|
+
"$.path": {
|
|
164
|
+
"match": "regex",
|
|
165
|
+
"regex": "^\\/exit\\/[1-9][0-9]*\\.txt$"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"response": {
|
|
170
|
+
"status": 200,
|
|
171
|
+
"headers": {
|
|
172
|
+
"Content-Type": "text/plain"
|
|
173
|
+
},
|
|
174
|
+
"body": "0"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"description": "a durable load request for empty content",
|
|
179
|
+
"providerState": "durable is empty",
|
|
180
|
+
"request": {
|
|
181
|
+
"method": "get",
|
|
182
|
+
"path": "/durables/42",
|
|
183
|
+
"matchingRules": {
|
|
184
|
+
"$.path": {
|
|
185
|
+
"match": "regex",
|
|
186
|
+
"regex": "^\\/durables\\/[1-9][0-9]*$"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"response": {
|
|
191
|
+
"status": 206,
|
|
192
|
+
"headers": {
|
|
193
|
+
"Content-Range": "bytes 0-0/0"
|
|
194
|
+
},
|
|
195
|
+
"body": ""
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"description": "a durable unlock request",
|
|
200
|
+
"providerState": "durable #42 is locked",
|
|
201
|
+
"request": {
|
|
202
|
+
"method": "post",
|
|
203
|
+
"path": "/durables/42/unlock",
|
|
204
|
+
"headers": {
|
|
205
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
206
|
+
},
|
|
207
|
+
"body": "_csrf=csrf-token-example&owner=the-owner",
|
|
208
|
+
"matchingRules": {
|
|
209
|
+
"$.path": {
|
|
210
|
+
"match": "regex",
|
|
211
|
+
"regex": "^\\/durables\\/[1-9][0-9]*\\/unlock$"
|
|
212
|
+
},
|
|
213
|
+
"$.body._csrf": {
|
|
214
|
+
"match": "regex",
|
|
215
|
+
"regex": "^.+$"
|
|
216
|
+
},
|
|
217
|
+
"$.body.owner": {
|
|
218
|
+
"match": "regex",
|
|
219
|
+
"regex": "^.+$"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"response": {
|
|
224
|
+
"status": 302,
|
|
225
|
+
"headers": {}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"description": "a finished check request",
|
|
230
|
+
"providerState": "job #42 exists",
|
|
231
|
+
"request": {
|
|
232
|
+
"method": "get",
|
|
233
|
+
"path": "/finished/42",
|
|
234
|
+
"matchingRules": {
|
|
235
|
+
"$.path": {
|
|
236
|
+
"match": "regex",
|
|
237
|
+
"regex": "^\\/finished\\/[1-9][0-9]*$"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"response": {
|
|
242
|
+
"status": 200,
|
|
243
|
+
"headers": {
|
|
244
|
+
"Content-Type": "text/plain"
|
|
245
|
+
},
|
|
246
|
+
"body": "yes",
|
|
247
|
+
"matchingRules": {
|
|
248
|
+
"$.body": {
|
|
249
|
+
"match": "regex",
|
|
250
|
+
"regex": "^yes|no$"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"description": "an enter request with cached result",
|
|
257
|
+
"providerState": "result for the \"bar\" badge for job #42 and \"foo\" product exists as \"before\"",
|
|
258
|
+
"request": {
|
|
259
|
+
"method": "get",
|
|
260
|
+
"path": "/result",
|
|
261
|
+
"query": "badge=bar",
|
|
262
|
+
"matchingRules": {
|
|
263
|
+
"$.query.badge[0]": {
|
|
264
|
+
"match": "regex",
|
|
265
|
+
"regex": "^[a-z0-9.]+$"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"response": {
|
|
270
|
+
"status": 200,
|
|
271
|
+
"headers": {
|
|
272
|
+
"Content-Type": "text/plain"
|
|
273
|
+
},
|
|
274
|
+
"body": "before",
|
|
275
|
+
"matchingRules": {
|
|
276
|
+
"$.body": {
|
|
277
|
+
"match": "regex",
|
|
278
|
+
"regex": "^.+$"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"description": "a durable find request that returns not found",
|
|
285
|
+
"providerState": "durable \"bar.txt\" does not exist for the \"foo\" product",
|
|
286
|
+
"request": {
|
|
287
|
+
"method": "get",
|
|
288
|
+
"path": "/durable-find",
|
|
289
|
+
"query": "file=bar.txt&pname=foo",
|
|
290
|
+
"matchingRules": {
|
|
291
|
+
"$.query.file[0]": {
|
|
292
|
+
"match": "regex",
|
|
293
|
+
"regex": "[a-z0-9.]+"
|
|
294
|
+
},
|
|
295
|
+
"$.query.pname[0]": {
|
|
296
|
+
"match": "regex",
|
|
297
|
+
"regex": "^[a-z0-9]+$"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"response": {
|
|
302
|
+
"status": 404,
|
|
303
|
+
"headers": {}
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"description": "a push request",
|
|
308
|
+
"providerState": "product \"foo\" exists",
|
|
309
|
+
"request": {
|
|
310
|
+
"method": "put",
|
|
311
|
+
"path": "/push/foo",
|
|
312
|
+
"matchingRules": {
|
|
313
|
+
"$.path": {
|
|
314
|
+
"match": "regex",
|
|
315
|
+
"regex": "\\/push\\/[a-z0-9]+"
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"response": {
|
|
320
|
+
"status": 200,
|
|
321
|
+
"headers": {},
|
|
322
|
+
"body": "42",
|
|
323
|
+
"matchingRules": {
|
|
324
|
+
"$.body": {
|
|
325
|
+
"match": "regex",
|
|
326
|
+
"regex": "^[1-9][0-9]*$"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"description": "an enter request without cached result",
|
|
333
|
+
"providerState": "result for the \"bar\" badge for \"foo\" product not exists",
|
|
334
|
+
"request": {
|
|
335
|
+
"method": "get",
|
|
336
|
+
"path": "/result",
|
|
337
|
+
"query": "badge=bar",
|
|
338
|
+
"matchingRules": {
|
|
339
|
+
"$.query.badge[0]": {
|
|
340
|
+
"match": "regex",
|
|
341
|
+
"regex": "^[a-z0-9.]+$"
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"response": {
|
|
346
|
+
"status": 204,
|
|
347
|
+
"headers": {
|
|
348
|
+
"Content-Type": "text/plain"
|
|
349
|
+
},
|
|
350
|
+
"body": ""
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"description": "a valve creation request",
|
|
355
|
+
"providerState": "job #42 exists for the \"foo\" product and valve \"bar\" not exists",
|
|
356
|
+
"request": {
|
|
357
|
+
"method": "post",
|
|
358
|
+
"path": "/valves",
|
|
359
|
+
"query": "job=42",
|
|
360
|
+
"headers": {
|
|
361
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
362
|
+
},
|
|
363
|
+
"body": "_csrf=csrf-token-example&badge=bar&pname=foo&result=after&why=no+reason",
|
|
364
|
+
"matchingRules": {
|
|
365
|
+
"$.query.job[0]": {
|
|
366
|
+
"match": "regex",
|
|
367
|
+
"regex": "^[0-9]+$"
|
|
368
|
+
},
|
|
369
|
+
"$.body._csrf": {
|
|
370
|
+
"match": "regex",
|
|
371
|
+
"regex": "^.+$"
|
|
372
|
+
},
|
|
373
|
+
"$.body.badge": {
|
|
374
|
+
"match": "regex",
|
|
375
|
+
"regex": "^[a-z0-9.-]+$"
|
|
376
|
+
},
|
|
377
|
+
"$.body.pname": {
|
|
378
|
+
"match": "regex",
|
|
379
|
+
"regex": "^[a-z0-9]+$"
|
|
380
|
+
},
|
|
381
|
+
"$.body.result": {
|
|
382
|
+
"match": "regex",
|
|
383
|
+
"regex": "^.+$"
|
|
384
|
+
},
|
|
385
|
+
"$.body.why": {
|
|
386
|
+
"match": "regex",
|
|
387
|
+
"regex": "^.+$"
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"response": {
|
|
392
|
+
"status": 302,
|
|
393
|
+
"headers": {}
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"description": "a fee payment request",
|
|
398
|
+
"providerState": "user is logged in",
|
|
399
|
+
"request": {
|
|
400
|
+
"method": "post",
|
|
401
|
+
"path": "/account/fee",
|
|
402
|
+
"headers": {
|
|
403
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
404
|
+
},
|
|
405
|
+
"body": "_csrf=csrf-token-example&amount=42.77&job=42&summary=the+summary&tab=unknown",
|
|
406
|
+
"matchingRules": {
|
|
407
|
+
"$.body._csrf": {
|
|
408
|
+
"match": "regex",
|
|
409
|
+
"regex": "^.+$"
|
|
410
|
+
},
|
|
411
|
+
"$.body.amount": {
|
|
412
|
+
"match": "regex",
|
|
413
|
+
"regex": "^[0-9]+\\.[0-9]+$"
|
|
414
|
+
},
|
|
415
|
+
"$.body.job": {
|
|
416
|
+
"match": "regex",
|
|
417
|
+
"regex": "^[0-9]+$"
|
|
418
|
+
},
|
|
419
|
+
"$.body.summary": {
|
|
420
|
+
"match": "regex",
|
|
421
|
+
"regex": "^.+$"
|
|
422
|
+
},
|
|
423
|
+
"$.body.tab": {
|
|
424
|
+
"match": "regex",
|
|
425
|
+
"regex": "^[a-z]+$"
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
"response": {
|
|
430
|
+
"status": 302,
|
|
431
|
+
"headers": {
|
|
432
|
+
"X-Zerocracy-ReceiptId": "42"
|
|
433
|
+
},
|
|
434
|
+
"matchingRules": {
|
|
435
|
+
"$.headers.X-Zerocracy-ReceiptId": {
|
|
436
|
+
"match": "regex",
|
|
437
|
+
"regex": "^[1-9][0-9]*$"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"description": "a verification verdict request",
|
|
444
|
+
"providerState": "job 42 exists",
|
|
445
|
+
"request": {
|
|
446
|
+
"method": "get",
|
|
447
|
+
"path": "/jobs/42/verified.txt",
|
|
448
|
+
"matchingRules": {
|
|
449
|
+
"$.path": {
|
|
450
|
+
"match": "regex",
|
|
451
|
+
"regex": "^\\/jobs\\/[1-9][0-9]*\\/verified\\.txt$"
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
"response": {
|
|
456
|
+
"status": 200,
|
|
457
|
+
"headers": {
|
|
458
|
+
"Content-Type": "text/plain"
|
|
459
|
+
},
|
|
460
|
+
"body": "done"
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"description": "a whoami request",
|
|
465
|
+
"providerState": "user is logged in",
|
|
466
|
+
"request": {
|
|
467
|
+
"method": "get",
|
|
468
|
+
"path": "/whoami"
|
|
469
|
+
},
|
|
470
|
+
"response": {
|
|
471
|
+
"status": 200,
|
|
472
|
+
"headers": {
|
|
473
|
+
"Content-Type": "text/plain"
|
|
474
|
+
},
|
|
475
|
+
"body": "jeff",
|
|
476
|
+
"matchingRules": {
|
|
477
|
+
"$.body": {
|
|
478
|
+
"match": "regex",
|
|
479
|
+
"regex": "^[a-z0-9-]+$"
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"description": "a durable find request",
|
|
486
|
+
"providerState": "durable \"bar.txt\" exists for the \"foo\" product",
|
|
487
|
+
"request": {
|
|
488
|
+
"method": "get",
|
|
489
|
+
"path": "/durable-find",
|
|
490
|
+
"query": "file=bar.txt&pname=foo",
|
|
491
|
+
"matchingRules": {
|
|
492
|
+
"$.query.file[0]": {
|
|
493
|
+
"match": "regex",
|
|
494
|
+
"regex": "[a-z0-9.]+"
|
|
495
|
+
},
|
|
496
|
+
"$.query.pname[0]": {
|
|
497
|
+
"match": "regex",
|
|
498
|
+
"regex": "^[a-z0-9]+$"
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
"response": {
|
|
503
|
+
"status": 200,
|
|
504
|
+
"headers": {},
|
|
505
|
+
"body": "42",
|
|
506
|
+
"matchingRules": {
|
|
507
|
+
"$.body": {
|
|
508
|
+
"match": "regex",
|
|
509
|
+
"regex": "^[1-9][0-9]*$"
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"description": "a durable save request",
|
|
516
|
+
"providerState": "durable #42 exists",
|
|
517
|
+
"request": {
|
|
518
|
+
"method": "put",
|
|
519
|
+
"path": "/durables/42",
|
|
520
|
+
"matchingRules": {
|
|
521
|
+
"$.path": {
|
|
522
|
+
"match": "regex",
|
|
523
|
+
"regex": "^\\/durables\\/[1-9][0-9]*$"
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
"response": {
|
|
528
|
+
"status": 200,
|
|
529
|
+
"headers": {},
|
|
530
|
+
"body": ""
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"description": "a recent job check",
|
|
535
|
+
"providerState": "job #42 exists",
|
|
536
|
+
"request": {
|
|
537
|
+
"method": "get",
|
|
538
|
+
"path": "/recent/foo.txt",
|
|
539
|
+
"matchingRules": {
|
|
540
|
+
"$.path": {
|
|
541
|
+
"match": "regex",
|
|
542
|
+
"regex": "\\/recent\\/[a-z0-9]+\\.txt"
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
"response": {
|
|
547
|
+
"status": 200,
|
|
548
|
+
"headers": {
|
|
549
|
+
"Content-Type": "text/plain"
|
|
550
|
+
},
|
|
551
|
+
"body": "42",
|
|
552
|
+
"matchingRules": {
|
|
553
|
+
"$.body": {
|
|
554
|
+
"match": "regex",
|
|
555
|
+
"regex": "^[1-9][0-9]*$"
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"description": "a balance request",
|
|
562
|
+
"providerState": "user is logged in",
|
|
563
|
+
"request": {
|
|
564
|
+
"method": "get",
|
|
565
|
+
"path": "/account/balance"
|
|
566
|
+
},
|
|
567
|
+
"response": {
|
|
568
|
+
"status": 200,
|
|
569
|
+
"headers": {
|
|
570
|
+
"Content-Type": "text/plain"
|
|
571
|
+
},
|
|
572
|
+
"body": "42.33",
|
|
573
|
+
"matchingRules": {
|
|
574
|
+
"$.body": {
|
|
575
|
+
"match": "regex",
|
|
576
|
+
"regex": "^[0-9]+\\.[0-9]+$"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"description": "a transfer payment request",
|
|
583
|
+
"providerState": "user is logged in",
|
|
584
|
+
"request": {
|
|
585
|
+
"method": "post",
|
|
586
|
+
"path": "/account/transfer",
|
|
587
|
+
"headers": {
|
|
588
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
589
|
+
},
|
|
590
|
+
"body": "_csrf=csrf-token-example&human=jeff&amount=42.50&summary=for+fun",
|
|
591
|
+
"matchingRules": {
|
|
592
|
+
"$.body._csrf": {
|
|
593
|
+
"match": "regex",
|
|
594
|
+
"regex": "^.+$"
|
|
595
|
+
},
|
|
596
|
+
"$.body.human": {
|
|
597
|
+
"match": "regex",
|
|
598
|
+
"regex": "^[a-z0-9-]+$"
|
|
599
|
+
},
|
|
600
|
+
"$.body.amount": {
|
|
601
|
+
"match": "regex",
|
|
602
|
+
"regex": "^[0-9]+\\.[0-9]+$"
|
|
603
|
+
},
|
|
604
|
+
"$.body.summary": {
|
|
605
|
+
"match": "regex",
|
|
606
|
+
"regex": "^.+$"
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
"response": {
|
|
611
|
+
"status": 302,
|
|
612
|
+
"headers": {
|
|
613
|
+
"X-Zerocracy-ReceiptId": "42"
|
|
614
|
+
},
|
|
615
|
+
"matchingRules": {
|
|
616
|
+
"$.headers.X-Zerocracy-ReceiptId": {
|
|
617
|
+
"match": "regex",
|
|
618
|
+
"regex": "^[1-9][0-9]*$"
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"description": "an exists check",
|
|
625
|
+
"providerState": "product \"foo\" exists",
|
|
626
|
+
"request": {
|
|
627
|
+
"method": "get",
|
|
628
|
+
"path": "/exists/foo",
|
|
629
|
+
"matchingRules": {
|
|
630
|
+
"$.path": {
|
|
631
|
+
"match": "regex",
|
|
632
|
+
"regex": "^\\/exists\\/[a-z0-9]+$"
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
"response": {
|
|
637
|
+
"status": 200,
|
|
638
|
+
"headers": {
|
|
639
|
+
"Content-Type": "text/plain"
|
|
640
|
+
},
|
|
641
|
+
"body": "yes"
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"description": "a pop request with no job",
|
|
646
|
+
"providerState": "queue is empty",
|
|
647
|
+
"request": {
|
|
648
|
+
"method": "get",
|
|
649
|
+
"path": "/pop",
|
|
650
|
+
"query": "owner=me",
|
|
651
|
+
"matchingRules": {
|
|
652
|
+
"$.query.owner[0]": {
|
|
653
|
+
"match": "regex",
|
|
654
|
+
"regex": "^.+$"
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
"response": {
|
|
659
|
+
"status": 204,
|
|
660
|
+
"headers": {}
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"description": "an unlock request",
|
|
665
|
+
"providerState": "job exists",
|
|
666
|
+
"request": {
|
|
667
|
+
"method": "post",
|
|
668
|
+
"path": "/unlock/foo",
|
|
669
|
+
"headers": {
|
|
670
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
671
|
+
},
|
|
672
|
+
"body": "_csrf=csrf-token-example&owner=the-owner",
|
|
673
|
+
"matchingRules": {
|
|
674
|
+
"$.path": {
|
|
675
|
+
"match": "regex",
|
|
676
|
+
"regex": "^\\/unlock\\/.+$"
|
|
677
|
+
},
|
|
678
|
+
"$.body._csrf": {
|
|
679
|
+
"match": "regex",
|
|
680
|
+
"regex": "^.+$"
|
|
681
|
+
},
|
|
682
|
+
"$.body.owner": {
|
|
683
|
+
"match": "regex",
|
|
684
|
+
"regex": "^.+$"
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
"response": {
|
|
689
|
+
"status": 302,
|
|
690
|
+
"headers": {}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"description": "a transfer payment request with job",
|
|
695
|
+
"providerState": "user is logged in",
|
|
696
|
+
"request": {
|
|
697
|
+
"method": "post",
|
|
698
|
+
"path": "/account/transfer",
|
|
699
|
+
"headers": {
|
|
700
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
701
|
+
},
|
|
702
|
+
"body": "_csrf=csrf-token-example&job=555&human=jeff&amount=42.50&summary=for+fun",
|
|
703
|
+
"matchingRules": {
|
|
704
|
+
"$.body._csrf": {
|
|
705
|
+
"match": "regex",
|
|
706
|
+
"regex": "^.+$"
|
|
707
|
+
},
|
|
708
|
+
"$.body.job": {
|
|
709
|
+
"match": "regex",
|
|
710
|
+
"regex": "^[0-9]+$"
|
|
711
|
+
},
|
|
712
|
+
"$.body.human": {
|
|
713
|
+
"match": "regex",
|
|
714
|
+
"regex": "^[a-z0-9-]+$"
|
|
715
|
+
},
|
|
716
|
+
"$.body.amount": {
|
|
717
|
+
"match": "regex",
|
|
718
|
+
"regex": "^[0-9]+\\.[0-9]+$"
|
|
719
|
+
},
|
|
720
|
+
"$.body.summary": {
|
|
721
|
+
"match": "regex",
|
|
722
|
+
"regex": "^.+$"
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
"response": {
|
|
727
|
+
"status": 302,
|
|
728
|
+
"headers": {
|
|
729
|
+
"X-Zerocracy-ReceiptId": "42"
|
|
730
|
+
},
|
|
731
|
+
"matchingRules": {
|
|
732
|
+
"$.headers.X-Zerocracy-ReceiptId": {
|
|
733
|
+
"match": "regex",
|
|
734
|
+
"regex": "^[1-9][0-9]*$"
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"description": "a durable load request",
|
|
741
|
+
"providerState": "durable #42 exists",
|
|
742
|
+
"request": {
|
|
743
|
+
"method": "get",
|
|
744
|
+
"path": "/durables/42",
|
|
745
|
+
"matchingRules": {
|
|
746
|
+
"$.path": {
|
|
747
|
+
"match": "regex",
|
|
748
|
+
"regex": "^\\/durables\\/[1-9][0-9]*$"
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
},
|
|
752
|
+
"response": {
|
|
753
|
+
"status": 200,
|
|
754
|
+
"headers": {},
|
|
755
|
+
"body": "some data",
|
|
756
|
+
"matchingRules": {
|
|
757
|
+
"$.body": {
|
|
758
|
+
"match": "regex",
|
|
759
|
+
"regex": "^.+$"
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"description": "a finish request",
|
|
766
|
+
"providerState": "job #42 exists",
|
|
767
|
+
"request": {
|
|
768
|
+
"method": "put",
|
|
769
|
+
"path": "/finish",
|
|
770
|
+
"query": "id=42",
|
|
771
|
+
"matchingRules": {
|
|
772
|
+
"$.query.id[0]": {
|
|
773
|
+
"match": "regex",
|
|
774
|
+
"regex": "^[1-9][0-9]*$"
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
"response": {
|
|
779
|
+
"status": 200,
|
|
780
|
+
"headers": {}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
],
|
|
784
|
+
"metadata": {
|
|
785
|
+
"pactSpecification": {
|
|
786
|
+
"version": "2.0.0"
|
|
787
|
+
},
|
|
788
|
+
"client": {
|
|
789
|
+
"name": "BazaRb",
|
|
790
|
+
"version": "0.0.0",
|
|
791
|
+
"date": "2026-02-02T13:19:40Z"
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
data/lib/baza-rb/fake.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require 'factbase'
|
|
@@ -19,7 +19,7 @@ require_relative 'version'
|
|
|
19
19
|
# assert_equal 42, baza.push('test-job', 'data', [])
|
|
20
20
|
#
|
|
21
21
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
22
|
-
# Copyright:: Copyright (c) 2024-
|
|
22
|
+
# Copyright:: Copyright (c) 2024-2026 Yegor Bugayenko
|
|
23
23
|
# License:: MIT
|
|
24
24
|
class BazaRb::Fake
|
|
25
25
|
# Get GitHub login name of the logged in user.
|
|
@@ -125,22 +125,22 @@ class BazaRb::Fake
|
|
|
125
125
|
|
|
126
126
|
# Find a single durable.
|
|
127
127
|
#
|
|
128
|
-
# @param [String]
|
|
128
|
+
# @param [String] pname The name of the job on the server
|
|
129
129
|
# @param [String] file The path to the file to upload
|
|
130
130
|
# @return [Integer] Always returns 42 as the fake durable ID
|
|
131
|
-
def durable_find(
|
|
132
|
-
assert_name(
|
|
131
|
+
def durable_find(pname, file)
|
|
132
|
+
assert_name(pname)
|
|
133
133
|
assert_file(file)
|
|
134
134
|
42
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
# Place a single durable file on the server.
|
|
138
138
|
#
|
|
139
|
-
# @param [String]
|
|
139
|
+
# @param [String] pname The name of the job on the server
|
|
140
140
|
# @param [String] file The path to the file to upload
|
|
141
141
|
# @return [Integer] Always returns 42 as the fake durable ID
|
|
142
|
-
def durable_place(
|
|
143
|
-
assert_name(
|
|
142
|
+
def durable_place(pname, file)
|
|
143
|
+
assert_name(pname)
|
|
144
144
|
assert_file(file)
|
|
145
145
|
42
|
|
146
146
|
end
|
data/lib/baza-rb/version.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
# Just a version.
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
# other packages (thus failing the build).
|
|
11
11
|
#
|
|
12
12
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
13
|
-
# Copyright:: Copyright (c) 2024-
|
|
13
|
+
# Copyright:: Copyright (c) 2024-2026 Yegor Bugayenko
|
|
14
14
|
# License:: MIT
|
|
15
15
|
class BazaRb
|
|
16
|
-
VERSION = '0.
|
|
16
|
+
VERSION = '0.13.0'
|
|
17
17
|
end
|
data/lib/baza-rb.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
6
|
require 'base64'
|
|
@@ -29,7 +29,7 @@ require_relative 'baza-rb/version'
|
|
|
29
29
|
# puts baza.balance # => 100.5
|
|
30
30
|
#
|
|
31
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
32
|
-
# Copyright:: Copyright (c) 2024-
|
|
32
|
+
# Copyright:: Copyright (c) 2024-2026 Yegor Bugayenko
|
|
33
33
|
# License:: MIT
|
|
34
34
|
class BazaRb
|
|
35
35
|
# How big are the chunks we send, by default, in bytes.
|
|
@@ -311,10 +311,9 @@ class BazaRb
|
|
|
311
311
|
id = nil
|
|
312
312
|
elapsed(@loog, level: Logger::INFO) do
|
|
313
313
|
ret = post(
|
|
314
|
-
home.append('
|
|
314
|
+
home.append('durable-place'),
|
|
315
315
|
{
|
|
316
316
|
'pname' => pname,
|
|
317
|
-
'jname' => pname,
|
|
318
317
|
'file' => File.basename(file),
|
|
319
318
|
'zip' => File.open(file, 'rb')
|
|
320
319
|
}
|
|
@@ -411,7 +410,7 @@ class BazaRb
|
|
|
411
410
|
raise 'The "file" may not be empty' if file.empty?
|
|
412
411
|
id = nil
|
|
413
412
|
elapsed(@loog, level: Logger::INFO) do
|
|
414
|
-
ret = get(home.append('
|
|
413
|
+
ret = get(home.append('durable-find').add(file:, pname:), [200, 404])
|
|
415
414
|
if ret.code == 200
|
|
416
415
|
id = ret.body.to_i
|
|
417
416
|
throw :"Found durable ##{id} for job \"#{pname}\" file \"#{file}\" at #{@host}"
|
|
@@ -473,10 +472,10 @@ class BazaRb
|
|
|
473
472
|
ret = post(
|
|
474
473
|
home.append('account').append('fee'),
|
|
475
474
|
{
|
|
476
|
-
'tab' => tab,
|
|
477
475
|
'amount' => format('%0.6f', amount),
|
|
476
|
+
'job' => job.to_s,
|
|
478
477
|
'summary' => summary,
|
|
479
|
-
'
|
|
478
|
+
'tab' => tab
|
|
480
479
|
}
|
|
481
480
|
)
|
|
482
481
|
id = ret.headers['X-Zerocracy-ReceiptId'].to_i
|
|
@@ -542,19 +541,18 @@ class BazaRb
|
|
|
542
541
|
def enter(pname, badge, why, job)
|
|
543
542
|
elapsed(@loog, good: "Entered valve #{badge} to #{pname}") do
|
|
544
543
|
retry_it do
|
|
545
|
-
ret = get(home.append('
|
|
544
|
+
ret = get(home.append('result').add(badge:), [200, 204])
|
|
546
545
|
return ret.body if ret.code == 200
|
|
547
546
|
r = yield
|
|
548
|
-
uri = home.append('valves')
|
|
547
|
+
uri = home.append('valves')
|
|
549
548
|
uri = uri.add(job:) unless job.nil?
|
|
550
549
|
post(
|
|
551
550
|
uri,
|
|
552
551
|
{
|
|
553
|
-
'name' => pname,
|
|
554
|
-
'pname' => pname,
|
|
555
552
|
'badge' => badge,
|
|
556
|
-
'
|
|
557
|
-
'result' => r.to_s
|
|
553
|
+
'pname' => pname,
|
|
554
|
+
'result' => r.to_s,
|
|
555
|
+
'why' => why
|
|
558
556
|
}
|
|
559
557
|
)
|
|
560
558
|
r
|
|
@@ -708,7 +706,7 @@ class BazaRb
|
|
|
708
706
|
if ret.code >= 500 && attempt < @retries
|
|
709
707
|
attempt += 1
|
|
710
708
|
seconds = @pause * (2**attempt)
|
|
711
|
-
@loog.info("Server seems to be in trouble,
|
|
709
|
+
@loog.info("Server seems to be in trouble (#{ret.code}), sleep #{seconds}s (attempt no.#{attempt})...")
|
|
712
710
|
sleep(seconds)
|
|
713
711
|
next
|
|
714
712
|
end
|
|
@@ -806,7 +804,7 @@ class BazaRb
|
|
|
806
804
|
retry_if_server_failed do
|
|
807
805
|
Typhoeus::Request.post(
|
|
808
806
|
uri.to_s,
|
|
809
|
-
body: params.merge('_csrf' => csrf),
|
|
807
|
+
body: params.merge('_csrf' => csrf).sort.to_h,
|
|
810
808
|
headers:,
|
|
811
809
|
connecttimeout: @timeout,
|
|
812
810
|
timeout: @timeout
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: baza.rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
@@ -181,6 +181,7 @@ files:
|
|
|
181
181
|
- REUSE.toml
|
|
182
182
|
- Rakefile
|
|
183
183
|
- baza.rb.gemspec
|
|
184
|
+
- bazarb-zerocracy.json
|
|
184
185
|
- lib/baza-rb.rb
|
|
185
186
|
- lib/baza-rb/fake.rb
|
|
186
187
|
- lib/baza-rb/version.rb
|