blob: b500826fdb6957121a0fe59ac654ffe89a0603f1 (
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
26
27
28
29
30
31
32
33
34
|
//
// RESTDefaults.swift
// MullvadREST
//
// Created by Sajad Vishkai on 2022-10-17.
// Copyright © 2025 Mullvad VPN AB. All rights reserved.
//
import Foundation
import MullvadRustRuntime
import MullvadTypes
extension REST {
/// The API hostname and endpoint are defined in the Info.plist of the MullvadREST framework bundle
/// This is due to not being able to target `Bundle.main` from a Unit Test environment as it gets its own bundle that would not contain the above variables.
nonisolated(unsafe) private static let infoDictionary = Bundle(for: AddressCache.self).infoDictionary!
/// Default API hostname.
public static let defaultAPIHostname = infoDictionary["ApiHostName"] as! String
/// Default API endpoint.
public static let defaultAPIEndpoint = AnyIPEndpoint(string: infoDictionary["ApiEndpoint"] as! String)!
public static let encryptedDNSHostname = infoDictionary["EncryptedDnsHostName"] as! String
/// Disables API IP address cache when in staging environment and sticks to using default API endpoint instead.
public static let isStagingEnvironment = false
/// Default network timeout for API requests.
public static let defaultAPINetworkTimeout: Duration = .seconds(10)
/// am.i.mullvad.net hostname.
public static let amIMullvadHostname = infoDictionary["AmIMullvad"] as! String
}
|