fix(engine): break circular dep betwen session and tunnel (#295)

This diff breaks the circular dependency between session and
tunnel, by introducing the concept of early session.

An early session is a session that is able to fetch the psiphon
configuration file _only_ if it's embedded in the binary.

This breaks `miniooni --tunnel=psiphon` for users who have
access to the OONI backend. They are not the users we are
writing this feature for, though, so I think this is reasonable.

At the same time, this opens up the possibility of creating
a psiphon tunnel when constructing a session, which is the
approach I was following in https://github.com/ooni/probe-cli/pull/286.

This work is part of https://github.com/ooni/probe/issues/985.

Once this diff is in, I can land https://github.com/ooni/probe-cli/pull/286.
This commit is contained in:
Simone Basso
2021-04-05 12:02:35 +02:00
committed by GitHub
parent 8fe4e5410d
commit a849213b59
5 changed files with 28 additions and 7 deletions
+1 -2
View File
@@ -17,8 +17,7 @@ type Config struct {
// "tor" and "psiphon" tunnels.
Name string
// Session is the current measurement session. This
// field is mandatory.
// Session is the mandatory measurement session.
Session Session
// TorArgs contains the optional arguments that you want us to pass