fix(datafmt): sync measurexlite and v0.5 with previous code (#942)

* fix(model/archival.go): more optional keys

Basically, `t0` and `transaction_id` should be optional. Version 0.4.x
of web_connectivity should not include them, version 0.5.x should.

There is a technical reason why v0.4.x should not include them. The code
it is based on, tracex, does not record these two fields.

Whereas, v0.5.x, uses measurexlite, which records these two fields.

Part of https://github.com/ooni/probe/issues/2238

* fix(webconnectivity@v0.5): add more fields

This diff adds the following fields to webconnectivity@v0.5:

1. agent, always set to "redirect" (legacy field);

2. client_resolver, properly initialized w/ the resolver's IPv4 address;

3. retries, legacy field always set to null;

4. socksproxy, legacy field always set to null.

Part of https://github.com/ooni/probe/issues/2238

* fix(webconnectivity@v0.5): register extensions

The general idea behind this field is that we would be able
in the future to tweak the data model for some fields, by declaring
we're using a later version, so it seems useful to add it.

See https://github.com/ooni/probe/issues/2238

* fix(measurexlite): use tcp or quic for tls handshake network

This diff fixes a bug where measurexlite was using "tls" as the
protocol for the TLS handshake when using TCP.

While this choice _could_ make sense, the rest of the code we have
written so far uses "tcp" instead.

Using "tcp" makes more sense because it allows you to search for
the same endpoint across different events by checking for the same
network and for the same endpoint rather than special casing TLS
handshakes for using "tls" when the endpoint is "tcp".

See https://github.com/ooni/probe/issues/2238

* chore: run alltests.yml for "alltestsbuild" branches

Part of https://github.com/ooni/probe/issues/2238
This commit is contained in:
Simone Basso
2022-09-08 10:02:47 +02:00
committed by GitHub
parent 6ae5b5fce4
commit 39cb5959c9
6 changed files with 74 additions and 35 deletions
+10 -10
View File
@@ -123,9 +123,9 @@ type ArchivalDNSLookupResult struct {
ResolverHostname *string `json:"resolver_hostname"`
ResolverPort *string `json:"resolver_port"`
ResolverAddress string `json:"resolver_address"`
T0 float64 `json:"t0"`
T0 float64 `json:"t0,omitempty"`
T float64 `json:"t"`
TransactionID int64 `json:"transaction_id"`
TransactionID int64 `json:"transaction_id,omitempty"`
}
// ArchivalDNSAnswer is a DNS answer.
@@ -150,9 +150,9 @@ type ArchivalTCPConnectResult struct {
IP string `json:"ip"`
Port int `json:"port"`
Status ArchivalTCPConnectStatus `json:"status"`
T0 float64 `json:"t0"`
T0 float64 `json:"t0,omitempty"`
T float64 `json:"t"`
TransactionID int64 `json:"transaction_id"`
TransactionID int64 `json:"transaction_id,omitempty"`
}
// ArchivalTCPConnectStatus is the status of ArchivalTCPConnectResult.
@@ -178,11 +178,11 @@ type ArchivalTLSOrQUICHandshakeResult struct {
NoTLSVerify bool `json:"no_tls_verify"`
PeerCertificates []ArchivalMaybeBinaryData `json:"peer_certificates"`
ServerName string `json:"server_name"`
T0 float64 `json:"t0"`
T0 float64 `json:"t0,omitempty"`
T float64 `json:"t"`
Tags []string `json:"tags"`
TLSVersion string `json:"tls_version"`
TransactionID int64 `json:"transaction_id"`
TransactionID int64 `json:"transaction_id,omitempty"`
}
//
@@ -199,9 +199,9 @@ type ArchivalHTTPRequestResult struct {
Failure *string `json:"failure"`
Request ArchivalHTTPRequest `json:"request"`
Response ArchivalHTTPResponse `json:"response"`
T0 float64 `json:"t0"`
T0 float64 `json:"t0,omitempty"`
T float64 `json:"t"`
TransactionID int64 `json:"transaction_id"`
TransactionID int64 `json:"transaction_id,omitempty"`
}
// ArchivalHTTPRequest contains an HTTP request.
@@ -322,8 +322,8 @@ type ArchivalNetworkEvent struct {
NumBytes int64 `json:"num_bytes,omitempty"`
Operation string `json:"operation"`
Proto string `json:"proto,omitempty"`
T0 float64 `json:"t0"`
T0 float64 `json:"t0,omitempty"`
T float64 `json:"t"`
TransactionID int64 `json:"transaction_id"`
TransactionID int64 `json:"transaction_id,omitempty"`
Tags []string `json:"tags,omitempty"`
}