summaryrefslogtreecommitdiffhomepage
path: root/mullvad-api/src/rest.rs
AgeCommit message (Collapse)AuthorFilesLines
2025-07-15Fix `collapsible_if` clippy lintMarkus Pettersson1-12/+13
2025-07-10Run `cargo fmt`Sebastian Holmin1-3/+3
2025-05-08Add storekit 2 functions to mullvad apiSteffen Ernst1-5/+18
2025-03-25Add function for fetching version info from new endpoint to mullvad-apiDavid Lönnhager1-2/+24
Co-authored-by: Sebastian Holmin <sebastian.holmin@mullvad.net>
2025-02-21Implement an FFI to fetch API IP addresses using mullvad-apiJon Petersson1-0/+4
2025-01-02Remove global API endpointEmīls1-1/+3
2024-12-02Make SNI hostname implicitDavid Lönnhager1-2/+0
2024-12-02Remove DNS fallback except for conncheckDavid Lönnhager1-3/+0
2024-11-22Add non-blocking DNS resolver for Android API requestsDavid Lönnhager1-0/+3
2024-10-16Replace old client with `hyper_util` legacy clientSebastian Holmin1-28/+38
2024-10-16Add `impl From<Infallible> for Error`Sebastian Holmin1-0/+7
2024-10-16Replace occurrences of old `Body` type in `rest` modSebastian Holmin1-73/+150
Use `Empty<Bytes>` for outgoing, `Incoming` for responses and generic paras for our type wrapping `Request`.
2024-10-01Rename account "token" to account "number"Joakim Hulthe1-5/+5
2024-09-25Consolidate two mutexes into oneMarkus Pettersson1-8/+8
2024-02-27Replace err_derive with thiserrorJoakim Hulthe1-14/+14
`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-60/+1
2024-02-19Fix pointless API method rotations when concurrent requests failDavid Lönnhager1-4/+14
2024-02-16Refactor API access methodsDavid Lönnhager1-33/+32
2024-02-15Fix off-by-one error when choosing access method candidatesMarkus Pettersson1-5/+4
2024-02-14Fix talpid-time for iOS, add FFI for mullvad-apiEmīls1-4/+11
2024-01-23Use infallible HeaderValue::from() when converting from usizeAndrej Mihajlov1-6/+2
2024-01-11Synchronize `mullvad-api` and `mullvad-daemon` when the `api-override`Markus Pettersson1-22/+6
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-39/+10
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-02Fix clippy lintsDavid Lönnhager1-1/+1
2023-12-04Perform testing of access methods asynchronouslyMarkus Pettersson1-0/+4
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-11-07Configure firewall rules to allow proxy clientsMarkus Pettersson1-2/+4
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-2/+8
2023-10-30Ignore dropped response channel in API clientDavid Lönnhager1-3/+1
2023-10-30Share hostname string in RequestFactoryDavid Lönnhager1-3/+3
2023-10-30Rename REST request factory timeoutDavid Lönnhager1-4/+9
2023-10-30Remove unused URL componentDavid Lönnhager1-9/+2
2023-10-30Wait for unsuspendDavid Lönnhager1-4/+18
2023-10-30Newtype REST ResponseDavid Lönnhager1-24/+42
2023-10-30Rename RestRequest to RequestDavid Lönnhager1-25/+24
2023-10-30Handle authentication and errors in API clientDavid Lönnhager1-197/+148
2023-10-24Remove 'ResponseFailure' device error variantDavid Lönnhager1-15/+11
2023-10-23Improve error handling for API requests that failed to due being offlineDavid Lönnhager1-1/+16
2023-10-19Fold all access token requests into a single requestDavid Lönnhager1-48/+51
2023-10-16Add android conditional compilation for google payJonathan1-3/+29
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-09UX improvements for `mullvad api-access`Markus Pettersson1-6/+18
- Re-phrase help texts for a lot of `mullvad api-access` commands - Add to help texts for some `mullvad api-access` commands - Compact the output of `mullvad api-access test` - `mullvad api-access status` is changed to `mullvad api-access get` to align with other `mullvad` commands. - `mullvad api-access get` does not print the enabled/disabled status of the shown access method - Rotate access method if the currently active one is updated or removed - Fix reset access method after `mullvad api-access test` After running `mullvad api-access test`, the previously used access method should be used, which was not the case previously. - Fix `mullvad api-access use` API connectivity check - `mullvad api-access use` now runs a test-routine to check that the new access method will function before comitting to it. If this check fails, the previously used access method will be used instead - guarantee that `set_api_access_method` has finished upon returning. Make `mullvad_api::rest::next_api_endpoint` `async` and send a message upon completion. This is propagated to the caller of `next_api_endpoint` which can `await` the result
2023-09-20Remove deadcode from mullvad-apiEmīls1-16/+0
2023-03-27Fix many typosAlexander Seiler1-1/+1
Signed-off-by: Alexander Seiler <seileralex@gmail.com>
2023-02-08Make async fns without awaits into regular fnsLinus Färnstrand1-1/+1
2023-01-30Run `cargo clippy --fix` with the new Rust 1.67 preferred formatLinus Färnstrand1-1/+1
2022-11-28Conditionally compile some API override fieldsDavid Lönnhager1-4/+14
2022-11-28Don't use bridges if the API endpoint is overriddenDavid Lönnhager1-1/+9
2022-06-21Fix the large majority of clippy warningsJonathan1-1/+1
This commit fixes most of the remaining clippy warnings in the codebase. These warnings were the more semantically difficult ones to fix. There are some warnings that remain from the rebase that will be fixed in the upcoming PR.
2022-06-14Manually fix the simpler non-semantic clippy warnsJonathan1-8/+2
This commit tries to manually fix the clippy warnings that are fairly straightforward and do not have rippling effects on the codebase nor have a very high chance of causing bugs.
2022-06-13Perform a clippy --fixjonathan1-10/+9
This is a giant commit which performs only a clippy --fix. Auditing can happen in two ways, either by reading every line or by running a `cargo clippy --fix` on the previous commit and make sure that the result is the same.
2022-05-11Don't stop device check if an API request is abortedDavid Lönnhager1-0/+7