Skip to content

Commit

Permalink
fix(oonimkall): make sure SoftwareName is set (#1425)
Browse files Browse the repository at this point in the history
While there, make sure we log the check-in request and response with
`-v`, because otherwise 🀌🀌🀌🀌. (On this note, we did not want to log
psiphon and tor configs, but we're not using check-in for them anymore,
so this switch from not logging to logging seems indeed to be reasonably
okay to do. We need /api/v1/register and /api/v1/login before serving
config. Additionally, it seems having experiment-specific APIs is
actually more flexible anyway.)

Part of ooni/probe#2644.
  • Loading branch information
bassosimone authored Dec 12, 2023
1 parent d84729d commit a91e86f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/ooapi/checkin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewDescriptorCheckIn(
AcceptEncodingGzip: true, // we want a small response
Authorization: "",
ContentType: httpapi.ApplicationJSON,
LogBody: false, // we don't want to log psiphon config
LogBody: true,
MaxBodySize: 0,
Method: http.MethodPost,
Request: &httpapi.RequestDescriptor[*model.OOAPICheckInConfig]{
Expand Down
2 changes: 1 addition & 1 deletion internal/ooapi/checkin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestNewDescriptorCheckIn(t *testing.T) {
t.Fatalf("unexpected desc.%s", name)
}
case "LogBody":
if !field.IsZero() {
if field.IsZero() {
t.Fatalf("unexpected desc.%s", name)
}
case "MaxBodySize":
Expand Down
1 change: 1 addition & 0 deletions pkg/oonimkall/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ func (sess *Session) CheckIn(ctx *Context, config *CheckInConfig) (*CheckInInfo,
ProbeASN: info.ASNString(),
ProbeCC: info.CountryCode,
RunType: model.RunType(config.RunType),
SoftwareName: config.SoftwareName,
SoftwareVersion: config.SoftwareVersion,
WebConnectivity: config.WebConnectivity.toModel(),
}
Expand Down

0 comments on commit a91e86f

Please sign in to comment.