diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2023-04-26 19:15:51 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2023-06-08 13:21:50 +0200 |
| commit | dab9467547a35369aafdda7174287921dc7accc8 (patch) | |
| tree | c76f15cc8d0819f3eef59e766235bfd7049a5503 /ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift | |
| parent | 0ca8f82db446df494b400f0b467de1bef9e051e4 (diff) | |
| download | mullvadvpn-dab9467547a35369aafdda7174287921dc7accc8.tar.xz mullvadvpn-dab9467547a35369aafdda7174287921dc7accc8.zip | |
PacketTunnel: rotate private key on mismatch with server
Diffstat (limited to 'ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift')
| -rw-r--r-- | ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift b/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift new file mode 100644 index 0000000000..faf22e3680 --- /dev/null +++ b/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift @@ -0,0 +1,25 @@ +// +// DeviceCheckRemoteServiceProtocol.swift +// PacketTunnel +// +// Created by pronebird on 07/06/2023. +// Copyright © 2023 Mullvad VPN AB. All rights reserved. +// + +import Foundation +import MullvadTypes +import class WireGuardKitTypes.PublicKey + +/// A protocol that formalizes remote service dependency used by `DeviceCheckOperation`. +protocol DeviceCheckRemoteServiceProtocol { + func getAccountData(accountNumber: String, completion: @escaping (Result<Account, Error>) -> Void) + -> Cancellable + func getDevice(accountNumber: String, identifier: String, completion: @escaping (Result<Device, Error>) -> Void) + -> Cancellable + func rotateDeviceKey( + accountNumber: String, + identifier: String, + publicKey: PublicKey, + completion: @escaping (Result<Device, Error>) -> Void + ) -> Cancellable +} |
