You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WIP specification update for OONI Run v2.1
implements ooni/backend#930
---------
Co-authored-by: Luis Díaz <ldiazn98@gmail.com>
Co-authored-by: Luis Diaz <41093870+LDiazN@users.noreply.github.com>
@@ -19,7 +19,7 @@ Below are definitions for important components of the system:
19
19
with the OONI Probe app installed allows the user to instrument their probe to
20
20
run the nettests configured by the link creator. If the OONI Probe app is not
21
21
installed, it will display a web page asking them to download the app.
22
-
22
+
23
23
***OONI Run descriptor** contains the metadata for a specific OONI Run link and
24
24
the nettest definitions: what nettests should be run and how they should be
25
25
configured (ex. what URLs should be tested)
@@ -125,31 +125,20 @@ An OONI Run link descriptor is a JSON file with the following semantics:
125
125
// `array` provides a JSON array of tests to be run.
126
126
"nettests":[{
127
127
128
-
// (optional) `array` provides a JSON array of tests to be run.
128
+
// (optional) `array` provides a JSON array of inputs for the specified test.
129
129
"inputs": [
130
130
"https://example.com/",
131
131
"https://ooni.org/"
132
132
],
133
133
134
-
// (optional) `map` options arguments provided to the specified test_name
135
-
//
136
-
// Note: this field is currently experimental. A future version of the specification
137
-
// may modify the field name or its semantics if we discover it needs changes.
138
-
"options": {
139
-
"HTTP3Enabled":true
140
-
},
141
-
142
-
// (optional) `map` settings which are sent to probe_services for retrieving the inputs vector
143
-
// It's possible to reference user configured settings by accessing the
144
-
// $settings special variable.
145
-
// In particular the content of the backend_options will be sent to the /api/v1/check-in call nested
146
-
// under the relative test_name.
147
-
//
148
-
// Note: this field is currently experimental. A future version of the specification
149
-
// may modify the field name or its semantics if we discover it needs changes.
150
-
"backend_options": {
151
-
"category_codes":"$settings.category_codes"
152
-
},
134
+
// (optional) `array` provides a richer JSON array containing extra parameters for each input.
135
+
// If provided, the length of inputs_extra should match the length of inputs.
136
+
"inputs_extra": [{
137
+
"category_code":"HUMR",
138
+
}],
139
+
140
+
// (optional) string used to specify during creation that the input list should be dynamically generated. The semantics of each string is up to the backend implementation.
141
+
"targets_name":"websites_list_prioritized",
153
142
154
143
// (optional) `bool` indicates if this test should be run as part of autoruns. Defaults to true.
155
144
//
@@ -166,21 +155,30 @@ An OONI Run link descriptor is a JSON file with the following semantics:
166
155
"test_name":"web_connectivity"
167
156
}, {
168
157
"test_name":"openvpn",
169
-
"backend_options": {
170
-
"provider":"riseupvpn"
171
-
},
158
+
"inputs": [
159
+
"https://riseup-vpn-address.com/"
160
+
],
161
+
"inputs_extra": [{
162
+
"provider":"riseupvpn",
163
+
}],
172
164
}]
173
165
}
174
166
```
175
167
176
-
In particular values starting with the `$settings` prefix should be mapped
177
-
based on user-configured preferences in the app. (Note also that this is
178
-
currently an experimental feature that we may change in the future.)
168
+
In reality there are two different views onto an OONI Run link descriptor. One
169
+
is the view from the perspective of the creator and owner of the link, the
170
+
second is from the perspective of measurement applications that need to consume
171
+
these links.
179
172
180
-
Currently the following `$settings` are defined:
173
+
The reason for this is that certain target lists need to be generated
174
+
dynamically and at runtime, while the parameters for generating these dynamic
175
+
links are specified by the creator of the link.
181
176
182
-
*`$settings.category_codes` should be replaced with the list of category codes
183
-
the user has enabled (ex. `["HUMR", "NEWS"]`.
177
+
A prime example of this would be the OONI Run link for the stock OONI Websites
178
+
card. The OONI Run descriptor, as specified from the link creator, is saying
179
+
"run the test-lists with weights applied based on coverage", while the mobile
180
+
application will then receive a prioritized and sorted list which will change
181
+
every time a new run is performed.
184
182
185
183
Based on the above specification it would be possible to re-implement the cards for the OONI Probe
186
184
dashboard as follows.
@@ -197,20 +195,17 @@ dashboard as follows.
197
195
"nettests":
198
196
[
199
197
{
200
-
"options": {
201
-
"MaxRuntime": "$settings.max_runtime",
202
-
},
203
-
"backend_settings": {
204
-
"category_codes": "$settings.category_codes"
205
-
},
198
+
"inputs": [
199
+
"https://example.com/"
200
+
],
201
+
"inputs_extra": [{
202
+
"category_code": "HUMR",
203
+
}],
206
204
"is_manual_run_enabled": true,
207
205
"is_background_run_enabled": false,
208
206
"test_name": "web_connectivity"
209
207
},
210
208
{
211
-
"backend_settings": {
212
-
"category_codes": "$settings.category_codes"
213
-
},
214
209
"is_manual_run_enabled": false,
215
210
"is_background_run_enabled": true,
216
211
"test_name": "web_connectivity"
@@ -358,7 +353,7 @@ authentication should be handled.
358
353
When you `CREATE` a new OONI RUN link, the client sends a HTTP `POST`
359
354
request conforming to the following:
360
355
361
-
`POST /api/v2/oonirun`
356
+
`POST /api/v2/oonirun/links`
362
357
363
358
```JavaScript
364
359
{
@@ -389,9 +384,10 @@ request conforming to the following:
389
384
"https://example.com/",
390
385
"https://ooni.org/"
391
386
],
392
-
"options": {
393
-
"HTTP3Enabled":true,
394
-
},
387
+
"inputs_extra": [
388
+
{},
389
+
{}
390
+
]
395
391
"test_name":"web_connectivity"
396
392
},
397
393
{
@@ -401,13 +397,20 @@ request conforming to the following:
401
397
}
402
398
```
403
399
400
+
The `inputs_extra` field should be a list of JSON objects, with each object
401
+
corresponding to an entry in the `inputs` list. This allows you to attach
402
+
additional metadata to each input. The `targets_name` field specifies the name
403
+
of a predefined target list that will be used to dynamically generate the inputs
404
+
list. This name must be recognized by the backend and agreed upon in advance
405
+
between the link creator and the backend system.
404
406
405
407
### Response status code
406
408
407
409
Upon receiving a request to create a link, the API will respond:
408
410
409
411
1. SHOULD fail with `4xx` if the request body does not parse, it is not a JSON object,
410
-
any required field is missing and/or if any present field has an invalid value.
412
+
any required field is missing and/or if any present field has an invalid value. In particular,
413
+
note that it will error when `targets_name` and `inputs` are provided at the same time in any nettest
411
414
412
415
2. if everything is okay, MUST return a `200` response.
413
416
@@ -465,7 +468,7 @@ To update an OONI Run Link, the client issues a request compliant the same as th
465
468
Below we list the extra fields that are settable from the edit request that are
466
469
not settable during CREATE.
467
470
468
-
`PUT /api/v2/oonirun/{ooni_run_link_id}`
471
+
`PUT /api/v2/oonirun/links/{ooni_run_link_id}`
469
472
470
473
```JavaScript
471
474
{
@@ -510,16 +513,16 @@ following JSON body:
510
513
511
514
## 4.3 GET the OONI Run descriptor
512
515
513
-
This operation is performed by OONI Probe clients to retrieve the descriptor of
514
-
a certain OONI Run link given the ID.
516
+
This operation is performed by OONI Probe clients to retrieve the latest
517
+
revision for a descriptor of a certain OONI Run link given the ID.
515
518
516
519
As such, this request does not require any authentication.
517
520
518
521
### Request
519
522
520
523
To retrieve an OONI Run link descriptor, the client issues a request compliant with:
521
524
522
-
`GET /api/v2/oonirun/{oonirun_link_id}`
525
+
`GET /api/v2/oonirun/links/{oonirun_link_id}`
523
526
524
527
### Response status code
525
528
@@ -541,7 +544,120 @@ following JSON body:
541
544
}
542
545
```
543
546
544
-
## 4.4 LIST the OONI Run descriptors
547
+
Note: This endpoint does not compute dynamic test lists. As a result,
548
+
nettests with `target_name` will always have an empty `inputs` field.
549
+
550
+
551
+
## 4.4 GET the OONI Run full descriptor by revision
552
+
553
+
This operation is performed by OONI Probe clients to retrieve the descriptor of
554
+
a certain OONI Run link given the ID and revision
555
+
556
+
As such, this request does not require any authentication.
557
+
558
+
### Request
559
+
560
+
To retrieve an OONI Run link descriptor, the client issues a request compliant with:
0 commit comments