diff --git a/internal/engine/inputloader.go b/internal/engine/inputloader.go index 3612d1b34..e8dff50e2 100644 --- a/internal/engine/inputloader.go +++ b/internal/engine/inputloader.go @@ -331,11 +331,6 @@ func (il *InputLoader) loadRemoteWebConnectivity(ctx context.Context) ([]model.O return reply.WebConnectivity.URLs, nil } -// These are the providers that are enabled in the API. -var openvpnDefaultProviders = []string{ - "riseup", -} - // loadRemoteOpenVPN loads openvpn inputs from a remote source. func (il *InputLoader) loadRemoteOpenVPN(ctx context.Context) ([]model.OOAPIURLInfo, error) { // VPN Inputs do not match exactly the semantics expected from [model.OOAPIURLInfo], @@ -343,7 +338,8 @@ func (il *InputLoader) loadRemoteOpenVPN(ctx context.Context) ([]model.OOAPIURLI // but we force VPN targets in the URL and ignore all the other fields. urls := make([]model.OOAPIURLInfo, 0) - for _, provider := range openvpnDefaultProviders { + // The openvpn experiment contains an array of the providers that the API knows about. + for _, provider := range openvpn.APIEnabledProviders { reply, err := il.vpnConfig(ctx, provider) if err != nil { break diff --git a/internal/experiment/openvpn/endpoint.go b/internal/experiment/openvpn/endpoint.go index 0d3c9616e..c1c1b9312 100644 --- a/internal/experiment/openvpn/endpoint.go +++ b/internal/experiment/openvpn/endpoint.go @@ -174,6 +174,13 @@ var defaultOptionsByProvider = map[string]*vpnconfig.OpenVPNOptions{ }, } +// APIEnabledProviders is the list of providers that the stable API Endpoint knows about. +// This array will be a subset of the keys in defaultOptionsByProvider, but it might make sense +// to still register info about more providers that the API officially knows about. +var APIEnabledProviders = []string{ + "riseup", +} + // isValidProvider returns true if the provider is found as key in the registry of defaultOptionsByProvider. // TODO(ainghazal): consolidate with list of enabled providers from the API viewpoint. func isValidProvider(provider string) bool { diff --git a/internal/experiment/openvpn/openvpn.go b/internal/experiment/openvpn/openvpn.go index fe55f0380..5d500e738 100644 --- a/internal/experiment/openvpn/openvpn.go +++ b/internal/experiment/openvpn/openvpn.go @@ -31,7 +31,6 @@ var ( // of this experiment. By tagging these variables with `ooni:"..."`, we allow // miniooni's -O flag to find them and set them. type Config struct { - // TODO(ainghazal): Provider is right now ignored. InputLoader should get the provider from options. Provider string `ooni:"VPN provider"` SafeKey string `ooni:"key to connect to the OpenVPN endpoint"` SafeCert string `ooni:"cert to connect to the OpenVPN endpoint"`