diff options
Diffstat (limited to 'mullvad-management-interface')
| -rw-r--r-- | mullvad-management-interface/proto/management_interface.proto | 2 | ||||
| -rw-r--r-- | mullvad-management-interface/src/client.rs | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/mullvad-management-interface/proto/management_interface.proto b/mullvad-management-interface/proto/management_interface.proto index dfefd54f75..27b8d24864 100644 --- a/mullvad-management-interface/proto/management_interface.proto +++ b/mullvad-management-interface/proto/management_interface.proto @@ -157,6 +157,8 @@ service ManagementService { // Personal VPN rpc SetPersonalVpnConfig(PersonalVpnConfig) returns (PersonalVpnConfigError) {} rpc SetPersonalVpnConfigStatus(google.protobuf.BoolValue) returns (google.protobuf.Empty) {} + // Parse a wg-quick config file and store it as the personal VPN config. + rpc ImportPersonalVpnConfig(google.protobuf.StringValue) returns (PersonalVpnConfigError) {} // Always exists rpc GetPersonalVpnStats(google.protobuf.Empty) returns (stream PersonalVpnStats) {} } diff --git a/mullvad-management-interface/src/client.rs b/mullvad-management-interface/src/client.rs index d1594f1e71..bddc94d0be 100644 --- a/mullvad-management-interface/src/client.rs +++ b/mullvad-management-interface/src/client.rs @@ -694,6 +694,13 @@ impl MullvadProxyClient { self.0.set_personal_vpn_config_status(enabled).await?; Ok(()) } + + /// Import a personal VPN configuration from the contents of a wg-quick file. + #[cfg(feature = "personal-vpn")] + pub async fn import_personal_vpn_config(&mut self, body: String) -> Result<String> { + let response = self.0.import_personal_vpn_config(body).await?; + Ok(response.into_inner().error) + } } #[cfg(not(target_os = "android"))] |
