Pull request

Implement getrelays using mullvad api

Why this needs to be done

getRelays call should use the mullvad-api client, without replacing existing implementation.

What needs to be done

The API proxy should be implemented using mullvad-api, allowing us to move to the new implementation without removing the old code. For fetching the relay list, the swift side needs to obtain an etag and then also pass the etag to rust again, so that the etag can be used when requesting a new relay list.

Duplicate methods in the APIQuerying interface should also be removed.

Acceptance criteria

There is an APIProxy implementation that uses mullvad-api.

see less
File matrix
21 files21 files
r1
r2
r3
r4
r1
r2
r3
r4
ios/ios/
MullvadMockData/MullvadREST/MullvadMockData/MullvadREST/
r1
r2
r3
r4
MullvadREST/MullvadREST/
ApiHandlers/ApiHandlers/
r1
r2
r3
r4
r4
r1
r2
r3
r4
MullvadAPI/MullvadAPI/
r1
r2
r3
r4
r1
r2
r3
r4
APIHandlers/APIHandlers/
r2
r3
r4
APIRequest/APIRequest/
r1
r2
r3
r4
Transport/Transport/
r1
r2
r3
r4
MullvadRustRuntime/MullvadRustRuntime/
r1
r2
r3
r4
include/include/
r1
r2
r3
r4
MullvadVPN.xcodeproj/MullvadVPN.xcodeproj/
r1
r2
r3
r4
MullvadVPNTests/MullvadVPN/View controllers/Filter/MullvadVPNTests/MullvadVPN/View controllers/Filter/
r2
r3
r4
mullvad-api/src/mullvad-api/src/
r1
r2
r3
r4
mullvad-ios/src/api_client/mullvad-ios/src/api_client/
r1
r2
r3
r4
r2
r3
r4
r1
r2
r3
r4
⤭ Only renamed   ungroup
ios/MullvadREST/MullvadAPI/APIRequest/ios/MullvadREST/MullvadAPI/APIRequest/
r1
r2
r3
r4
r1
r2
r3
r4
↺ Reverted   ungroup
ios/MullvadVPN/RelayCacheTracker/ios/MullvadVPN/RelayCacheTracker/
r1
r2
r3
r4
~11 +248 -85
+14
-7
-78
+1
~10 +15
~1
+218
adjust what's shown in the file matrix here.
Participants
waiting on
participant
status
role
contributor
last active
drafts
discussions
Diffs
  Reviewing the latest revision (r4) against its ⊥ base revision.

Next diffs to review (file selection:

)

Show other diffs: All changes

Preferences
Top level discussions
Review discussion
1 week ago
New comments
linear[bot]
1 week ago
rabladorJon Petersson

To test, replace:

REST.APIProxy(configuration: configuration)

with:

MullvadAPIProxy(
    transportProvider: configuration.apiTransportProvider,
    dispatchQueue: DispatchQueue(label: "MullvadAPIProxy.dispatchQueue"),
    responseDecoder: Coding.makeJSONDecoder()
)

in ProxyFactory.createAPIProxy().

r1
r2
r3
r4
+14
Revision mapping:
Compact 4 revisions Click and hold to arm, release to activate.
Some revisions contain multiple commits because they were snapshotted before the review switched to "review each commit separately" style.
r1
r2
r3
r4
-7
r1
r2
r3
r4
-78
r4
+1
r1
r2
r3
r4
~10 +15
r1
r2
r3
r4
~1
File renamed from ios/MullvadREST/ApiHandlers/MullvadApiNetworkOperation.swift   to ios/MullvadREST/MullvadAPI/MullvadApiNetworkOperation.swift   in this diff.
r1
r2
r3
r4
File renamed from ios/MullvadREST/ApiHandlers/MullvadApiRequestFactory.swift   to ios/MullvadREST/MullvadAPI/MullvadApiRequestFactory.swift   in this diff.
r2
r3
r4
+218
r1
r2
r3
r4
File renamed from ios/MullvadREST/APIRequest/APIRequest.swift   to ios/MullvadREST/MullvadAPI/APIRequest/APIRequest.swift   in this diff.
r1
r2
r3
r4
r1
r2
r3
r4
r1
r2
r3
r4
r1
r2
r3
r4
r2
r3
r4
r1
r2
r3
r4
r1
r2
r3
r4
r2
r3
r4
r1
r2
r3
r4
r1
r2
r3
r4
File renamed from ios/MullvadREST/APIRequest/APIError.swift   to ios/MullvadREST/MullvadAPI/APIRequest/APIError.swift   in this diff.
r1
r2
r3
r4
File renamed from ios/MullvadREST/APIRequest/APIRequestProxy.swift   to ios/MullvadREST/MullvadAPI/APIRequest/APIRequestProxy.swift   in this diff.
r1
r2
r3
r4
File reverted to base at r4 with no further changes.
ios/MullvadMockData/MullvadREST/APIProxy+Stubs.swift
ios/MullvadREST/ApiHandlers/RESTAPIProxy.swift
ios/MullvadREST/ApiHandlers/RESTResponseHandler.swift
ios/MullvadREST/Transport/APITransport.swift
ios/MullvadRustRuntime/MullvadApiResponse.swift
ios/MullvadRustRuntime/include/mullvad_rust_runtime.h
ios/MullvadVPN.xcodeproj/project.pbxproj
ios/MullvadVPN/RelayCacheTracker/RelayCacheTracker.swift
mullvad-api/src/relay_list.rs
mullvad-ios/src/api_client/api.rs
mullvad-ios/src/api_client/response.rs
ios/MullvadREST/MullvadAPI/APIHandlers/MullvadAPIProxy.swift
ios/MullvadVPNTests/MullvadVPN/View controllers/Filter/RelayFilterViewModelTests.swift
mullvad-ios/src/api_client/mod.rs
ios/MullvadREST/ApiHandlers/RESTError.swift
-- commits
ios/MullvadREST/MullvadAPI/APIRequest/APIError.swift
ios/MullvadREST/MullvadAPI/APIRequest/APIRequest.swift
ios/MullvadREST/MullvadAPI/APIRequest/APIRequestProxy.swift
ios/MullvadREST/MullvadAPI/MullvadApiNetworkOperation.swift
ios/MullvadREST/MullvadAPI/MullvadApiRequestFactory.swift
~11 +248 -85
-7
-78
~10 +15
+218
+1
+14
~1
Use of Reviewable is subject to the terms of useprivacy policy.