From b0088fd02e0f69347f92b49e09c0aa5a3aae7ead Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 16 Feb 2024 17:00:22 +0800 Subject: [PATCH 01/11] feat: update torus-Utils add func return full torusKey data --- Package.resolved | 13 ++++++++++-- Package.swift | 2 +- .../SingleFactorAuth/SingleFactorAuth.swift | 20 ++++++++++++------- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Package.resolved b/Package.resolved index 1fe50ca..04611a3 100644 --- a/Package.resolved +++ b/Package.resolved @@ -27,6 +27,15 @@ "version" : "1.8.0" } }, + { + "identity" : "curvelib.swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/tkey/curvelib.swift", + "state" : { + "revision" : "508322dbd3b18a92c1e9c4eb68da6a228acb1d7d", + "version" : "0.1.1" + } + }, { "identity" : "fetch-node-details-swift", "kind" : "remoteSourceControl", @@ -176,8 +185,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/torus-utils-swift", "state" : { - "revision" : "b7e4eff3bf1a135cd408f6679952ae7b476ba833", - "version" : "6.1.0" + "revision" : "76c9b17b461152e98216dddbbf320071011cf1cb", + "version" : "7.0.0" } }, { diff --git a/Package.swift b/Package.swift index 2dfcefb..cee4320 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "5.1.0"), - .package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "6.1.0"), + .package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "7.0.0"), .package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"), .package(url: "https://github.com/Web3Auth/session-manager-swift.git", from: "3.0.1") ], diff --git a/Sources/SingleFactorAuth/SingleFactorAuth.swift b/Sources/SingleFactorAuth/SingleFactorAuth.swift index 595ae75..2d11ca7 100644 --- a/Sources/SingleFactorAuth/SingleFactorAuth.swift +++ b/Sources/SingleFactorAuth/SingleFactorAuth.swift @@ -29,7 +29,7 @@ public class SingleFactorAuth { return .init(privateKey: privKey, publicAddress: publicAddress) } - public func getKey(loginParams: LoginParams) async throws -> TorusSFAKey { + public func getTorusKey(loginParams: LoginParams) async throws -> TorusKey { var retrieveSharesResponse: TorusKey let details = try await nodeDetailManager.getNodeDetails(verifier: loginParams.verifier, verifierID: loginParams.verifierId) @@ -88,11 +88,17 @@ public class SingleFactorAuth { ) } - let publicAddress = (retrieveSharesResponse.finalKeyData?.X ?? "") + (retrieveSharesResponse.finalKeyData?.Y ?? "") - let privateKey = retrieveSharesResponse.finalKeyData?.privKey ?? "" - - let torusKey = TorusSFAKey(privateKey: privateKey, publicAddress: publicAddress) - _ = try await sessionManager.createSession(data: torusKey) - return torusKey + return retrieveSharesResponse + } + + public func getKey(loginParams: LoginParams) async throws -> TorusSFAKey { + let torusKey = try await self.getTorusKey(loginParams: loginParams) + + let publicAddress = (torusKey.finalKeyData?.X ?? "") + (torusKey.finalKeyData?.Y ?? "") + let privateKey = torusKey.finalKeyData?.privKey ?? "" + + let torusSfaKey = TorusSFAKey(privateKey: privateKey, publicAddress: publicAddress) + _ = try await sessionManager.createSession(data: torusSfaKey) + return torusSfaKey } } From 30a8d1f91f765a53ecb11699c18d2669be40f6fa Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 23 Feb 2024 09:39:45 +0800 Subject: [PATCH 02/11] fix: add web3AuthClientId --- Sources/SingleFactorAuth/SingleFactorAuth.swift | 3 ++- Sources/SingleFactorAuth/SingleFactorAuthArgs.swift | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Sources/SingleFactorAuth/SingleFactorAuth.swift b/Sources/SingleFactorAuth/SingleFactorAuth.swift index 2d11ca7..b11b5a9 100644 --- a/Sources/SingleFactorAuth/SingleFactorAuth.swift +++ b/Sources/SingleFactorAuth/SingleFactorAuth.swift @@ -18,7 +18,8 @@ public class SingleFactorAuth { enableOneKey: true, signerHost: singleFactorAuthArgs.getSignerUrl()! + "/api/sign", allowHost: singleFactorAuthArgs.getSignerUrl()! + "/api/allow", - network: singleFactorAuthArgs.getNetwork() + network: singleFactorAuthArgs.getNetwork(), + clientId: singleFactorAuthArgs.getWeb3AuthClientId() ) } diff --git a/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift b/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift index f40cc26..f98d837 100644 --- a/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift +++ b/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift @@ -14,10 +14,16 @@ public class SingleFactorAuthArgs { private var network: TorusNetwork private var networkUrl: String + private var web3AuthClientId: String - public init(network: TorusNetwork, networkUrl: String = "") { + public init(web3AuthClientId: String = "", network: TorusNetwork, networkUrl: String = "") { self.network = network self.networkUrl = networkUrl + self.web3AuthClientId = web3AuthClientId + } + + public func getWeb3AuthClientId() -> String { + return web3AuthClientId } public func getNetwork() -> TorusNetwork { From 0015535ad4caeccbc8c93b630b5e482511893841 Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 8 Mar 2024 11:26:32 +0800 Subject: [PATCH 03/11] feat: bump torus utils version --- Package.resolved | 71 +++++++++++++++++++++++++++--------------------- Package.swift | 2 +- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/Package.resolved b/Package.resolved index 04611a3..7b54d4e 100644 --- a/Package.resolved +++ b/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", "state" : { - "revision" : "db51c407d3be4a051484a141bf0bff36c43d3b1e", - "version" : "1.8.0" + "revision" : "7892a123f7e8d0fe62f9f03728b17bbd4f94df5c", + "version" : "1.8.1" } }, { @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/tkey/curvelib.swift", "state" : { - "revision" : "508322dbd3b18a92c1e9c4eb68da6a228acb1d7d", - "version" : "0.1.1" + "revision" : "7dad3bf1793de263f83406c08c18c9316abf082f", + "version" : "0.1.2" } }, { @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/jwt-kit.git", "state" : { - "revision" : "ef12bdfa557cd9d9f0c53396e0a9908f773bcd7b", - "version" : "4.9.0" + "revision" : "e05513b5aec24f88012b6e3034115b6bc915356a", + "version" : "4.13.2" } }, { @@ -75,10 +75,10 @@ { "identity" : "secp256k1.swift", "kind" : "remoteSourceControl", - "location" : "https://github.com/GigaBitcoin/secp256k1.swift", + "location" : "https://github.com/GigaBitcoin/secp256k1.swift.git", "state" : { - "revision" : "1a14e189def5eaa92f839afdd2faad8e43b61a6e", - "version" : "0.12.2" + "revision" : "347b84ed2aad2305a7233f2a48d76f41e52062a1", + "version" : "0.16.0" } }, { @@ -104,8 +104,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "a902f1823a7ff3c9ab2fba0f992396b948eda307", - "version" : "1.0.5" + "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", + "version" : "1.1.0" } }, { @@ -113,8 +113,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-crypto.git", "state" : { - "revision" : "6d9c36b4beda0dae88feab6dc36206434bae713c", - "version" : "2.4.1" + "revision" : "cc76b894169a3c86b71bac10c78a4db6beb7a9ad", + "version" : "3.2.0" } }, { @@ -122,8 +122,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-http-types", "state" : { - "revision" : "99d066e29effa8845e4761dd3f2f831edfdf8925", - "version" : "1.0.0" + "revision" : "12358d55a3824bd5fed310b999ea8cf83a9a1a65", + "version" : "1.0.3" } }, { @@ -131,8 +131,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "532d8b529501fb73a2455b179e0bbb6d49b652ed", - "version" : "1.5.3" + "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", + "version" : "1.5.4" } }, { @@ -140,8 +140,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "853522d90871b4b63262843196685795b5008c46", - "version" : "2.61.1" + "revision" : "fc63f0cf4e55a4597407a9fc95b16a2bc44b4982", + "version" : "2.64.0" } }, { @@ -149,8 +149,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "798c962495593a23fdea0c0c63fd55571d8dff51", - "version" : "1.20.0" + "revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63", + "version" : "1.22.0" } }, { @@ -158,8 +158,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "3bd9004b9d685ed6b629760fc84903e48efec806", - "version" : "1.29.0" + "revision" : "0904bf0feb5122b7e5c3f15db7df0eabe623dd87", + "version" : "1.30.0" } }, { @@ -167,8 +167,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "320bd978cceb8e88c125dcbb774943a92f6286e9", - "version" : "2.25.0" + "revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5", + "version" : "2.26.0" } }, { @@ -176,8 +176,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "ebf8b9c365a6ce043bf6e6326a04b15589bd285e", - "version" : "1.20.0" + "revision" : "6cbe0ed2b394f21ab0d46b9f0c50c6be964968ce", + "version" : "1.20.1" + } + }, + { + "identity" : "swift-system", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-system.git", + "state" : { + "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496", + "version" : "1.2.1" } }, { @@ -185,8 +194,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/torus-utils-swift", "state" : { - "revision" : "76c9b17b461152e98216dddbbf320071011cf1cb", - "version" : "7.0.0" + "revision" : "3fb829e71caa275556a067a1ffa1ca579bafbf8e", + "version" : "7.0.1" } }, { @@ -194,8 +203,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/argentlabs/web3.swift", "state" : { - "revision" : "8ca33e700ed8de6137a0e1471017aa3b3c8de0db", - "version" : "1.6.0" + "revision" : "1e75f98a5738c470b23bbfffa9314e9f788df76b", + "version" : "1.6.1" } }, { diff --git a/Package.swift b/Package.swift index cee4320..8fe7b83 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "5.1.0"), - .package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "7.0.0"), + .package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "7.0.1"), .package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"), .package(url: "https://github.com/Web3Auth/session-manager-swift.git", from: "3.0.1") ], From b64ea85aa09d05da6369f7c3ef3c6a7d20ecaa87 Mon Sep 17 00:00:00 2001 From: ieow Date: Thu, 21 Mar 2024 17:20:06 +0800 Subject: [PATCH 04/11] feat: make client id mandatory --- Sources/SingleFactorAuth/SingleFactorAuthArgs.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift b/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift index f98d837..2c787ca 100644 --- a/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift +++ b/Sources/SingleFactorAuth/SingleFactorAuthArgs.swift @@ -16,7 +16,7 @@ public class SingleFactorAuthArgs { private var networkUrl: String private var web3AuthClientId: String - public init(web3AuthClientId: String = "", network: TorusNetwork, networkUrl: String = "") { + public init(web3AuthClientId: String, network: TorusNetwork, networkUrl: String = "") { self.network = network self.networkUrl = networkUrl self.web3AuthClientId = web3AuthClientId From 34bc349d47372814c91343fce79c52e5557d54d6 Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 22 Mar 2024 15:34:16 +0800 Subject: [PATCH 05/11] fix: test --- Package.resolved | 8 ++++---- Tests/SingleFactorAuthTests/AquaTest.swift | 2 +- Tests/SingleFactorAuthTests/CyanTest.swift | 2 +- Tests/SingleFactorAuthTests/SingleFactorAuthTests.swift | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Package.resolved b/Package.resolved index 7b54d4e..8bc876c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -113,8 +113,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-crypto.git", "state" : { - "revision" : "cc76b894169a3c86b71bac10c78a4db6beb7a9ad", - "version" : "3.2.0" + "revision" : "f0525da24dc3c6cbb2b6b338b65042bc91cbc4bb", + "version" : "3.3.0" } }, { @@ -212,8 +212,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vapor/websocket-kit.git", "state" : { - "revision" : "53fe0639a98903858d0196b699720decb42aee7b", - "version" : "2.14.0" + "revision" : "4232d34efa49f633ba61afde365d3896fc7f8740", + "version" : "2.15.0" } } ], diff --git a/Tests/SingleFactorAuthTests/AquaTest.swift b/Tests/SingleFactorAuthTests/AquaTest.swift index 0ae26f3..bf597ae 100644 --- a/Tests/SingleFactorAuthTests/AquaTest.swift +++ b/Tests/SingleFactorAuthTests/AquaTest.swift @@ -14,7 +14,7 @@ final class AquaTest: XCTestCase { let TEST_AGGREGRATE_VERIFIER = "torus-test-health-aggregate" override func setUp() { - singleFactorAuthArgs = SingleFactorAuthArgs(network: TorusNetwork.legacy(.AQUA)) + singleFactorAuthArgs = SingleFactorAuthArgs(web3AuthClientId: "CLIENT ID", network: TorusNetwork.legacy(.AQUA)) singleFactoreAuth = SingleFactorAuth(singleFactorAuthArgs: singleFactorAuthArgs) } diff --git a/Tests/SingleFactorAuthTests/CyanTest.swift b/Tests/SingleFactorAuthTests/CyanTest.swift index c7636de..138b499 100644 --- a/Tests/SingleFactorAuthTests/CyanTest.swift +++ b/Tests/SingleFactorAuthTests/CyanTest.swift @@ -14,7 +14,7 @@ final class CyanTest: XCTestCase { let TEST_AGGREGRATE_VERIFIER = "torus-test-health-aggregate" override func setUp() { - singleFactorAuthArgs = SingleFactorAuthArgs(network: TorusNetwork.legacy(.CYAN)) + singleFactorAuthArgs = SingleFactorAuthArgs(web3AuthClientId: "CLIENT ID", network: TorusNetwork.legacy(.CYAN)) singleFactoreAuth = SingleFactorAuth(singleFactorAuthArgs: singleFactorAuthArgs) } diff --git a/Tests/SingleFactorAuthTests/SingleFactorAuthTests.swift b/Tests/SingleFactorAuthTests/SingleFactorAuthTests.swift index 80d3ceb..ec9f955 100644 --- a/Tests/SingleFactorAuthTests/SingleFactorAuthTests.swift +++ b/Tests/SingleFactorAuthTests/SingleFactorAuthTests.swift @@ -14,7 +14,7 @@ final class SingleFactorAuthTests: XCTestCase { let TEST_AGGREGRATE_VERIFIER = "torus-test-health-aggregate" override func setUp() { - singleFactorAuthArgs = SingleFactorAuthArgs(network: TorusNetwork.legacy(.TESTNET)) + singleFactorAuthArgs = SingleFactorAuthArgs(web3AuthClientId: "CLIENT ID", network: TorusNetwork.legacy(.TESTNET)) singleFactoreAuth = SingleFactorAuth(singleFactorAuthArgs: singleFactorAuthArgs) } From c23e7f14d94e7204882f376bac355df84abbade2 Mon Sep 17 00:00:00 2001 From: ieow Date: Mon, 25 Mar 2024 14:39:34 +0800 Subject: [PATCH 06/11] fix: update torus-utils with latest tag 8.0.0 --- Package.resolved | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 8bc876c..99a36e6 100644 --- a/Package.resolved +++ b/Package.resolved @@ -194,8 +194,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/torusresearch/torus-utils-swift", "state" : { - "revision" : "3fb829e71caa275556a067a1ffa1ca579bafbf8e", - "version" : "7.0.1" + "revision" : "04c62fd5f73f21bd01b7c07e08f6135db26c5940", + "version" : "8.0.0" } }, { diff --git a/Package.swift b/Package.swift index 8fe7b83..3720583 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "5.1.0"), - .package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "7.0.1"), + .package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "8.0.0"), .package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"), .package(url: "https://github.com/Web3Auth/session-manager-swift.git", from: "3.0.1") ], From d7e1504d013ccd409632e5a55b7eb304df37a5a2 Mon Sep 17 00:00:00 2001 From: ieow Date: Tue, 26 Mar 2024 12:55:47 +0800 Subject: [PATCH 07/11] update ci --- .github/workflows/main.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65f78f6..c6e5d14 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,19 +17,14 @@ on: # Checkout the code, and run mxcl's xcodebuild action to run the unit tests jobs: - build: - runs-on: macOS-latest - strategy: - matrix: - platform: - - iOS + test: + runs-on: macos-latest steps: - - uses: actions/checkout@v2.3.4 - - uses: mxcl/xcodebuild@v1 + - name: checkout + uses: actions/checkout@v3 + - name: xcode + uses: maxim-lobanov/setup-xcode@v1 with: - platform: ${{ matrix.platform }} - action: test - scheme: SingleFactorAuth - code-coverage: true - upload-logs: always - + xcode-version: "14.2.0" + - name: package + run: xcodebuild test -scheme SingleFactorAuth -destination "platform=iOS Simulator,OS=16.2,name=iPhone 14" COMPILER_INDEX_STORE_ENABLE=NO From c3326f86c7892350217567bcb15cd841c4f58db3 Mon Sep 17 00:00:00 2001 From: ieow Date: Wed, 3 Apr 2024 11:29:59 +0800 Subject: [PATCH 08/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6e5d14..1d96378 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,6 +25,6 @@ jobs: - name: xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: "14.2.0" + xcode-version: "15.2.0" - name: package run: xcodebuild test -scheme SingleFactorAuth -destination "platform=iOS Simulator,OS=16.2,name=iPhone 14" COMPILER_INDEX_STORE_ENABLE=NO From 96be7c5539e24a90457e47de63f475aaf696e758 Mon Sep 17 00:00:00 2001 From: ieow Date: Wed, 3 Apr 2024 11:35:51 +0800 Subject: [PATCH 09/11] fix: xcode-version --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d96378..e6901d4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ on: workflow_dispatch: # Checkout the code, and run mxcl's xcodebuild action to run the unit tests + jobs: test: runs-on: macos-latest @@ -25,6 +26,6 @@ jobs: - name: xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: "15.2.0" + xcode-version: latest-stable - name: package run: xcodebuild test -scheme SingleFactorAuth -destination "platform=iOS Simulator,OS=16.2,name=iPhone 14" COMPILER_INDEX_STORE_ENABLE=NO From 68b1c7bb006ac2539cf64f99895fa67a3be7cfcd Mon Sep 17 00:00:00 2001 From: ieow Date: Wed, 3 Apr 2024 11:57:48 +0800 Subject: [PATCH 10/11] update: session manager --- Package.resolved | 130 +---------------------------------------------- Package.swift | 2 +- 2 files changed, 3 insertions(+), 129 deletions(-) diff --git a/Package.resolved b/Package.resolved index 99a36e6..a6ceeca 100644 --- a/Package.resolved +++ b/Package.resolved @@ -45,15 +45,6 @@ "version" : "5.1.0" } }, - { - "identity" : "generic-json-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/iwill/generic-json-swift", - "state" : { - "revision" : "0a06575f4038b504e78ac330913d920f1630f510", - "version" : "2.0.2" - } - }, { "identity" : "jwt-kit", "kind" : "remoteSourceControl", @@ -72,40 +63,13 @@ "version" : "20.0.0" } }, - { - "identity" : "secp256k1.swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/GigaBitcoin/secp256k1.swift.git", - "state" : { - "revision" : "347b84ed2aad2305a7233f2a48d76f41e52062a1", - "version" : "0.16.0" - } - }, { "identity" : "session-manager-swift", "kind" : "remoteSourceControl", "location" : "https://github.com/Web3Auth/session-manager-swift.git", "state" : { - "revision" : "f4e6f24dfe0bac88eb9a7aeda1cd73caad69a9ce", - "version" : "3.0.1" - } - }, - { - "identity" : "swift-atomics", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-atomics.git", - "state" : { - "revision" : "cd142fd2f64be2100422d658e7411e39489da985", - "version" : "1.2.0" - } - }, - { - "identity" : "swift-collections", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-collections.git", - "state" : { - "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", - "version" : "1.1.0" + "revision" : "290e36cd0646f7fb3be737b65bdfc9f5428dfd5c", + "version" : "3.1.0" } }, { @@ -117,78 +81,6 @@ "version" : "3.3.0" } }, - { - "identity" : "swift-http-types", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-http-types", - "state" : { - "revision" : "12358d55a3824bd5fed310b999ea8cf83a9a1a65", - "version" : "1.0.3" - } - }, - { - "identity" : "swift-log", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-log.git", - "state" : { - "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", - "version" : "1.5.4" - } - }, - { - "identity" : "swift-nio", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio.git", - "state" : { - "revision" : "fc63f0cf4e55a4597407a9fc95b16a2bc44b4982", - "version" : "2.64.0" - } - }, - { - "identity" : "swift-nio-extras", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-extras.git", - "state" : { - "revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63", - "version" : "1.22.0" - } - }, - { - "identity" : "swift-nio-http2", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-http2.git", - "state" : { - "revision" : "0904bf0feb5122b7e5c3f15db7df0eabe623dd87", - "version" : "1.30.0" - } - }, - { - "identity" : "swift-nio-ssl", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-ssl.git", - "state" : { - "revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5", - "version" : "2.26.0" - } - }, - { - "identity" : "swift-nio-transport-services", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-transport-services.git", - "state" : { - "revision" : "6cbe0ed2b394f21ab0d46b9f0c50c6be964968ce", - "version" : "1.20.1" - } - }, - { - "identity" : "swift-system", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-system.git", - "state" : { - "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496", - "version" : "1.2.1" - } - }, { "identity" : "torus-utils-swift", "kind" : "remoteSourceControl", @@ -197,24 +89,6 @@ "revision" : "04c62fd5f73f21bd01b7c07e08f6135db26c5940", "version" : "8.0.0" } - }, - { - "identity" : "web3.swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/argentlabs/web3.swift", - "state" : { - "revision" : "1e75f98a5738c470b23bbfffa9314e9f788df76b", - "version" : "1.6.1" - } - }, - { - "identity" : "websocket-kit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/vapor/websocket-kit.git", - "state" : { - "revision" : "4232d34efa49f633ba61afde365d3896fc7f8740", - "version" : "2.15.0" - } } ], "version" : 2 diff --git a/Package.swift b/Package.swift index 3720583..2a50e46 100644 --- a/Package.swift +++ b/Package.swift @@ -18,7 +18,7 @@ let package = Package( .package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "5.1.0"), .package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "8.0.0"), .package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"), - .package(url: "https://github.com/Web3Auth/session-manager-swift.git", from: "3.0.1") + .package(url: "https://github.com/Web3Auth/session-manager-swift.git", from: "3.1.0") ], targets: [ .target( From 7a5caa3df191d7970b4ff80802ad4233b172dd0e Mon Sep 17 00:00:00 2001 From: ieow Date: Wed, 3 Apr 2024 12:19:30 +0800 Subject: [PATCH 11/11] fix: fix conversion --- Sources/SingleFactorAuth/SingleFactorAuth.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SingleFactorAuth/SingleFactorAuth.swift b/Sources/SingleFactorAuth/SingleFactorAuth.swift index b11b5a9..0d784c6 100644 --- a/Sources/SingleFactorAuth/SingleFactorAuth.swift +++ b/Sources/SingleFactorAuth/SingleFactorAuth.swift @@ -64,8 +64,8 @@ public class SingleFactorAuth { ] as [String: Codable] let verifierParams = VerifierParams(verifier_id: loginParams.verifierId) - - let aggregateIdToken = String(String(bytes: aggregateIdTokenSeeds.joined(separator: "\u{001d}").bytes.sha3(.keccak256)).dropFirst(2)) // drop 0x + + let aggregateIdToken = aggregateIdTokenSeeds.joined(separator: "\u{001d}").bytes.sha3(.keccak256).toHexString() // drop 0x retrieveSharesResponse = try await torusUtils.retrieveShares( endpoints: details.getTorusNodeEndpoints(),