riseupvpn

package
v3.14.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package riseupvpn contains the RiseupVPN network experiment.

See https://github.com/ooni/spec/blob/master/nettests/ts-026-riseupvpn.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExperimentMeasurer

func NewExperimentMeasurer(config Config) model.ExperimentMeasurer

NewExperimentMeasurer creates a new ExperimentMeasurer.

Types

type Config

type Config struct {
	urlgetter.Config
}

Config contains the riseupvpn experiment config.

type EipService

type EipService struct {
	Gateways []GatewayV3
}

EipService is the main JSON object of eip-service.json.

func DecodeEIP3

func DecodeEIP3(body string) (*EipService, error)

DecodeEIP3 decodes eip-service.json version 3

type GatewayConnection

type GatewayConnection struct {
	IP            string `json:"ip"`
	Port          int    `json:"port"`
	TransportType string `json:"transport_type"`
}

GatewayConnection describes the connection to a riseupvpn gateway.

type GatewayV3

type GatewayV3 struct {
	Capabilities struct {
		Transport []TransportV3
	}
	Host      string
	IPAddress string `json:"ip_address"`
}

GatewayV3 describes a gateway.

type Measurer

type Measurer struct {
	// Config contains the experiment settings. If empty we
	// will be using default settings.
	Config Config

	// Getter is an optional getter to be used for testing.
	Getter urlgetter.MultiGetter
}

Measurer performs the measurement.

func (Measurer) ExperimentName

func (m Measurer) ExperimentName() string

ExperimentName implements ExperimentMeasurer.ExperimentName.

func (Measurer) ExperimentVersion

func (m Measurer) ExperimentVersion() string

ExperimentVersion implements ExperimentMeasurer.ExperimentVersion.

func (Measurer) GetSummaryKeys

func (m Measurer) GetSummaryKeys(measurement *model.Measurement) (interface{}, error)

GetSummaryKeys implements model.ExperimentMeasurer.GetSummaryKeys.

func (Measurer) Run

func (m Measurer) Run(ctx context.Context, sess model.ExperimentSession,
	measurement *model.Measurement, callbacks model.ExperimentCallbacks) error

Run implements ExperimentMeasurer.Run.

type SummaryKeys

type SummaryKeys struct {
	APIBlocked      bool              `json:"api_blocked"`
	ValidCACert     bool              `json:"valid_ca_cert"`
	FailingGateways int               `json:"failing_gateways"`
	TransportStatus map[string]string `json:"transport_status"`
	IsAnomaly       bool              `json:"-"`
}

SummaryKeys contains summary keys for this experiment.

Note that this structure is part of the ABI contract with probe-cli therefore we should be careful when changing it.

type TestKeys

type TestKeys struct {
	urlgetter.TestKeys
	APIFailure      *string             `json:"api_failure"`
	APIStatus       string              `json:"api_status"`
	CACertStatus    bool                `json:"ca_cert_status"`
	FailingGateways []GatewayConnection `json:"failing_gateways"`
	TransportStatus map[string]string   `json:"transport_status"`
}

TestKeys contains riseupvpn test keys.

func NewTestKeys

func NewTestKeys() *TestKeys

NewTestKeys creates new riseupvpn TestKeys.

func (*TestKeys) AddCACertFetchTestKeys

func (tk *TestKeys) AddCACertFetchTestKeys(testKeys urlgetter.TestKeys)

AddCACertFetchTestKeys adds generic urlgetter.Get() testKeys to riseupvpn specific test keys

func (*TestKeys) AddGatewayConnectTestKeys

func (tk *TestKeys) AddGatewayConnectTestKeys(v urlgetter.MultiOutput, transportType string)

AddGatewayConnectTestKeys updates the TestKeys using the given MultiOutput result of gateway connectivity testing. Sets TransportStatus to "ok" if any successful TCP connection could be made

func (*TestKeys) UpdateProviderAPITestKeys

func (tk *TestKeys) UpdateProviderAPITestKeys(v urlgetter.MultiOutput)

UpdateProviderAPITestKeys updates the TestKeys using the given MultiOutput result.

type TransportV3

type TransportV3 struct {
	Type      string
	Protocols []string
	Ports     []string
	Options   map[string]string
}

TransportV3 describes a transport.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL