summaryrefslogtreecommitdiffhomepage
path: root/mullvad-api
AgeCommit message (Collapse)AuthorFilesLines
2024-10-16Replace old client with `hyper_util` legacy clientSebastian Holmin5-48/+55
2024-10-16Add `impl From<Infallible> for Error`Sebastian Holmin1-0/+7
2024-10-16Replace occurrences of old `Body` type in `rest` modSebastian Holmin3-77/+153
Use `Empty<Bytes>` for outgoing, `Incoming` for responses and generic paras for our type wrapping `Request`.
2024-10-16Update `rustls` in `tls_stream.rs`Sebastian Holmin2-12/+13
2024-10-16Update `hyper` and other deps that use `hyper`Sebastian Holmin1-4/+6
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 Hulthe4-33/+31
2024-09-26Add unit tests to `availability` moduleMarkus Pettersson2-0/+40
2024-09-26Implement `Default` for `ApiAvailibility`Markus Pettersson2-11/+19
2024-09-26Fix regression in API timer logicDavid Lönnhager1-2/+10
2024-09-25Consolidate two mutexes into oneMarkus Pettersson3-149/+149
2024-09-25Add `futures` to workspace dependenciesSebastian Holmin1-1/+1
2024-09-17Remove Option from Relay::locationJoakim Hulthe1-1/+1
2024-08-27Use std LazyLock instead of once_cell LazyDavid Lönnhager2-3/+2
2024-08-22Fix IP-override feature indicatorSebastian Holmin1-0/+2
It was trigger by any overrides existing in the settings, not by the current endpoint being overridden. Add flag to `Relay` to specify if its IPv4 and/or IPv6 has been overridden and use that in combination with the endpoint IP version to derive if the current connection is overridden.
2024-08-16Use range types for all port rangesDavid Lönnhager1-2/+16
Breaks backwards compatibility with relays.json (which is acceptable)
2024-08-16Parse shadowsocks ports in relay listDavid Lönnhager1-1/+8
2024-08-07Promote serde(_json) to workspace dependenciesJoakim Hulthe1-2/+2
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-07-25Upgrade pfctl to 0.5.0 and ipnetwork to 0.20Linus Färnstrand1-1/+1
2024-06-10Use configured hostname for access tokenEmīls4-11/+11
2024-04-22Fix broken lints in rustdocsSebastian Holmin2-3/+3
I ran `cargo doc` and fixed as many broken links as I could find.
2024-04-16Add DAITA Windows client and updated tuncfgDavid Lönnhager1-0/+3
2024-04-03Wrap AbortableStream abort receiver in FuseDavid Lönnhager1-2/+4
The contract of FusedFuture says that a future may not be polled when resolved, not that it is safe to poll it afterwards
2024-03-07Add comments explaining decisionsBug Magnet1-0/+2
2024-03-07Force environment variables when running on iOSBug Magnet1-0/+4
2024-02-27Replace err_derive with thiserrorJoakim Hulthe7-38/+37
`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-21Create device proxy on tokio runtimeDavid Lönnhager1-2/+4
2024-02-19Fix redundant importsDavid Lönnhager1-1/+1
2024-02-19Move responsibility of updating the API IP from REST handle to the daemonDavid Lönnhager3-73/+10
2024-02-19Fix pointless API method rotations when concurrent requests failDavid Lönnhager1-4/+14
2024-02-16Refactor API access methodsDavid Lönnhager4-60/+82
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 the mullvad API ffi, consume the header after building itBug Magnet1-4/+2
2024-02-15Fix off-by-one error when choosing access method candidatesMarkus Pettersson3-34/+30
2024-02-15Fix `mullvad-api` build on iosMarkus Pettersson1-7/+10
2024-02-15Fix `mullvad-api` build on androidMarkus Pettersson1-3/+1
2024-02-14Add MullvadApi to MullvadVPNUITetstsEmīls2-2/+167
2024-02-14Fix talpid-time for iOS, add FFI for mullvad-apiEmīls8-4/+688
2024-01-23Use infallible HeaderValue::from() when converting from usizeAndrej Mihajlov1-6/+2
2024-01-16Add rust-version to all Cargo.tomlLinus Färnstrand1-0/+1
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-12Validate SOCKS5 credentialsMarkus Pettersson1-26/+13
Validate SOCKS credentials by checking that both `username` and `password` both have a length between 1 and 255 bytes. Link to RFC detailing SOCKS5 username/password authentication: https://datatracker.ietf.org/doc/html/rfc1929
2024-01-11Synchronize `mullvad-api` and `mullvad-daemon` when the `api-override`Markus Pettersson4-91/+149
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-09Remove version and publish cargo metadataLinus Färnstrand1-2/+0
Since Rust 1.75.0 the `version` field is optional. The version defaults to "0.0.0" if it's not specified, and `publish` defaults to false if no version has been given. So by not specifying a version we get both `version = "0.0.0" and `publish = false` "for free"
2024-01-08Remove `ApiEndpointUpdateHandler`Markus Pettersson4-86/+23
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 Holmin2-3/+2
2024-01-04Add workspace level lintsLinus Färnstrand2-2/+3