diff options
| author | David Lönnhager <david.l@mullvad.net> | 2022-03-23 16:51:43 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2022-03-23 16:51:43 +0100 |
| commit | b1910fc14517d284c05aeded77d6f34e3949e6ef (patch) | |
| tree | f762f61e1ed40bb4be8558122f3bdc4fff59570f | |
| parent | 74d76ff8f071d96ffbc6fbb8d92ec961b839f416 (diff) | |
| parent | 918e6588d2276122e391fb426be3245d0664e245 (diff) | |
| download | mullvadvpn-b1910fc14517d284c05aeded77d6f34e3949e6ef.tar.xz mullvadvpn-b1910fc14517d284c05aeded77d6f34e3949e6ef.zip | |
Merge branch 'rename-rpc-crate'
| -rw-r--r-- | .github/workflows/android-app.yml | 2 | ||||
| -rw-r--r-- | Cargo.lock | 64 | ||||
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | ios/BuildInstructions.md | 4 | ||||
| -rw-r--r-- | mullvad-api/Cargo.toml (renamed from mullvad-rpc/Cargo.toml) | 4 | ||||
| -rw-r--r-- | mullvad-api/le_root_cert.pem (renamed from mullvad-rpc/le_root_cert.pem) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/abortable_stream.rs (renamed from mullvad-rpc/src/abortable_stream.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/access.rs (renamed from mullvad-rpc/src/access.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/address_cache.rs (renamed from mullvad-rpc/src/address_cache.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/availability.rs (renamed from mullvad-rpc/src/availability.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/bin/relay_list.rs (renamed from mullvad-rpc/src/bin/relay_list.rs) | 8 | ||||
| -rw-r--r-- | mullvad-api/src/device.rs (renamed from mullvad-rpc/src/device.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/https_client_with_sni.rs (renamed from mullvad-rpc/src/https_client_with_sni.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/lib.rs (renamed from mullvad-rpc/src/lib.rs) | 14 | ||||
| -rw-r--r-- | mullvad-api/src/proxy.rs (renamed from mullvad-rpc/src/proxy.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/relay_list.rs (renamed from mullvad-rpc/src/relay_list.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/rest.rs (renamed from mullvad-rpc/src/rest.rs) | 0 | ||||
| -rw-r--r-- | mullvad-api/src/tls_stream.rs (renamed from mullvad-rpc/src/tls_stream.rs) | 0 | ||||
| -rw-r--r-- | mullvad-daemon/Cargo.toml | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/api.rs | 4 | ||||
| -rw-r--r-- | mullvad-daemon/src/device.rs | 22 | ||||
| -rw-r--r-- | mullvad-daemon/src/geoip.rs | 6 | ||||
| -rw-r--r-- | mullvad-daemon/src/lib.rs | 62 | ||||
| -rw-r--r-- | mullvad-daemon/src/management_interface.rs | 6 | ||||
| -rw-r--r-- | mullvad-daemon/src/migrations/mod.rs | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/migrations/v5.rs | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/relays/mod.rs | 6 | ||||
| -rw-r--r-- | mullvad-daemon/src/relays/updater.rs | 24 | ||||
| -rw-r--r-- | mullvad-daemon/src/version_check.rs | 18 | ||||
| -rw-r--r-- | mullvad-jni/Cargo.toml | 2 | ||||
| -rw-r--r-- | mullvad-jni/src/daemon_interface.rs | 2 | ||||
| -rw-r--r-- | mullvad-jni/src/lib.rs | 6 | ||||
| -rw-r--r-- | mullvad-problem-report/Cargo.toml | 2 | ||||
| -rw-r--r-- | mullvad-problem-report/src/lib.rs | 14 | ||||
| -rw-r--r-- | mullvad-setup/Cargo.toml | 2 | ||||
| -rw-r--r-- | mullvad-setup/src/main.rs | 12 | ||||
| -rw-r--r-- | mullvad-types/src/relay_list.rs | 6 |
37 files changed, 148 insertions, 150 deletions
diff --git a/.github/workflows/android-app.yml b/.github/workflows/android-app.yml index 3bc2192146..1b96c4710c 100644 --- a/.github/workflows/android-app.yml +++ b/.github/workflows/android-app.yml @@ -5,11 +5,11 @@ on: paths: - .github/workflows/android-app.yml - android/** + - mullvad-api/** - mullvad-daemon/** - mullvad-jni/** - mullvad-paths/** - mullvad-problem-report/** - - mullvad-rpc/** - mullvad-types/** - talpid-core/** - talpid-platform-metadata/** diff --git a/Cargo.lock b/Cargo.lock index cb90acb302..63abc2bbab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1556,6 +1556,34 @@ dependencies = [ ] [[package]] +name = "mullvad-api" +version = "0.1.0" +dependencies = [ + "chrono", + "err-derive", + "futures", + "http", + "hyper", + "hyper-rustls", + "ipnetwork", + "lazy_static", + "log", + "mullvad-types", + "rand 0.7.3", + "regex", + "rustls-pemfile", + "serde", + "serde_json", + "shadowsocks", + "talpid-types", + "tokio", + "tokio-rustls", + "tokio-stream", + "urlencoding", + "webpki 0.21.4", +] + +[[package]] name = "mullvad-cli" version = "2022.1.0" dependencies = [ @@ -1598,9 +1626,9 @@ dependencies = [ "libc", "log", "log-panics", + "mullvad-api", "mullvad-management-interface", "mullvad-paths", - "mullvad-rpc", "mullvad-types", "nix 0.23.1", "parking_lot 0.11.2", @@ -1640,10 +1668,10 @@ dependencies = [ "lazy_static", "log", "log-panics", + "mullvad-api", "mullvad-daemon", "mullvad-paths", "mullvad-problem-report", - "mullvad-rpc", "mullvad-types", "nix 0.23.1", "rand 0.7.3", @@ -1693,8 +1721,8 @@ dependencies = [ "err-derive", "lazy_static", "log", + "mullvad-api", "mullvad-paths", - "mullvad-rpc", "regex", "talpid-platform-metadata", "talpid-types", @@ -1705,34 +1733,6 @@ dependencies = [ ] [[package]] -name = "mullvad-rpc" -version = "0.1.0" -dependencies = [ - "chrono", - "err-derive", - "futures", - "http", - "hyper", - "hyper-rustls", - "ipnetwork", - "lazy_static", - "log", - "mullvad-types", - "rand 0.7.3", - "regex", - "rustls-pemfile", - "serde", - "serde_json", - "shadowsocks", - "talpid-types", - "tokio", - "tokio-rustls", - "tokio-stream", - "urlencoding", - "webpki 0.21.4", -] - -[[package]] name = "mullvad-setup" version = "2022.1.0" dependencies = [ @@ -1740,10 +1740,10 @@ dependencies = [ "env_logger 0.8.4", "err-derive", "lazy_static", + "mullvad-api", "mullvad-daemon", "mullvad-management-interface", "mullvad-paths", - "mullvad-rpc", "mullvad-types", "talpid-core", "talpid-types", diff --git a/Cargo.toml b/Cargo.toml index 0e41cf5f2c..074445b867 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ "mullvad-jni", "mullvad-paths", "mullvad-types", - "mullvad-rpc", + "mullvad-api", "mullvad-exclude", "talpid-openvpn-plugin", "talpid-core", diff --git a/ios/BuildInstructions.md b/ios/BuildInstructions.md index 4c112fcad7..e3b114153a 100644 --- a/ios/BuildInstructions.md +++ b/ios/BuildInstructions.md @@ -207,8 +207,8 @@ Reference: https://docs.travis-ci.com/user/common-build-problems/#mac-macos-sier # SSL pinning -The iOS app utilizes SSL pinning. Root certificates can be updated by using the source certificates shipped along with `mullvad-rpc`: +The iOS app utilizes SSL pinning. Root certificates can be updated by using the source certificates shipped along with `mullvad-api`: ``` -openssl x509 -in ../mullvad-rpc/le_root_cert.pem -outform der -out Assets/le_root_cert.cer +openssl x509 -in ../mullvad-api/le_root_cert.pem -outform der -out Assets/le_root_cert.cer ``` diff --git a/mullvad-rpc/Cargo.toml b/mullvad-api/Cargo.toml index 4b18512c75..d73aa0f046 100644 --- a/mullvad-rpc/Cargo.toml +++ b/mullvad-api/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "mullvad-rpc" +name = "mullvad-api" version = "0.1.0" authors = ["Mullvad VPN"] -description = "Mullvad VPN RPC clients. Providing an interface to query our infrastructure for information." +description = "Mullvad VPN API clients. Providing an interface to query our infrastructure for information." license = "GPL-3.0" edition = "2021" publish = false diff --git a/mullvad-rpc/le_root_cert.pem b/mullvad-api/le_root_cert.pem index b85c8037f6..b85c8037f6 100644 --- a/mullvad-rpc/le_root_cert.pem +++ b/mullvad-api/le_root_cert.pem diff --git a/mullvad-rpc/src/abortable_stream.rs b/mullvad-api/src/abortable_stream.rs index af217c5768..af217c5768 100644 --- a/mullvad-rpc/src/abortable_stream.rs +++ b/mullvad-api/src/abortable_stream.rs diff --git a/mullvad-rpc/src/access.rs b/mullvad-api/src/access.rs index d95a5319c2..d95a5319c2 100644 --- a/mullvad-rpc/src/access.rs +++ b/mullvad-api/src/access.rs diff --git a/mullvad-rpc/src/address_cache.rs b/mullvad-api/src/address_cache.rs index 3b6fcba074..3b6fcba074 100644 --- a/mullvad-rpc/src/address_cache.rs +++ b/mullvad-api/src/address_cache.rs diff --git a/mullvad-rpc/src/availability.rs b/mullvad-api/src/availability.rs index 2cf40cf53b..2cf40cf53b 100644 --- a/mullvad-rpc/src/availability.rs +++ b/mullvad-api/src/availability.rs diff --git a/mullvad-rpc/src/bin/relay_list.rs b/mullvad-api/src/bin/relay_list.rs index 66118d3ade..2139e51f54 100644 --- a/mullvad-rpc/src/bin/relay_list.rs +++ b/mullvad-api/src/bin/relay_list.rs @@ -2,16 +2,14 @@ //! Used by the installer artifact packer to bundle the latest available //! relay list at the time of creating the installer. -use mullvad_rpc::{ - proxy::ApiConnectionMode, rest::Error as RestError, MullvadRpcRuntime, RelayListProxy, -}; +use mullvad_api::{self, proxy::ApiConnectionMode, rest::Error as RestError, RelayListProxy}; use std::process; use talpid_types::ErrorExt; #[tokio::main] async fn main() { - let runtime = - MullvadRpcRuntime::new(tokio::runtime::Handle::current()).expect("Failed to load runtime"); + let runtime = mullvad_api::Runtime::new(tokio::runtime::Handle::current()) + .expect("Failed to load runtime"); let relay_list_request = RelayListProxy::new( runtime diff --git a/mullvad-rpc/src/device.rs b/mullvad-api/src/device.rs index de572aa20d..de572aa20d 100644 --- a/mullvad-rpc/src/device.rs +++ b/mullvad-api/src/device.rs diff --git a/mullvad-rpc/src/https_client_with_sni.rs b/mullvad-api/src/https_client_with_sni.rs index 409492712e..409492712e 100644 --- a/mullvad-rpc/src/https_client_with_sni.rs +++ b/mullvad-api/src/https_client_with_sni.rs diff --git a/mullvad-rpc/src/lib.rs b/mullvad-api/src/lib.rs index f93d27262a..40742fe41d 100644 --- a/mullvad-rpc/src/lib.rs +++ b/mullvad-api/src/lib.rs @@ -124,8 +124,8 @@ impl ApiEndpoint { } } -/// A type that helps with the creation of RPC connections. -pub struct MullvadRpcRuntime { +/// A type that helps with the creation of API connections. +pub struct Runtime { handle: tokio::runtime::Handle, pub address_cache: AddressCache, api_availability: availability::ApiAvailability, @@ -158,8 +158,8 @@ where type AcceptedNewEndpoint = T; } -impl MullvadRpcRuntime { - /// Create a new `MullvadRpcRuntime`. +impl Runtime { + /// Create a new `Runtime`. pub fn new(handle: tokio::runtime::Handle) -> Result<Self, Error> { Self::new_inner( handle, @@ -172,7 +172,7 @@ impl MullvadRpcRuntime { handle: tokio::runtime::Handle, #[cfg(target_os = "android")] socket_bypass_tx: Option<mpsc::Sender<SocketBypassRequest>>, ) -> Result<Self, Error> { - Ok(MullvadRpcRuntime { + Ok(Runtime { handle, address_cache: AddressCache::new(None)?, api_availability: ApiAvailability::new(availability::State::default()), @@ -181,7 +181,7 @@ impl MullvadRpcRuntime { }) } - /// Create a new `MullvadRpcRuntime` using the specified directories. + /// Create a new `Runtime` using the specified directories. /// Try to use the cache directory first, and fall back on the bundled address otherwise. pub async fn with_cache( cache_dir: &Path, @@ -219,7 +219,7 @@ impl MullvadRpcRuntime { } }; - Ok(MullvadRpcRuntime { + Ok(Runtime { handle, address_cache, api_availability: ApiAvailability::new(availability::State::default()), diff --git a/mullvad-rpc/src/proxy.rs b/mullvad-api/src/proxy.rs index 009a1960dc..009a1960dc 100644 --- a/mullvad-rpc/src/proxy.rs +++ b/mullvad-api/src/proxy.rs diff --git a/mullvad-rpc/src/relay_list.rs b/mullvad-api/src/relay_list.rs index 5a8a01836f..5a8a01836f 100644 --- a/mullvad-rpc/src/relay_list.rs +++ b/mullvad-api/src/relay_list.rs diff --git a/mullvad-rpc/src/rest.rs b/mullvad-api/src/rest.rs index 292bcd0cbb..292bcd0cbb 100644 --- a/mullvad-rpc/src/rest.rs +++ b/mullvad-api/src/rest.rs diff --git a/mullvad-rpc/src/tls_stream.rs b/mullvad-api/src/tls_stream.rs index cad0268ac3..cad0268ac3 100644 --- a/mullvad-rpc/src/tls_stream.rs +++ b/mullvad-api/src/tls_stream.rs diff --git a/mullvad-daemon/Cargo.toml b/mullvad-daemon/Cargo.toml index 8de253bf07..b2905f9aea 100644 --- a/mullvad-daemon/Cargo.toml +++ b/mullvad-daemon/Cargo.toml @@ -31,7 +31,7 @@ uuid = { version = "0.8", features = ["v4"] } mullvad-paths = { path = "../mullvad-paths" } mullvad-types = { path = "../mullvad-types" } -mullvad-rpc = { path = "../mullvad-rpc" } +mullvad-api = { path = "../mullvad-api" } talpid-core = { path = "../talpid-core" } talpid-types = { path = "../talpid-types" } talpid-platform-metadata = { path = "../talpid-platform-metadata" } diff --git a/mullvad-daemon/src/api.rs b/mullvad-daemon/src/api.rs index fa27365400..21aa7c6232 100644 --- a/mullvad-daemon/src/api.rs +++ b/mullvad-daemon/src/api.rs @@ -3,7 +3,7 @@ use futures::{ channel::{mpsc, oneshot}, stream, Stream, StreamExt, }; -use mullvad_rpc::{proxy::ApiConnectionMode, ApiEndpointUpdateCallback}; +use mullvad_api::{proxy::ApiConnectionMode, ApiEndpointUpdateCallback}; use std::{ net::SocketAddr, sync::{Arc, Mutex, Weak}, @@ -65,7 +65,7 @@ pub(crate) fn create_api_config_provider( /// Notifies the tunnel state machine that the API (real or proxied) endpoint has /// changed. [ApiEndpointUpdaterHandle::callback()] creates a callback that may -/// be passed to the `mullvad-rpc` runtime. +/// be passed to the `mullvad-api` runtime. pub(super) struct ApiEndpointUpdaterHandle { tunnel_cmd_tx: Arc<Mutex<Option<Weak<mpsc::UnboundedSender<TunnelCommand>>>>>, } diff --git a/mullvad-daemon/src/device.rs b/mullvad-daemon/src/device.rs index 868dc003d8..bdd5620297 100644 --- a/mullvad-daemon/src/device.rs +++ b/mullvad-daemon/src/device.rs @@ -4,7 +4,7 @@ use futures::{ future::{abortable, AbortHandle}, stream::StreamExt, }; -use mullvad_rpc::{ +use mullvad_api::{ availability::ApiAvailabilityHandle, rest::{self, Error as RestError, MullvadRestHandle}, AccountsProxy, DevicesProxy, @@ -975,11 +975,11 @@ impl AccountService { } pub fn spawn_account_service( - rpc_handle: MullvadRestHandle, + api_handle: MullvadRestHandle, token: Option<String>, api_availability: ApiAvailabilityHandle, ) -> AccountService { - let accounts_proxy = AccountsProxy::new(rpc_handle); + let accounts_proxy = AccountsProxy::new(api_handle); api_availability.pause_background(); let api_availability_copy = api_availability.clone(); @@ -1011,7 +1011,7 @@ pub fn spawn_account_service( } fn handle_expiry_result_inner( - result: &Result<chrono::DateTime<chrono::Utc>, mullvad_rpc::rest::Error>, + result: &Result<chrono::DateTime<chrono::Utc>, mullvad_api::rest::Error>, api_availability: &ApiAvailabilityHandle, ) -> bool { match result { @@ -1023,8 +1023,8 @@ fn handle_expiry_result_inner( api_availability.pause_background(); true } - Err(mullvad_rpc::rest::Error::ApiError(_status, code)) => { - if code == mullvad_rpc::INVALID_ACCOUNT { + Err(mullvad_api::rest::Error::ApiError(_status, code)) => { + if code == mullvad_api::INVALID_ACCOUNT { api_availability.pause_background(); return true; } @@ -1047,9 +1047,9 @@ fn should_retry_backoff<T>(result: &Result<T, RestError>) -> bool { Err(error) => { if let RestError::ApiError(status, code) = error { *status != rest::StatusCode::NOT_FOUND - && code != mullvad_rpc::INVALID_ACCOUNT - && code != mullvad_rpc::MAX_DEVICES_REACHED - && code != mullvad_rpc::PUBKEY_IN_USE + && code != mullvad_api::INVALID_ACCOUNT + && code != mullvad_api::MAX_DEVICES_REACHED + && code != mullvad_api::PUBKEY_IN_USE } else { true } @@ -1064,8 +1064,8 @@ fn map_rest_error(error: rest::Error) -> Error { return Error::InvalidDevice; } match code.as_str() { - mullvad_rpc::INVALID_ACCOUNT => Error::InvalidAccount, - mullvad_rpc::MAX_DEVICES_REACHED => Error::MaxDevicesReached, + mullvad_api::INVALID_ACCOUNT => Error::InvalidAccount, + mullvad_api::MAX_DEVICES_REACHED => Error::MaxDevicesReached, _ => Error::OtherRestError(error), } } diff --git a/mullvad-daemon/src/geoip.rs b/mullvad-daemon/src/geoip.rs index cc1fea8401..def16e3ef7 100644 --- a/mullvad-daemon/src/geoip.rs +++ b/mullvad-daemon/src/geoip.rs @@ -1,5 +1,5 @@ use futures::join; -use mullvad_rpc::{ +use mullvad_api::{ self, rest::{Error, RequestServiceHandle}, }; @@ -48,9 +48,9 @@ async fn send_location_request_internal( service: RequestServiceHandle, ) -> Result<AmIMullvad, Error> { let future_service = service.clone(); - let request = mullvad_rpc::rest::RestRequest::get(uri)?; + let request = mullvad_api::rest::RestRequest::get(uri)?; let response = future_service.request(request).await?; - mullvad_rpc::rest::deserialize_body(response).await + mullvad_api::rest::deserialize_body(response).await } fn log_network_error(err: Error, version: &'static str) { diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs index 3f1d363694..27aea9b79a 100644 --- a/mullvad-daemon/src/lib.rs +++ b/mullvad-daemon/src/lib.rs @@ -31,7 +31,7 @@ use futures::{ future::{abortable, AbortHandle, Future}, StreamExt, }; -use mullvad_rpc::{ +use mullvad_api::{ availability::ApiAvailabilityHandle, proxy::{ApiConnectionMode, ProxyConfig}, }; @@ -109,13 +109,13 @@ pub enum Error { InitIoEventLoop(#[error(source)] io::Error), #[error(display = "Unable to create RPC client")] - InitRpcFactory(#[error(source)] mullvad_rpc::Error), + InitRpcFactory(#[error(source)] mullvad_api::Error), #[error(display = "REST request failed")] - RestError(#[error(source)] mullvad_rpc::rest::Error), + RestError(#[error(source)] mullvad_api::rest::Error), #[error(display = "API availability check failed")] - ApiCheckError(#[error(source)] mullvad_rpc::availability::Error), + ApiCheckError(#[error(source)] mullvad_api::availability::Error), #[error(display = "Unable to load account history")] LoadAccountHistory(#[error(source)] account_history::Error), @@ -224,7 +224,7 @@ pub enum DaemonCommand { CreateNewAccount(ResponseTx<String, Error>), /// Request the metadata for an account. GetAccountData( - ResponseTx<AccountData, mullvad_rpc::rest::Error>, + ResponseTx<AccountData, mullvad_api::rest::Error>, AccountToken, ), /// Request www auth token for an account @@ -572,8 +572,8 @@ pub struct Daemon<L: EventListener> { account_history: account_history::AccountHistory, device_checker: device::TunnelStateChangeHandler, account_manager: device::AccountManagerHandle, - rpc_runtime: mullvad_rpc::MullvadRpcRuntime, - rpc_handle: mullvad_rpc::rest::MullvadRestHandle, + api_runtime: mullvad_api::Runtime, + api_handle: mullvad_api::rest::MullvadRestHandle, version_updater_handle: version_check::VersionUpdaterHandle, relay_selector: relays::RelaySelector, last_generated_relay: Option<Relay>, @@ -606,11 +606,11 @@ where exclusion_gid::set_exclusion_gid().map_err(Error::GroupIdError)? }; - mullvad_rpc::proxy::ApiConnectionMode::try_delete_cache(&cache_dir).await; + mullvad_api::proxy::ApiConnectionMode::try_delete_cache(&cache_dir).await; let (internal_event_tx, internal_event_rx) = command_channel.destructure(); - let rpc_runtime = mullvad_rpc::MullvadRpcRuntime::with_cache( + let api_runtime = mullvad_api::Runtime::with_cache( &cache_dir, true, #[cfg(target_os = "android")] @@ -619,7 +619,7 @@ where .await .map_err(Error::InitRpcFactory)?; - let api_availability = rpc_runtime.availability_handle(); + let api_availability = api_runtime.availability_handle(); api_availability.suspend(); let endpoint_updater = api::ApiEndpointUpdaterHandle::new(); @@ -628,14 +628,14 @@ where internal_event_tx.to_specialized_sender(), ApiConnectionMode::Direct, ); - let rpc_handle = rpc_runtime + let api_handle = api_runtime .mullvad_rest_handle(proxy_provider, endpoint_updater.callback()) .await; if let Err(error) = migrations::migrate_all( &cache_dir, &settings_dir, - rpc_handle.clone(), + api_handle.clone(), internal_event_tx.clone(), ) .await @@ -652,7 +652,7 @@ where }; let account_manager = device::AccountManager::spawn( - rpc_handle.clone(), + api_handle.clone(), api_availability.clone(), &settings_dir, settings @@ -699,7 +699,7 @@ where }; let initial_api_endpoint = - api::get_allowed_endpoint(rpc_runtime.address_cache.get_address().await); + api::get_allowed_endpoint(api_runtime.address_cache.get_address().await); let (offline_state_tx, offline_state_rx) = mpsc::unbounded(); #[cfg(target_os = "windows")] @@ -739,7 +739,7 @@ where }; let relay_selector = relays::RelaySelector::new( - rpc_handle.clone(), + api_handle.clone(), on_relay_list_update, &resource_dir, &cache_dir, @@ -748,7 +748,7 @@ where let app_version_info = version_check::load_cache(&cache_dir).await; let (version_updater, version_updater_handle) = version_check::VersionUpdater::new( - rpc_handle.clone(), + api_handle.clone(), api_availability.clone(), cache_dir.clone(), internal_event_tx.to_specialized_sender(), @@ -775,8 +775,8 @@ where account_history, device_checker: device::TunnelStateChangeHandler::new(account_manager.clone()), account_manager, - rpc_runtime, - rpc_handle, + api_runtime, + api_handle, version_updater_handle, relay_selector, last_generated_relay: None, @@ -858,7 +858,7 @@ where } async fn finalize(self) { - let (event_listener, shutdown_tasks, rpc_runtime, tunnel_state_machine_handle) = + let (event_listener, shutdown_tasks, api_runtime, tunnel_state_machine_handle) = self.shutdown(); for future in shutdown_tasks { future.await; @@ -866,8 +866,8 @@ where tunnel_state_machine_handle.try_join().await; - mem::drop(event_listener); - mem::drop(rpc_runtime); + drop(event_listener); + drop(api_runtime); #[cfg(any(target_os = "macos", target_os = "linux"))] if let Err(err) = fs::remove_file(mullvad_paths::get_rpc_socket_path()).await { @@ -884,13 +884,13 @@ where ) -> ( L, Vec<Pin<Box<dyn Future<Output = ()>>>>, - mullvad_rpc::MullvadRpcRuntime, + mullvad_api::Runtime, tunnel_state_machine::JoinHandle, ) { let Daemon { event_listener, mut shutdown_tasks, - rpc_runtime, + api_runtime, tunnel_state_machine_handle, target_state, account_manager, @@ -903,7 +903,7 @@ where ( event_listener, shutdown_tasks, - rpc_runtime, + api_runtime, tunnel_state_machine_handle, ) } @@ -999,7 +999,7 @@ where match (&self.tunnel_state, &tunnel_state_transition) { // only reset the API sockets if when connected or leaving the connected state (&TunnelState::Connected { .. }, _) | (_, &TunnelStateTransition::Connected(_)) => { - self.rpc_handle.service().reset().await; + self.api_handle.service().reset().await; } _ => (), }; @@ -1294,7 +1294,7 @@ where /// Returns the next API connection mode to use for reaching the API. /// - /// When `mullvad-rpc` fails to contact the API, it requests a new connection mode + /// When `mullvad-api` fails to contact the API, it requests a new connection mode /// from this function, which will be used for future requests. The API can be /// connected to either directly (i.e., [`ApiConnectionMode::Direct`]) or from /// a bridge ([`ApiConnectionMode::Proxied`]). @@ -1500,9 +1500,9 @@ where } async fn get_geo_location(&mut self) -> impl Future<Output = Result<GeoIpLocation, ()>> { - let rpc_service = self.rpc_runtime.rest_handle().await; + let rest_service = self.api_runtime.rest_handle().await; async { - geoip::send_location_request(rpc_service) + geoip::send_location_request(rest_service) .await .map_err(|e| { log::warn!("Unable to fetch GeoIP location: {}", e.display_chain()); @@ -1567,7 +1567,7 @@ where async fn on_get_account_data( &mut self, - tx: ResponseTx<AccountData, mullvad_rpc::rest::Error>, + tx: ResponseTx<AccountData, mullvad_api::rest::Error>, account_token: AccountToken, ) { let account = self.account_manager.account_service.clone(); @@ -2404,7 +2404,7 @@ where #[cfg(target_os = "android")] fn create_bypass_tx( event_sender: &DaemonEventSender, - ) -> Option<mpsc::Sender<mullvad_rpc::SocketBypassRequest>> { + ) -> Option<mpsc::Sender<mullvad_api::SocketBypassRequest>> { let (bypass_tx, mut bypass_rx) = mpsc::channel(1); let daemon_tx = event_sender.to_specialized_sender(); tokio::spawn(async move { @@ -2454,7 +2454,7 @@ where } fn connect_tunnel(&mut self) { - self.rpc_runtime.availability_handle().resume_background(); + self.api_runtime.availability_handle().resume_background(); self.send_tunnel_command(TunnelCommand::Connect); } diff --git a/mullvad-daemon/src/management_interface.rs b/mullvad-daemon/src/management_interface.rs index b6413b357b..4005ff7df0 100644 --- a/mullvad-daemon/src/management_interface.rs +++ b/mullvad-daemon/src/management_interface.rs @@ -3,12 +3,12 @@ use futures::{ channel::{mpsc, oneshot}, StreamExt, }; +use mullvad_api::{rest::Error as RestError, StatusCode}; use mullvad_management_interface::{ types::{self, daemon_event, management_service_server::ManagementService}, Code, Request, Response, Status, }; use mullvad_paths; -use mullvad_rpc::{rest::Error as RestError, StatusCode}; #[cfg(not(target_os = "android"))] use mullvad_types::settings::DnsOptions; use mullvad_types::{ @@ -935,9 +935,9 @@ fn map_split_tunnel_error(error: talpid_core::split_tunnel::Error) -> Status { fn map_rest_voucher_error(error: RestError) -> Status { match error { RestError::ApiError(StatusCode::BAD_REQUEST, message) => match &message.as_str() { - &mullvad_rpc::INVALID_VOUCHER => Status::new(Code::NotFound, INVALID_VOUCHER_MESSAGE), + &mullvad_api::INVALID_VOUCHER => Status::new(Code::NotFound, INVALID_VOUCHER_MESSAGE), - &mullvad_rpc::VOUCHER_USED => { + &mullvad_api::VOUCHER_USED => { Status::new(Code::ResourceExhausted, USED_VOUCHER_MESSAGE) } diff --git a/mullvad-daemon/src/migrations/mod.rs b/mullvad-daemon/src/migrations/mod.rs index c1402d15b5..e02fa8ee60 100644 --- a/mullvad-daemon/src/migrations/mod.rs +++ b/mullvad-daemon/src/migrations/mod.rs @@ -90,7 +90,7 @@ pub type Result<T> = std::result::Result<T, Error>; pub(crate) async fn migrate_all( cache_dir: &Path, settings_dir: &Path, - rest_handle: mullvad_rpc::rest::MullvadRestHandle, + rest_handle: mullvad_api::rest::MullvadRestHandle, daemon_tx: crate::DaemonEventSender, ) -> Result<()> { #[cfg(windows)] diff --git a/mullvad-daemon/src/migrations/v5.rs b/mullvad-daemon/src/migrations/v5.rs index 0695ee8c7e..c74bdc0ca4 100644 --- a/mullvad-daemon/src/migrations/v5.rs +++ b/mullvad-daemon/src/migrations/v5.rs @@ -36,7 +36,7 @@ use talpid_types::ErrorExt; /// the account token is also stored in the account history. pub(crate) async fn migrate( settings: &mut serde_json::Value, - rest_handle: mullvad_rpc::rest::MullvadRestHandle, + rest_handle: mullvad_api::rest::MullvadRestHandle, daemon_tx: DaemonEventSender, ) -> Result<()> { let migration_data = migrate_inner(settings).await?; diff --git a/mullvad-daemon/src/relays/mod.rs b/mullvad-daemon/src/relays/mod.rs index c4a136369c..6f6a0279ba 100644 --- a/mullvad-daemon/src/relays/mod.rs +++ b/mullvad-daemon/src/relays/mod.rs @@ -3,7 +3,7 @@ use chrono::{DateTime, Local}; use ipnetwork::IpNetwork; -use mullvad_rpc::{availability::ApiAvailabilityHandle, rest::MullvadRestHandle}; +use mullvad_api::{availability::ApiAvailabilityHandle, rest::MullvadRestHandle}; use mullvad_types::{ endpoint::{MullvadEndpoint, MullvadWireguardEndpoint}, location::{Coordinates, Location}, @@ -211,7 +211,7 @@ impl RelaySelector { /// Returns a new `RelaySelector` backed by relays cached on disk. Use the `update` method /// to refresh the relay list from the internet. pub fn new( - rpc_handle: MullvadRestHandle, + api_handle: MullvadRestHandle, on_update: impl Fn(&RelayList) + Send + 'static, resource_dir: &Path, cache_dir: &Path, @@ -236,7 +236,7 @@ impl RelaySelector { let parsed_relays = Arc::new(Mutex::new(unsynchronized_parsed_relays)); let updater = RelayListUpdater::new( - rpc_handle, + api_handle, cache_path, parsed_relays.clone(), Box::new(on_update), diff --git a/mullvad-daemon/src/relays/updater.rs b/mullvad-daemon/src/relays/updater.rs index 381e5bd54c..ae55a998f6 100644 --- a/mullvad-daemon/src/relays/updater.rs +++ b/mullvad-daemon/src/relays/updater.rs @@ -4,7 +4,7 @@ use futures::{ future::{Fuse, FusedFuture}, Future, FutureExt, SinkExt, StreamExt, }; -use mullvad_rpc::{availability::ApiAvailabilityHandle, rest::MullvadRestHandle, RelayListProxy}; +use mullvad_api::{availability::ApiAvailabilityHandle, rest::MullvadRestHandle, RelayListProxy}; use mullvad_types::relay_list::RelayList; use parking_lot::Mutex; use std::{ @@ -41,7 +41,7 @@ impl RelayListUpdaterHandle { } pub struct RelayListUpdater { - rpc_client: RelayListProxy, + api_client: RelayListProxy, cache_path: PathBuf, parsed_relays: Arc<Mutex<ParsedRelays>>, on_update: Box<dyn Fn(&RelayList) + Send + 'static>, @@ -51,16 +51,16 @@ pub struct RelayListUpdater { impl RelayListUpdater { pub(super) fn new( - rpc_handle: MullvadRestHandle, + api_handle: MullvadRestHandle, cache_path: PathBuf, parsed_relays: Arc<Mutex<ParsedRelays>>, on_update: Box<dyn Fn(&RelayList) + Send + 'static>, api_availability: ApiAvailabilityHandle, ) -> RelayListUpdaterHandle { let (tx, cmd_rx) = mpsc::channel(1); - let rpc_client = RelayListProxy::new(rpc_handle); + let api_client = RelayListProxy::new(api_handle); let updater = RelayListUpdater { - rpc_client, + api_client, cache_path, parsed_relays, on_update, @@ -86,7 +86,7 @@ impl RelayListUpdater { _check_update = ticker.select_next_some() => { if download_future.is_terminated() && self.should_update() { let tag = self.parsed_relays.lock().tag().map(|tag| tag.to_string()); - download_future = Box::pin(Self::download_relay_list(self.api_availability.clone(), self.rpc_client.clone(), tag).fuse()); + download_future = Box::pin(Self::download_relay_list(self.api_availability.clone(), self.api_client.clone(), tag).fuse()); self.earliest_next_try = Instant::now() + UPDATE_INTERVAL; } }, @@ -99,7 +99,7 @@ impl RelayListUpdater { match cmd { Some(()) => { let tag = self.parsed_relays.lock().tag().map(|tag| tag.to_string()); - download_future = Box::pin(Self::download_relay_list(self.api_availability.clone(), self.rpc_client.clone(), tag).fuse()); + download_future = Box::pin(Self::download_relay_list(self.api_availability.clone(), self.api_client.clone(), tag).fuse()); }, None => { log::trace!("Relay list updater shutting down"); @@ -114,7 +114,7 @@ impl RelayListUpdater { async fn consume_new_relay_list( &mut self, - result: Result<Option<RelayList>, mullvad_rpc::Error>, + result: Result<Option<RelayList>, mullvad_api::Error>, ) { match result { Ok(Some(relay_list)) => { @@ -149,15 +149,15 @@ impl RelayListUpdater { fn download_relay_list( api_handle: ApiAvailabilityHandle, - rpc_handle: RelayListProxy, + proxy: RelayListProxy, tag: Option<String>, - ) -> impl Future<Output = Result<Option<RelayList>, mullvad_rpc::Error>> + 'static { + ) -> impl Future<Output = Result<Option<RelayList>, mullvad_api::Error>> + 'static { let download_futures = move || { let available = api_handle.wait_background(); - let req = rpc_handle.relay_list(tag.clone()); + let req = proxy.relay_list(tag.clone()); async move { available.await?; - req.await.map_err(mullvad_rpc::Error::from) + req.await.map_err(mullvad_api::Error::from) } }; diff --git a/mullvad-daemon/src/version_check.rs b/mullvad-daemon/src/version_check.rs index fba2654d6c..13792383de 100644 --- a/mullvad-daemon/src/version_check.rs +++ b/mullvad-daemon/src/version_check.rs @@ -7,7 +7,7 @@ use futures::{ stream::FusedStream, FutureExt, SinkExt, StreamExt, TryFutureExt, }; -use mullvad_rpc::{availability::ApiAvailabilityHandle, rest::MullvadRestHandle, AppVersionProxy}; +use mullvad_api::{availability::ApiAvailabilityHandle, rest::MullvadRestHandle, AppVersionProxy}; use mullvad_types::version::{AppVersionInfo, ParsedAppVersion}; use serde::{Deserialize, Serialize}; use std::{ @@ -82,10 +82,10 @@ pub enum Error { Deserialize(#[error(source)] serde_json::Error), #[error(display = "Failed to check the latest app version")] - Download(#[error(source)] mullvad_rpc::rest::Error), + Download(#[error(source)] mullvad_api::rest::Error), #[error(display = "API availability check failed")] - ApiCheck(#[error(source)] mullvad_rpc::availability::Error), + ApiCheck(#[error(source)] mullvad_api::availability::Error), #[error(display = "Clearing version check cache due to a version mismatch")] CacheVersionMismatch, @@ -151,15 +151,15 @@ impl VersionUpdaterHandle { impl VersionUpdater { pub fn new( - mut rpc_handle: MullvadRestHandle, + mut api_handle: MullvadRestHandle, availability_handle: ApiAvailabilityHandle, cache_dir: PathBuf, update_sender: DaemonEventSender<AppVersionInfo>, last_app_version_info: Option<AppVersionInfo>, show_beta_releases: bool, ) -> (Self, VersionUpdaterHandle) { - rpc_handle.factory.timeout = DOWNLOAD_TIMEOUT; - let version_proxy = AppVersionProxy::new(rpc_handle); + api_handle.factory.timeout = DOWNLOAD_TIMEOUT; + let version_proxy = AppVersionProxy::new(api_handle); let cache_path = cache_dir.join(VERSION_INFO_FILENAME); let (tx, rx) = mpsc::channel(1); let platform_version = talpid_platform_metadata::short_version(); @@ -185,7 +185,7 @@ impl VersionUpdater { &mut self, done_tx: oneshot::Sender<AppVersionInfo>, ) -> std::pin::Pin< - Box<dyn Future<Output = Result<mullvad_rpc::AppVersionResponse, Error>> + Send + 'static>, + Box<dyn Future<Output = Result<mullvad_api::AppVersionResponse, Error>> + Send + 'static>, > { self.internal_done_tx = Some(done_tx); @@ -225,7 +225,7 @@ impl VersionUpdater { fn create_update_background_future( &self, ) -> std::pin::Pin< - Box<dyn Future<Output = Result<mullvad_rpc::AppVersionResponse, Error>> + Send + 'static>, + Box<dyn Future<Output = Result<mullvad_api::AppVersionResponse, Error>> + Send + 'static>, > { let api_handle = self.availability_handle.clone(); let version_proxy = self.version_proxy.clone(); @@ -277,7 +277,7 @@ impl VersionUpdater { fn response_to_version_info( &mut self, - response: mullvad_rpc::AppVersionResponse, + response: mullvad_api::AppVersionResponse, ) -> AppVersionInfo { let suggested_upgrade = Self::suggested_upgrade( &*APP_VERSION, diff --git a/mullvad-jni/Cargo.toml b/mullvad-jni/Cargo.toml index bcb9c69443..51257988a4 100644 --- a/mullvad-jni/Cargo.toml +++ b/mullvad-jni/Cargo.toml @@ -26,6 +26,6 @@ mullvad-daemon = { path = "../mullvad-daemon" } mullvad-paths = { path = "../mullvad-paths" } mullvad-problem-report = { path = "../mullvad-problem-report" } mullvad-types = { path = "../mullvad-types" } -mullvad-rpc = { path = "../mullvad-rpc" } +mullvad-api = { path = "../mullvad-api" } talpid-core = { path = "../talpid-core" } talpid-types = { path = "../talpid-types" } diff --git a/mullvad-jni/src/daemon_interface.rs b/mullvad-jni/src/daemon_interface.rs index 3550b20d32..6b4b51f184 100644 --- a/mullvad-jni/src/daemon_interface.rs +++ b/mullvad-jni/src/daemon_interface.rs @@ -25,7 +25,7 @@ pub enum Error { NoSender, #[error(display = "Error performing RPC with the remote API")] - RpcError(#[error(source)] mullvad_rpc::rest::Error), + RpcError(#[error(source)] mullvad_api::rest::Error), #[error(display = "Failed to update settings")] SettingsError, diff --git a/mullvad-jni/src/lib.rs b/mullvad-jni/src/lib.rs index c98c132e60..3837e7d30f 100644 --- a/mullvad-jni/src/lib.rs +++ b/mullvad-jni/src/lib.rs @@ -18,11 +18,11 @@ use jnix::{ }, FromJava, IntoJava, JnixEnv, }; +use mullvad_api::{rest::Error as RestError, StatusCode}; use mullvad_daemon::{ device, exception_logging, logging, runtime::new_runtime_builder, version, Daemon, DaemonCommandChannel, }; -use mullvad_rpc::{rest::Error as RestError, StatusCode}; use mullvad_types::{ account::{AccountData, VoucherSubmission}, settings::DnsOptions, @@ -180,8 +180,8 @@ impl From<daemon_interface::Error> for VoucherSubmissionError { match error { daemon_interface::Error::RpcError(RestError::ApiError(_, code)) => { match code.as_str() { - mullvad_rpc::INVALID_VOUCHER => VoucherSubmissionError::InvalidVoucher, - mullvad_rpc::VOUCHER_USED => VoucherSubmissionError::VoucherAlreadyUsed, + mullvad_api::INVALID_VOUCHER => VoucherSubmissionError::InvalidVoucher, + mullvad_api::VOUCHER_USED => VoucherSubmissionError::VoucherAlreadyUsed, _ => VoucherSubmissionError::RpcError, } } diff --git a/mullvad-problem-report/Cargo.toml b/mullvad-problem-report/Cargo.toml index 28073d05f9..fda7dac4ab 100644 --- a/mullvad-problem-report/Cargo.toml +++ b/mullvad-problem-report/Cargo.toml @@ -19,7 +19,7 @@ uuid = { version = "0.8", features = ["v4"] } tokio = { version = "1.8", features = ["rt"] } mullvad-paths = { path = "../mullvad-paths" } -mullvad-rpc = { path = "../mullvad-rpc" } +mullvad-api = { path = "../mullvad-api" } talpid-types = { path = "../talpid-types" } talpid-platform-metadata = { path = "../talpid-platform-metadata" } diff --git a/mullvad-problem-report/src/lib.rs b/mullvad-problem-report/src/lib.rs index 4b9def6adb..2570aa6c78 100644 --- a/mullvad-problem-report/src/lib.rs +++ b/mullvad-problem-report/src/lib.rs @@ -1,7 +1,7 @@ #![deny(rust_2018_idioms)] use lazy_static::lazy_static; -use mullvad_rpc::proxy::ApiConnectionMode; +use mullvad_api::proxy::ApiConnectionMode; use regex::Regex; use std::{ borrow::Cow, @@ -64,10 +64,10 @@ pub enum Error { }, #[error(display = "Unable to create REST client")] - CreateRpcClientError(#[error(source)] mullvad_rpc::Error), + CreateRpcClientError(#[error(source)] mullvad_api::Error), #[error(display = "Failed to send problem report")] - SendProblemReportError(#[error(source)] mullvad_rpc::rest::Error), + SendProblemReportError(#[error(source)] mullvad_api::rest::Error), #[error(display = "Failed to send problem report {} times", MAX_SEND_ATTEMPTS)] SendFailedTooManyTimes, @@ -293,7 +293,7 @@ async fn send_problem_report_inner( ) -> Result<(), Error> { let metadata = ProblemReport::parse_metadata(&report_content).unwrap_or_else(|| metadata::collect()); - let rpc_runtime = mullvad_rpc::MullvadRpcRuntime::with_cache( + let api_runtime = mullvad_api::Runtime::with_cache( cache_dir, false, #[cfg(target_os = "android")] @@ -302,8 +302,8 @@ async fn send_problem_report_inner( .await .map_err(Error::CreateRpcClientError)?; - let rpc_client = mullvad_rpc::ProblemReportProxy::new( - rpc_runtime + let api_client = mullvad_api::ProblemReportProxy::new( + api_runtime .mullvad_rest_handle( ApiConnectionMode::try_from_cache(cache_dir) .await @@ -314,7 +314,7 @@ async fn send_problem_report_inner( ); for _attempt in 0..MAX_SEND_ATTEMPTS { - match rpc_client + match api_client .problem_report(user_email, user_message, &report_content, &metadata) .await { diff --git a/mullvad-setup/Cargo.toml b/mullvad-setup/Cargo.toml index adb09d7502..a55fb63e0f 100644 --- a/mullvad-setup/Cargo.toml +++ b/mullvad-setup/Cargo.toml @@ -23,7 +23,7 @@ tokio = { version = "1.8", features = ["rt-multi-thread"] } mullvad-daemon = { path = "../mullvad-daemon" } mullvad-paths = { path = "../mullvad-paths" } -mullvad-rpc = { path = "../mullvad-rpc" } +mullvad-api = { path = "../mullvad-api" } mullvad-types = { path = "../mullvad-types" } talpid-core = { path = "../talpid-core" } talpid-types = { path = "../talpid-types" } diff --git a/mullvad-setup/src/main.rs b/mullvad-setup/src/main.rs index e9289b115a..10ebb36981 100644 --- a/mullvad-setup/src/main.rs +++ b/mullvad-setup/src/main.rs @@ -1,6 +1,6 @@ use clap::{crate_authors, crate_description, crate_name, App}; +use mullvad_api::{self, proxy::ApiConnectionMode}; use mullvad_management_interface::new_rpc_client; -use mullvad_rpc::{proxy::ApiConnectionMode, MullvadRpcRuntime}; use mullvad_types::version::ParsedAppVersion; use std::{path::PathBuf, process, time::Duration}; use talpid_core::{ @@ -61,10 +61,10 @@ pub enum Error { FirewallError(#[error(source)] firewall::Error), #[error(display = "Failed to initialize mullvad RPC runtime")] - RpcInitializationError(#[error(source)] mullvad_rpc::Error), + RpcInitializationError(#[error(source)] mullvad_api::Error), #[error(display = "Failed to remove device from account")] - RemoveDeviceError(#[error(source)] mullvad_rpc::rest::Error), + RemoveDeviceError(#[error(source)] mullvad_api::rest::Error), #[error(display = "Failed to obtain settings directory path")] SettingsPathError(#[error(source)] SettingsPathErrorType), @@ -168,12 +168,12 @@ async fn remove_device() -> Result<(), Error> { .await .map_err(Error::ReadDeviceCacheError)?; if let Some(device) = data { - let rpc_runtime = MullvadRpcRuntime::with_cache(&cache_path, false) + let api_runtime = mullvad_api::Runtime::with_cache(&cache_path, false) .await .map_err(Error::RpcInitializationError)?; - let proxy = mullvad_rpc::DevicesProxy::new( - rpc_runtime + let proxy = mullvad_api::DevicesProxy::new( + api_runtime .mullvad_rest_handle( ApiConnectionMode::try_from_cache(&cache_path) .await diff --git a/mullvad-types/src/relay_list.rs b/mullvad-types/src/relay_list.rs index 9ae7874273..e638749fa5 100644 --- a/mullvad-types/src/relay_list.rs +++ b/mullvad-types/src/relay_list.rs @@ -15,7 +15,7 @@ use talpid_types::net::{ }; /// Stores a list of relays for each country obtained from the API using -/// `mullvad_rpc::RelayListProxy`. This can also be passed to frontends. +/// `mullvad_api::RelayListProxy`. This can also be passed to frontends. #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(target_os = "android", derive(IntoJava))] #[cfg_attr(target_os = "android", jnix(package = "net.mullvad.mullvadvpn.model"))] @@ -59,7 +59,7 @@ pub struct RelayListCity { } /// Stores information for a relay returned by the API at `v1/relays` using -/// `mullvad_rpc::RelayListProxy`. +/// `mullvad_api::RelayListProxy`. #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(target_os = "android", derive(IntoJava))] #[cfg_attr(target_os = "android", jnix(package = "net.mullvad.mullvadvpn.model"))] @@ -168,7 +168,7 @@ impl fmt::Display for WireguardEndpointData { } } -/// Used by `mullvad_rpc::RelayListProxy` to store bridge servers for a [`Relay`]. +/// Used by `mullvad_api::RelayListProxy` to store bridge servers for a [`Relay`]. #[derive(Debug, Default, Clone, Deserialize, Serialize)] #[serde(default)] pub struct RelayBridges { |
