feat: consolidate iOS with API and web preserving history
Rebuild & Deploy / rebuild (push) Failing after 23s
Rebuild & Deploy / rebuild (push) Failing after 23s
This commit is contained in:
commit
d735ee72fa
102 files changed
+13077
-258
No files matched your search
@@ -0,0 +1,46 @@
|
||||
import Foundation
|
||||
import LiveKit
|
||||
import Testing
|
||||
@testable import Voice
|
||||
|
||||
/// Explicit opt-in native CFNetwork probe; no account credentials or bodies.
|
||||
struct TLSLiveTests {
|
||||
@Test func pinnedLANHTTPS() async throws {
|
||||
guard ProcessInfo.processInfo.environment["HOPE_TLS_LIVE"] == "1" else {
|
||||
print("HOPE_TLS_PROBE skipped: explicit live opt-in absent")
|
||||
return
|
||||
}
|
||||
print("HOPE_TLS_PROBE native HTTPS validation started")
|
||||
let (data, response) = try await TLSPinning.session().data(from: URL(string: "https://192.168.86.2:9178/api/auth/me")!)
|
||||
#expect((response as? HTTPURLResponse)?.statusCode == 401)
|
||||
#expect(!data.isEmpty)
|
||||
}
|
||||
|
||||
@Test func systemTrustedLANHTTPS() async throws {
|
||||
guard ProcessInfo.processInfo.environment["HOPE_TLS_LIVE"] == "1" else { return }
|
||||
print("HOPE_TLS_PROBE system trust validation started")
|
||||
let (_, response) = try await URLSession.shared.data(from: URL(string: "https://192.168.86.2:9178/api/auth/me")!)
|
||||
#expect((response as? HTTPURLResponse)?.statusCode == 401)
|
||||
print("HOPE_TLS_PROBE system trust validation completed")
|
||||
}
|
||||
|
||||
@Test func nativeAccountLogin() async throws {
|
||||
let env = ProcessInfo.processInfo.environment
|
||||
guard env["HOPE_TLS_LIVE"] == "1", let username = env["HOPE_TEST_USERNAME"],
|
||||
let password = env["HOPE_TEST_PASSWORD"] else { return }
|
||||
print("HOPE_TLS_PROBE native account login started")
|
||||
let config = try ServerConfig.parse("https://192.168.86.2:9178").get()
|
||||
let client = AuthClient(config: config)
|
||||
let login = try await client.login(username: username, password: password)
|
||||
#expect(login.user.username == username)
|
||||
#expect(try await client.me(token: login.token).id == login.user.id)
|
||||
let bootstrap = try await TokenClient(config: config, bearerToken: login.token).fetchToken()
|
||||
let room = Room()
|
||||
try await room.connect(url: config.livekitURL.absoluteString, token: bootstrap.token)
|
||||
#expect(room.connectionState == .connected)
|
||||
await room.disconnect()
|
||||
print("HOPE_TLS_PROBE authenticated LiveKit WSS connected and disconnected; microphone not enabled")
|
||||
try await client.logout(token: login.token)
|
||||
print("HOPE_TLS_PROBE native login/me/logout completed")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user