summaryrefslogtreecommitdiffhomepage
path: root/mullvad-api/src/lib.rs
AgeCommit message (Collapse)AuthorFilesLines
2025-01-02Remove global API endpointEmīls1-88/+64
2024-12-02Make SNI hostname implicitDavid Lönnhager1-5/+0
2024-12-02Remove DNS fallback except for conncheckDavid Lönnhager1-37/+29
2024-11-26Add missing resolver for iOS testsDavid Lönnhager1-0/+1
2024-11-22Add non-blocking DNS resolver for Android API requestsDavid Lönnhager1-2/+50
2024-10-16Replace occurrences of old `Body` type in `rest` modSebastian Holmin1-2/+1
Use `Empty<Bytes>` for outgoing, `Incoming` for responses and generic paras for our type wrapping `Request`.
2024-10-02Fix bug when overriding API with only MULLVAD_API_HOSTLinus Färnstrand1-0/+1
2024-10-01Rename account "token" to account "number"Joakim Hulthe1-10/+10
2024-09-26Implement `Default` for `ApiAvailibility`Markus Pettersson1-3/+5
2024-09-25Consolidate two mutexes into oneMarkus Pettersson1-4/+4
2024-07-30Ignore obfuscation protocol specific constraints when 'auto' is selectedDavid Lönnhager1-2/+1
2024-07-26Fix `doc list item missing indentation`Sebastian Holmin1-1/+1
2024-06-10Use configured hostname for access tokenEmīls1-3/+3
2024-04-22Fix broken lints in rustdocsSebastian Holmin1-2/+2
I ran `cargo doc` and fixed as many broken links as I could find.
2024-02-27Replace err_derive with thiserrorJoakim Hulthe1-7/+7
`err_derive` is unmaintained and will probably stop working with rust edition 2024. `thiserror` is almost a drop-in replacement. This commit simply replaces all occurences of `derive(err_derive::Error)` with `derive(thiserror::Error)` and fixes the attributes, but the Error and Display impls should be identical.
2024-02-19Move responsibility of updating the API IP from REST handle to the daemonDavid Lönnhager1-13/+7
2024-02-16Refactor API access methodsDavid Lönnhager1-16/+9
2024-02-16Only force direct mode by default when overriding the API host/addrDavid Lönnhager1-7/+8
2024-02-15Add `force_direct` flag to API overrideMarkus Pettersson1-21/+46
2024-02-15Fix off-by-one error when choosing access method candidatesMarkus Pettersson1-24/+22
2024-02-15Fix `mullvad-api` build on androidMarkus Pettersson1-3/+1
2024-02-14Add MullvadApi to MullvadVPNUITetstsEmīls1-2/+2
2024-02-14Fix talpid-time for iOS, add FFI for mullvad-apiEmīls1-0/+56
2024-01-16Do not try to resolve API address if `MULLVAD_API_HOST` is not setMarkus Pettersson1-17/+24
If the `api-override` feature is enabled, we allow overriding the ip address to the Mullvad API by settings the `MULLVAD_API_ADDRESS` env variable or have it be resolved automatically if `MULLVAD_API_HOST` is overriden. This commit fixes a bug where we would try to resolve the API address when `MULLVAD_API_ADDRESS` was not set even if `MULLVAD_API_ADDRESS` was not set either.
2024-01-11Synchronize `mullvad-api` and `mullvad-daemon` when the `api-override`Markus Pettersson1-66/+140
feature is enabled Move the logic for using overridden API endpoints for API calls from `mullvad-api::rest` to `mullvad_daemon::api`. This is in line with how the interaction between the two crates work for a normal release build, i.e. when the `api-override` feature is disabled. This commit also removes references to `force_direct_connection` in the Android code. The flag does not exist in the `mullvad-*` rust crates anymore, so it would be erroneous to try to serialize/deserialize the value from the Android client.
2024-01-08Remove `ApiEndpointUpdateHandler`Markus Pettersson1-19/+1
Previously, the `mullvad-api` would tell the `mullvad-daemon` that it wanted a new API endpoint by calling a certain callback (`ApiEndpointUpdateCallback`), which would asynchronously resolve a new API endpoint and tell the daemon to punch an appropriate hole in the firewall for that particular endpoint before the `mullvad-api` crate would consume it. The logic of the callback can be moved inside `AccessModeSelector`, which simplifies the contract between `mullvad-daemon` and `mullvad-api` somewhat.
2024-01-05Run `cargo +nightly fmt`Sebastian Holmin1-1/+1
2024-01-04Add workspace level lintsLinus Färnstrand1-2/+0
2023-12-29Fetch account ID from APIDavid Lönnhager1-11/+4
2023-12-04Perform testing of access methods asynchronouslyMarkus Pettersson1-16/+8
Perform testing of access methods asynchronously in a separate `tokio` task as to not block the daemon from handling other daemon events during the testing window
2023-12-04Move access method testing logic to `mullvad-daemon`Markus Pettersson1-0/+20
Move access method testing logic to `mullvad-daemon`, which means that the implementation details of how the test works is opaque to whatever frontend which wants to issue a test of some (configured) access method.
2023-11-28Add retry for `GetCurrentLocation`Sebastian Holmin1-1/+1
2023-11-07Configure firewall rules to allow proxy clientsMarkus Pettersson1-3/+3
The default setting will (always) be to only allow processes with root-privilege to send/receive traffic from an allowed endpoint. This change is only supposed to be used with the local SOCKS5 api access method.
2023-11-07Add configurable transport protocol to local SOCKS5 access methodMarkus Pettersson1-3/+3
2023-10-30Share hostname string in RequestFactoryDavid Lönnhager1-1/+1
2023-10-30Remove unused URL componentDavid Lönnhager1-1/+1
2023-10-30Newtype REST ResponseDavid Lönnhager1-11/+8
2023-10-30Handle authentication and errors in API clientDavid Lönnhager1-113/+55
2023-10-19Fold all access token requests into a single requestDavid Lönnhager1-9/+27
2023-10-16Add android conditional compilation for google payJonathan1-1/+6
Add conditional compilation for google pay API access for only android. Also allow new error type to be parsed. Additionally fix review comments, formatting and warnings.
2023-10-16Add piping for google play payment API requestsJonathan1-1/+58
This commit adds all of the basic piping in order to let Android use the JNI interface in order to make requests to our API pertaining to google play payment initialization and status.
2023-08-04Replace all use of `lazy_static` with `once_cell`Markus Pettersson1-1/+1
To align more with the upcoming standardizations within the Rust ecosystem which started with the release of `1.70.0` and the inevitable deprecation of `lazy_static`.
2023-08-04Remove some use of `once_cell` with new std alternativesMarkus Pettersson1-4/+4
`OnceCell` and `OnceLock` was stabilized in Rust `1.70.0`, which allow us to refactor some use of the `once_cell` crate to use the implementations in the standard library.
2023-07-14Remove `x_threshold_wg_default` codeMarkus Pettersson1-10/+0
Since we migrated to using Wireguard as the definitive default VPN, we can stop reading the `x_threshold_wg_default` field from the API and remove all daemon code related to using it
2023-03-29Remove getters and setters from SettingsPersisterDavid Lönnhager1-1/+0
2023-01-30Run `cargo clippy --fix` with the new Rust 1.67 preferred formatLinus Färnstrand1-8/+8
2022-11-28Conditionally compile some API override fieldsDavid Lönnhager1-2/+14
2022-11-28Warn about MULLVAD_API_DISABLE_TLS being set if the API address and host are notDavid Lönnhager1-3/+10
2022-11-28Make API address overridable from MullvadDaemonDavid Lönnhager1-9/+44
2022-11-28Add option to disable TLS for API RPCs, and resolve address from hostname if ↵David Lönnhager1-14/+28
needed