Files
hapi/ios/Packages/HapiKit/Tests/HapiClientTests/PasskeyTestSupport.swift
T
weishu ee3d7eed4c feat(auth): share passkeys across web and native apps
Use auth.hapi.run as the shared RP with an isolated static browser bridge, Hub-bound challenges and accounts, and one-time PKCE code exchange.

Update iOS and Android validation, app associations, deployment documentation, and bidirectional browser regression coverage.
2026-11-17 11:39:01 +08:00

20 lines
684 B
Swift

import Foundation
@testable import HapiClient
#if canImport(CryptoKit)
let passkeyRegistrationAvailable = true
#else
let passkeyRegistrationAvailable = false
#endif
func boundPasskeyChallenge(hub: String = testHubURLString, operation: String = "login", channel: String = "native") -> Data {
try! JSONSerialization.data(withJSONObject: [
"v": 1, "hub": hub, "id": String(repeating: "a", count: 43),
"nonce": String(repeating: "b", count: 43), "operation": operation, "channel": channel
], options: [.sortedKeys])
}
func boundPasskeyUser(hub: String = testHubURLString) -> Data {
PasskeyHubBinding.digest(Data(hub.utf8)) + Data(repeating: 1, count: 32)
}