Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set of changes to unblock ooni/probe-cli#46 #37

Merged
merged 4 commits into from
Aug 14, 2019

Conversation

bassosimone
Copy link
Member

@bassosimone bassosimone commented Aug 13, 2019

Rationale

As identified in ooni/probe-cli#46 (comment), the remaining actions before merging ooni/probe-cli#46 are:

This PR implements enough functionality in the engine to satisfy the above requirements. We do not implement everything that is described in #28 but we implement enough of it such that the two above criteria are satisfied. This is needed to, among other things, unblock #52.

Scope

Each commit in this PR could be considered independently, if the overall diff looks too messy. Also, I have added more details to each commit message. The whole diff also has comments.

This is currently speculative, since MK v0.10.5 has not been
released yet. Nonetheless, this functionality should be working
when we have relased that version.
Psiphon is not using `go.mod`. Updating also psiphon should be
done with extra care precisely because of that.

For other dependencies, we can go YOLO.
@bassosimone bassosimone self-assigned this Aug 13, 2019
@bassosimone bassosimone added enhancement New feature or request please preserve history Do not squash and merge labels Aug 13, 2019
@bassosimone bassosimone added this to In progress in DO NOT USE (was: OONI Nettests and Engine) via automation Aug 13, 2019
collector/collector.go Outdated Show resolved Hide resolved
collector/collector.go Outdated Show resolved Hide resolved
collector/collector.go Outdated Show resolved Hide resolved
collector/collector.go Outdated Show resolved Hide resolved
experiment/experiment.go Outdated Show resolved Hide resolved
experiment/experiment.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
@bassosimone
Copy link
Member Author

At this point the build is failing because coveralls has a boo boo. It's safe to bless as ready for review while I look into that accidental annoyance.

@bassosimone bassosimone marked this pull request as ready for review August 13, 2019 13:05
@bassosimone bassosimone changed the title Set of changes to unblock https://github.com/ooni/probe-cli/pull/46 Set of changes to unblock ooni/probe-cli#46 Aug 13, 2019
collector/collector.go Outdated Show resolved Hide resolved
collector/collector.go Outdated Show resolved Hide resolved
collector/collector.go Outdated Show resolved Hide resolved
Copy link
Member

@hellais hellais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this PR looks good. I left some comments we can discuss before merging.

Is my understanding correct in that you don't record the resolver_ip yet?

bassosimone added a commit that referenced this pull request Aug 13, 2019
@bassosimone
Copy link
Member Author

@hellais I believe I have addressed your comments by refactoring the code. PTAL?

model/model.go Outdated Show resolved Hide resolved
@bassosimone
Copy link
Member Author

Is my understanding correct in that you don't record the resolver_ip yet?

That is half correct. We look it up but we don't pass it to MK. It seems actually the right thing to do is to pass that information to MK such that it case use it, as we do for the probe IP.

@hellais
Copy link
Member

hellais commented Aug 13, 2019

That is half correct. We look it up but we don't pass it to MK. It seems actually the right thing to do is to pass that information to MK such that it case use it, as we do for the probe IP.

Ok. Does probe-engine write the resolver_ip inside of the test_keys once it has looked it up?

@bassosimone
Copy link
Member Author

Ok. Does probe-engine write the resolver_ip inside of the test_keys once it has looked it up?

No, it does not. The main issue is that the test_keys are opaque. So, it could in principle parse the test_keys, unconditionally overwrite the field and then set it again. I was inclined to let MK do that work, hence measurement-kit/measurement-kit#1883 but now I realise that it's actually more simple to just do what I say above.

@bassosimone
Copy link
Member Author

bassosimone commented Aug 13, 2019

@bassosimone wrote:

I was inclined to let MK do that work, hence measurement-kit/measurement-kit#1883 but now I realise that it's actually more simple to just do what I say above.

TBH, I'm not sure anymore of what could be the best approach here. The resolver_ip being part of the test_keys complicates everything quite a bit. If it's okay for you we can create an issue about solving this problem and I can work on that after this PR is landed?

@hellais
Copy link
Member

hellais commented Aug 13, 2019

Yes it's fine we can do this as part of another PR.

@bassosimone
Copy link
Member Author

Yes it's fine we can do this as part of another PR.

Okay, issue here #38

Copy link
Member

@hellais hellais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to merge for me

@bassosimone
Copy link
Member Author

So, today I'll proceed with breaking fixing the build, breaking this down in commits and merging.

@bassosimone
Copy link
Member Author

Regarding the Coveralls error, it turns out yesterday it was down for maintenance.

This diff introduces code to redact IP, ASN, and CC directly
in the engine, rather than delegating doing that.

When you initialise a Session, it's your responsibility to
change the default privacy settings.

The names of the collector.PrivacySettings structure fields
are the same names used by ooni/probe-cli.

After a measurement, the settings configured in the session are
honoured with respect to redacting IP, ASN, and CC.

We take an extra step of redacting the whole test keys
string, _if_ it contains the IP.

This is an extra safety net to make sure that we are really
scrubbing the body. The nettest should do that.

This commit is part of #28.
1. make sure we use a separate structure for the open report response
such that the server cannot write our data structure

2. make sure symbols that can be private are actually private

3. make sure the code is compliant with the spec by checking that
the server actually supports `json` reports
@bassosimone
Copy link
Member Author

I restructured the PR in a set of understandable commits and fixed a bug that prevented tests without input to run when doing an additional review. I am now going to merge as soon as Travis is green.

@bassosimone bassosimone merged commit 473884e into master Aug 14, 2019
DO NOT USE (was: OONI Nettests and Engine) automation moved this from In progress to Done Aug 14, 2019
@bassosimone bassosimone deleted the feature/probe-cli-46 branch August 14, 2019 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request please preserve history Do not squash and merge
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants