summaryrefslogtreecommitdiffhomepage
path: root/ios/PacketTunnel/DeviceCheck/DeviceCheckRemoteServiceProtocol.swift
blob: 0cab26654f8710d538875417b6bf9d89f92ce37b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//
//  DeviceCheckRemoteServiceProtocol.swift
//  PacketTunnel
//
//  Created by pronebird on 07/06/2023.
//  Copyright © 2023 Mullvad VPN AB. All rights reserved.
//

import Foundation
import MullvadTypes
import WireGuardKitTypes

/// 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
}