Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ let package = Package(
targets: ["SingleFactorAuth"])
],
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: "8.0.0"),
.package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "6.0.1"),
.package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "8.1.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.1.0")
.package(url: "https://github.com/Web3Auth/session-manager-swift.git", from: "4.0.2"),
],
targets: [
.target(
Expand Down
9 changes: 5 additions & 4 deletions SingleFactorAuth.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "SingleFactorAuth"
spec.version = "3.0.0"
spec.version = "5.0.0"
spec.ios.deployment_target = "14.0"
spec.summary = "Enable one key flow for Web3Auth"
spec.homepage = "https://github.com/Web3Auth/single-factor-auth-swift"
Expand All @@ -10,7 +10,8 @@ Pod::Spec.new do |spec|
spec.module_name = "SingleFactorAuth"
spec.source = { :git => "https://github.com/web3Auth/single-factor-auth-swift", :tag => spec.version }
spec.source_files = "Sources/SingleFactorAuth/*.{swift,json}","Sources/SingleFactorAuth/**/*.{swift,json}"
spec.dependency 'Torus-fetchNodeDetails', '~> 5.1.0'
spec.dependency 'Torus-utils', '~> 6.1.0'
spec.dependency 'TorusSessionManager', '~> 3.0.1'
spec.dependency 'Torus-fetchNodeDetails', '~> 6.0.1'
spec.dependency 'curvelib.swift', '~> 1.0.1'
spec.dependency 'Torus-utils', '~> 8.1.0'
spec.dependency 'TorusSessionManager', '~> 4.0.2'
end
6 changes: 2 additions & 4 deletions Sources/SingleFactorAuth/SingleFactorAuth.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import BigInt
import Combine
import CryptoSwift
import FetchNodeDetails
import Foundation
import SessionManager
import TorusUtils
import curveSecp256k1

public class SingleFactorAuth {
let nodeDetailManager: NodeDetailManager
Expand All @@ -16,8 +16,6 @@ public class SingleFactorAuth {
nodeDetailManager = NodeDetailManager(network: singleFactorAuthArgs.getNetwork().network)
torusUtils = TorusUtils(
enableOneKey: true,
signerHost: singleFactorAuthArgs.getSignerUrl()! + "/api/sign",
allowHost: singleFactorAuthArgs.getSignerUrl()! + "/api/allow",
network: singleFactorAuthArgs.getNetwork().network,
clientId: singleFactorAuthArgs.getWeb3AuthClientId()
)
Expand Down Expand Up @@ -65,7 +63,7 @@ public class SingleFactorAuth {

let verifierParams = VerifierParams(verifier_id: loginParams.verifierId)

let aggregateIdToken = aggregateIdTokenSeeds.joined(separator: "\u{001d}").bytes.sha3(.keccak256).toHexString() // drop 0x
let aggregateIdToken = try curveSecp256k1.keccak256(data: Data(aggregateIdTokenSeeds.joined(separator: "\u{001d}").utf8)).toHexString()

retrieveSharesResponse = try await torusUtils.retrieveShares(
endpoints: details.getTorusNodeEndpoints(),
Expand Down
1 change: 0 additions & 1 deletion Sources/SingleFactorAuth/SingleFactorAuthArgs.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import CommonSources
import FetchNodeDetails
import TorusUtils

Expand Down
1 change: 0 additions & 1 deletion Tests/SingleFactorAuthTests/AquaTest.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import BigInt
import CommonSources
import JWTKit
import XCTest

Expand Down
1 change: 0 additions & 1 deletion Tests/SingleFactorAuthTests/CyanTest.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import BigInt
import CommonSources
import JWTKit
import XCTest

Expand Down
1 change: 0 additions & 1 deletion Tests/SingleFactorAuthTests/SingleFactorAuthTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import BigInt
import CommonSources
import JWTKit
import XCTest

Expand Down