Compare commits

...

1 Commits

4 changed files with 14 additions and 0 deletions
@@ -34,6 +34,7 @@ public struct DeveloperServicesLoginManager: Sendable {
private func logIn(
withLoginData loginData: GrandSlamLoginData
) async throws -> DeveloperServicesLoginToken {
print("Fetching tokens")
let tokens = try await GrandSlamFetchAppTokensOperation(
client: client,
apps: [.xcode],
@@ -49,6 +50,7 @@ public struct DeveloperServicesLoginManager: Sendable {
password: String,
twoFactorDelegate: TwoFactorAuthDelegate
) async throws -> DeveloperServicesLoginToken {
print("Starting login")
let loginData = try await GrandSlamAuthenticateOperation(
client: client,
// GSA requires Apple IDs in lowercase for SRP
@@ -65,6 +65,8 @@ struct GrandSlamAuthenticateOperation {
}
private func authenticate(isRetry: Bool) async throws -> GrandSlamLoginData {
print("Doing SRP stuff")
var srpClient = SRPClient()
srpClient.add(string: GrandSlamAuthInitRequest.protocols.joined(separator: ","))
@@ -116,6 +118,8 @@ struct GrandSlamAuthenticateOperation {
)
}
print("Got loginData")
return loginData
}
@@ -64,6 +64,7 @@ struct GrandSlamFetchAppTokensOperation {
func perform() async throws -> [AppTokenKey: Token] {
let checksum = AppTokens.checksum(withSK: loginData.sk, adsid: loginData.adsid, apps: apps.map { $0.rawValue })
print("Got checksum")
let appTokensRequest = GrandSlamAppTokensRequest(
username: loginData.adsid,
apps: apps,
@@ -71,7 +72,9 @@ struct GrandSlamFetchAppTokensOperation {
idmsToken: loginData.idmsToken,
checksum: checksum
)
print("Sending tokens req")
let response = try await client.send(appTokensRequest)
print("Handling tokens resp")
return try await self.handle(response: response)
}
+5
View File
@@ -98,8 +98,13 @@ struct AuthOperation {
twoFactorDelegate: authDelegate
)
print("Got full login token")
let client = DeveloperServicesClient(loginToken: token)
let teams = try await client.send(DeveloperServicesListTeamsRequest())
print("Got teams")
let team = try await Console.choose(
from: teams,
onNoElement: {