Skip to content

Commit 61eb03f

Browse files
committed
Merge branch 'implement-privatekey-and-publickey-types-in-ios-1562'
2 parents ea23aa2 + 33b0cf0 commit 61eb03f

85 files changed

Lines changed: 824 additions & 338 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ios/MullvadMockData/MullvadREST/APIProxy+Stubs.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import Foundation
1010
import MullvadREST
1111
import MullvadTypes
12-
import WireGuardKitTypes
1312

1413
struct APIProxyStubError: Error {}
1514

ios/MullvadMockData/MullvadREST/DevicesProxy+Stubs.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import Foundation
1010
import MullvadREST
1111
import MullvadTypes
12-
import WireGuardKitTypes
1312

1413
struct DevicesProxyStubError: Error {}
1514

@@ -62,7 +61,7 @@ struct DevicesProxyStub: DeviceHandling {
6261
func rotateDeviceKey(
6362
accountNumber: String,
6463
identifier: String,
65-
publicKey: PublicKey,
64+
publicKey: WireGuard.PublicKey,
6665
retryStrategy: REST.RetryStrategy,
6766
completion: @escaping ProxyCompletionHandler<Device>
6867
) -> Cancellable {

ios/MullvadMockData/MullvadREST/MockProxyFactory.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Foundation
1010
import MullvadREST
1111
import MullvadRustRuntime
1212
import MullvadTypes
13-
import WireGuardKitTypes
1413

1514
public struct MockProxyFactory: ProxyFactoryProtocol {
1615
public var apiTransportProvider: APITransportProviderProtocol
@@ -24,7 +23,7 @@ public struct MockProxyFactory: ProxyFactoryProtocol {
2423
}
2524

2625
public func createDevicesProxy() -> any DeviceHandling {
27-
DevicesProxyStub(deviceResult: .success(Device.mock(publicKey: PrivateKey().publicKey)))
26+
DevicesProxyStub(deviceResult: .success(Device.mock(publicKey: WireGuard.PrivateKey().publicKey)))
2827
}
2928

3029
public static func makeProxyFactory(

ios/MullvadMockData/MullvadREST/RelaySelectorStub.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import MullvadREST
1010
import MullvadSettings
1111
import MullvadTypes
1212
import Network
13-
import WireGuardKitTypes
1413

1514
/// Relay selector stub that accepts a block that can be used to provide custom implementation.
1615
public final class RelaySelectorStub: RelaySelectorProtocol {
@@ -47,7 +46,7 @@ public final class RelaySelectorStub: RelaySelectorProtocol {
4746
socketAddress: .ipv4(IPv4Endpoint(ip: .loopback, port: 1300)),
4847
ipv4Gateway: .loopback,
4948
ipv6Gateway: .loopback,
50-
publicKey: PrivateKey().publicKey.rawValue,
49+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
5150
obfuscation: .off
5251
),
5352
hostname: "se-got",
@@ -80,7 +79,7 @@ extension RelaySelectorStub {
8079
socketAddress: .ipv4(IPv4Endpoint(ip: .loopback, port: 1300)),
8180
ipv4Gateway: .loopback,
8281
ipv6Gateway: .loopback,
83-
publicKey: PrivateKey().publicKey.rawValue,
82+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
8483
obfuscation: .off
8584
),
8685
hostname: "se-got",

ios/MullvadMockData/MullvadREST/ServerRelaysResponse+Stubs.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
import Foundation
10-
import WireGuardKitTypes
10+
import MullvadTypes
1111

1212
@testable import MullvadREST
1313

@@ -132,7 +132,7 @@ public enum ServerRelaysResponseStubs {
132132
weight: 500,
133133
ipv4AddrIn: .loopback,
134134
ipv6AddrIn: .loopback,
135-
publicKey: PrivateKey().publicKey.rawValue,
135+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
136136
includeInCountry: true,
137137
daita: true,
138138
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -147,7 +147,7 @@ public enum ServerRelaysResponseStubs {
147147
weight: 500,
148148
ipv4AddrIn: .loopback,
149149
ipv6AddrIn: .loopback,
150-
publicKey: PrivateKey().publicKey.rawValue,
150+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
151151
includeInCountry: true,
152152
daita: true,
153153
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -162,7 +162,7 @@ public enum ServerRelaysResponseStubs {
162162
weight: 500,
163163
ipv4AddrIn: .loopback,
164164
ipv6AddrIn: .loopback,
165-
publicKey: PrivateKey().publicKey.rawValue,
165+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
166166
includeInCountry: true,
167167
daita: true,
168168
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -177,7 +177,7 @@ public enum ServerRelaysResponseStubs {
177177
weight: 500,
178178
ipv4AddrIn: .loopback,
179179
ipv6AddrIn: .loopback,
180-
publicKey: PrivateKey().publicKey.rawValue,
180+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
181181
includeInCountry: true,
182182
daita: true,
183183
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -192,7 +192,7 @@ public enum ServerRelaysResponseStubs {
192192
weight: 500,
193193
ipv4AddrIn: .loopback,
194194
ipv6AddrIn: .loopback,
195-
publicKey: PrivateKey().publicKey.rawValue,
195+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
196196
includeInCountry: true,
197197
daita: true,
198198
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -207,7 +207,7 @@ public enum ServerRelaysResponseStubs {
207207
weight: 1000,
208208
ipv4AddrIn: .loopback,
209209
ipv6AddrIn: .loopback,
210-
publicKey: PrivateKey().publicKey.rawValue,
210+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
211211
includeInCountry: true,
212212
daita: false,
213213
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -226,7 +226,7 @@ public enum ServerRelaysResponseStubs {
226226
weight: 50,
227227
ipv4AddrIn: .loopback,
228228
ipv6AddrIn: .loopback,
229-
publicKey: PrivateKey().publicKey.rawValue,
229+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
230230
includeInCountry: true,
231231
daita: false,
232232
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -241,7 +241,7 @@ public enum ServerRelaysResponseStubs {
241241
weight: 100,
242242
ipv4AddrIn: .loopback,
243243
ipv6AddrIn: .loopback,
244-
publicKey: PrivateKey().publicKey.rawValue,
244+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
245245
includeInCountry: true,
246246
daita: false,
247247
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -256,7 +256,7 @@ public enum ServerRelaysResponseStubs {
256256
weight: 500,
257257
ipv4AddrIn: .loopback,
258258
ipv6AddrIn: .loopback,
259-
publicKey: PrivateKey().publicKey.rawValue,
259+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
260260
includeInCountry: true,
261261
daita: true,
262262
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -271,7 +271,7 @@ public enum ServerRelaysResponseStubs {
271271
weight: 100,
272272
ipv4AddrIn: .loopback,
273273
ipv6AddrIn: .loopback,
274-
publicKey: PrivateKey().publicKey.rawValue,
274+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
275275
includeInCountry: true,
276276
daita: true,
277277
shadowsocksExtraAddrIn: ["0.0.0.0"],
@@ -286,7 +286,7 @@ public enum ServerRelaysResponseStubs {
286286
weight: 100,
287287
ipv4AddrIn: .loopback,
288288
ipv6AddrIn: .loopback,
289-
publicKey: PrivateKey().publicKey.rawValue,
289+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
290290
includeInCountry: true,
291291
daita: true,
292292
shadowsocksExtraAddrIn: nil,
@@ -301,7 +301,7 @@ public enum ServerRelaysResponseStubs {
301301
weight: 100,
302302
ipv4AddrIn: .loopback,
303303
ipv6AddrIn: .loopback,
304-
publicKey: PrivateKey().publicKey.rawValue,
304+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
305305
includeInCountry: true,
306306
daita: true,
307307
shadowsocksExtraAddrIn: nil,
@@ -316,7 +316,7 @@ public enum ServerRelaysResponseStubs {
316316
weight: 100,
317317
ipv4AddrIn: .loopback,
318318
ipv6AddrIn: .loopback,
319-
publicKey: PrivateKey().publicKey.rawValue,
319+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
320320
includeInCountry: true,
321321
daita: false,
322322
shadowsocksExtraAddrIn: nil,
@@ -331,7 +331,7 @@ public enum ServerRelaysResponseStubs {
331331
weight: 100,
332332
ipv4AddrIn: .loopback,
333333
ipv6AddrIn: .loopback,
334-
publicKey: PrivateKey().publicKey.rawValue,
334+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
335335
includeInCountry: true,
336336
daita: false,
337337
shadowsocksExtraAddrIn: nil,
@@ -346,7 +346,7 @@ public enum ServerRelaysResponseStubs {
346346
weight: 100,
347347
ipv4AddrIn: .loopback,
348348
ipv6AddrIn: .loopback,
349-
publicKey: PrivateKey().publicKey.rawValue,
349+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
350350
includeInCountry: true,
351351
daita: false,
352352
shadowsocksExtraAddrIn: nil,
@@ -361,7 +361,7 @@ public enum ServerRelaysResponseStubs {
361361
weight: 100,
362362
ipv4AddrIn: .loopback,
363363
ipv6AddrIn: .loopback,
364-
publicKey: PrivateKey().publicKey.rawValue,
364+
publicKey: WireGuard.PrivateKey().publicKey.rawValue,
365365
includeInCountry: true,
366366
daita: true,
367367
shadowsocksExtraAddrIn: nil,

ios/MullvadMockData/MullvadTypes/DeviceMock.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
import Foundation
1010
import MullvadTypes
11-
import WireGuardKitTypes
11+
import WireGuardKitTypes // IPAddressRange
1212

1313
extension Device {
14-
public static func mock(publicKey: PublicKey) -> Device {
14+
public static func mock(publicKey: WireGuard.PublicKey) -> Device {
1515
Device(
1616
id: "device-id",
1717
name: "Secure Mole",

ios/MullvadREST/ApiHandlers/DeviceHandling.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import Foundation
1010
import MullvadTypes
11-
@preconcurrency import WireGuardKitTypes
1211

1312
public protocol DeviceHandling: Sendable {
1413
func getDevice(
@@ -41,7 +40,7 @@ public protocol DeviceHandling: Sendable {
4140
func rotateDeviceKey(
4241
accountNumber: String,
4342
identifier: String,
44-
publicKey: PublicKey,
43+
publicKey: WireGuard.PublicKey,
4544
retryStrategy: REST.RetryStrategy,
4645
completion: @escaping @Sendable ProxyCompletionHandler<Device>
4746
) -> Cancellable

ios/MullvadREST/ApiHandlers/RESTSubmitVoucherResponse.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Foundation
1010
import MullvadRustRuntime
1111
import MullvadTypes
1212
import Operations
13-
import WireGuardKitTypes
1413

1514
extension REST {
1615
public struct SubmitVoucherResponse: Decodable, Sendable {

ios/MullvadREST/MullvadAPI/APIHandlers/MullvadAPIProxy.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import MullvadRustRuntime
1010
import MullvadTypes
1111
import Operations
12-
import WireGuardKitTypes
1312

1413
public protocol APIQuerying: Sendable {
1514
func getAddressList(

ios/MullvadREST/MullvadAPI/APIHandlers/MullvadAccountProxy.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import MullvadRustRuntime
1010
import MullvadTypes
1111
import Operations
12-
import WireGuardKitTypes
1312

1413
public protocol RESTAccountHandling: Sendable {
1514
func createAccount(

0 commit comments

Comments
 (0)