feat: avoid safe options to be serialized into the measurement (#859)

Skip options that begin with the `Safe` prefix from appearing in the
serialization of a Measurement that will be submitted to the OONI
backend.

Fixes https://github.com/ooni/probe/issues/2214
This commit is contained in:
Ain Ghazal 2022-08-17 13:48:59 +02:00 committed by GitHub
commit d50a39ae92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 2 deletions

View file

@ -46,7 +46,10 @@ type v2Nettest struct {
// Inputs contains inputs for the experiment.
Inputs []string `json:"inputs"`
// Options contains the experiment options.
// Options contains the experiment options. Any option name starting with
// `Safe` will be available for the experiment run, but omitted from
// the serialized Measurement that the experiment builder will submit
// to the OONI backend.
Options map[string]any `json:"options"`
// TestName contains the nettest name.