Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
metalurgical committed Jul 23, 2024
1 parent d1b9ae0 commit f929165
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 79 deletions.
42 changes: 2 additions & 40 deletions Sources/TorusUtils/Helpers/NodeUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@ internal class NodeUtils {
verify_params: verifierParams.verify_params,
sss_endpoint: endpoints[j],

enable_verifier_id_hash: extraParams.enable_verifier_id_hash,
app_s: extraParams.app_s,
app_id: extraParams.app_id,
domain: extraParams.domain,
nonce: extraParams.nonce,
message: extraParams.message,
signature: extraParams.signature,
Expand All @@ -263,22 +259,7 @@ internal class NodeUtils {
publicKey: extraParams.publicKey,
challenge: extraParams.challenge,
rpOrigin: extraParams.rpOrigin,
rpId: extraParams.rpId,
jwk_endpoint: extraParams.jwk_endpoint,
default_node_set: extraParams.default_node_set,
jwt_verifier_id_field: extraParams.jwt_verifier_id_field,
jwt_verifier_id_case_sensitive: extraParams.jwt_verifier_id_case_sensitive,
jwk_keys: extraParams.jwk_keys,
jwt_validation_fields: extraParams.jwt_validation_fields,
jwt_validation_values: extraParams.jwt_validation_values,
index: extraParams.index,
email: extraParams.email,
id: extraParams.id,
correct_id_token: extraParams.correct_id_token,
verify_param: extraParams.verify_param,
threshold: extraParams.threshold,
pub_k_x: extraParams.pub_k_x,
pub_k_y: extraParams.pub_k_y
rpId: extraParams.rpId
)

importedItems.append(shareRequestItem)
Expand Down Expand Up @@ -327,10 +308,6 @@ internal class NodeUtils {
session_token_exp_second: sessionExpiry,
verify_params: verifierParams.verify_params,

enable_verifier_id_hash: extraParams.enable_verifier_id_hash,
app_s: extraParams.app_s,
app_id: extraParams.app_id,
domain: extraParams.domain,
nonce: extraParams.nonce,
message: extraParams.message,
signature: extraParams.signature,
Expand All @@ -339,22 +316,7 @@ internal class NodeUtils {
publicKey: extraParams.publicKey,
challenge: extraParams.challenge,
rpOrigin: extraParams.rpOrigin,
rpId: extraParams.rpId,
jwk_endpoint: extraParams.jwk_endpoint,
default_node_set: extraParams.default_node_set,
jwt_verifier_id_field: extraParams.jwt_verifier_id_field,
jwt_verifier_id_case_sensitive: extraParams.jwt_verifier_id_case_sensitive,
jwk_keys: extraParams.jwk_keys,
jwt_validation_fields: extraParams.jwt_validation_fields,
jwt_validation_values: extraParams.jwt_validation_values,
index: extraParams.index,
email: extraParams.email,
id: extraParams.id,
correct_id_token: extraParams.correct_id_token,
verify_param: extraParams.verify_param,
threshold: extraParams.threshold,
pub_k_x: extraParams.pub_k_x,
pub_k_y: extraParams.pub_k_y
rpId: extraParams.rpId
)

let params = ShareRequestParams(encrypted: "yes", item: [shareRequestItem], client_time: String(Int(trunc(Double((serverTimeOffset ?? 0) + Int(Date().timeIntervalSince1970))))))
Expand Down
42 changes: 3 additions & 39 deletions Sources/TorusUtils/TorusUtilsExtraParams.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import Foundation
// TODO: This class is a bit of a mess for legacy reasons and should be cleaned up in future.

public class TorusUtilsExtraParams: Codable {
var enable_verifier_id_hash: Bool? // most
var app_s: String? // meta
var app_id: String? // meta
var domain: String? // farcaster
var nonce: String? // farcaster
var message: String? // farcaster
var signature: String? // farcaster, passkey, webauthn
Expand All @@ -16,30 +12,12 @@ public class TorusUtilsExtraParams: Codable {
var challenge: String? // passkey, webauthn
var rpOrigin: String? // passkey, webauthn
var rpId: String? // passkey, webauthn
var jwk_endpoint: String? // passkey, jwt
var default_node_set: [String]? // passkey, jwt
var jwt_verifier_id_field: String? // passkey, jwt
var jwt_verifier_id_case_sensitive: Bool? // passkey, jwt
var jwk_keys: String? // passkey, jwt
var jwt_validation_fields: [String]? // passkey, jwt
var jwt_validation_values: [String]? // passkey, jwt
var index: Int? // demo
var email: String? // demo
var id: String? // test, jwt, passkey
var correct_id_token: String? // test
var verify_param: String? // OrAggregate
var session_token_exp_second: Int?
var threshold: Int? // SingleID
var pub_k_x: String? // Signature
var pub_k_y: String? // Signature
var timestamp: Int? // Signature

public init() {}

public init(enable_verifier_id_hash: Bool? = nil, app_s: String? = nil, app_id: String? = nil, domain: String? = nil, nonce: String? = nil, message: String? = nil, signature: String? = nil, clientDataJson: String? = nil, authenticatorData: String? = nil, publicKey: String? = nil, challenge: String? = nil, rpOrigin: String? = nil, rpId: String? = nil, jwk_endpoint: String? = nil, default_node_set: [String]? = nil, jwt_verifier_id_field: String? = nil, jwt_verifier_id_case_sensitive: Bool? = nil, jwk_keys: String? = nil, jwt_validation_fields: [String]? = nil, jwt_validation_values: [String]? = nil, index: Int? = nil, email: String? = nil, id: String? = nil, correct_id_token: String? = nil, verify_param: String? = nil, session_token_exp_second: Int? = nil, threshold: Int? = nil, pub_k_x: String? = nil, pub_k_y: String? = nil) {
self.enable_verifier_id_hash = enable_verifier_id_hash
self.app_s = app_s
self.app_id = app_id
self.domain = domain
public init(nonce: String? = nil, message: String? = nil, signature: String? = nil, clientDataJson: String? = nil, authenticatorData: String? = nil, publicKey: String? = nil, challenge: String? = nil, rpOrigin: String? = nil, rpId: String? = nil, session_token_exp_second: Int? = nil, timestamp: Int? = nil) {
self.nonce = nonce
self.message = message
self.signature = signature
Expand All @@ -49,21 +27,7 @@ public class TorusUtilsExtraParams: Codable {
self.challenge = challenge
self.rpOrigin = rpOrigin
self.rpId = rpId
self.jwk_endpoint = jwk_endpoint
self.default_node_set = default_node_set
self.jwt_verifier_id_field = jwt_verifier_id_field
self.jwt_verifier_id_case_sensitive = jwt_verifier_id_case_sensitive
self.jwk_keys = jwk_keys
self.jwt_validation_fields = jwt_validation_fields
self.jwt_validation_values = jwt_validation_values
self.index = index
self.email = email
self.id = id
self.correct_id_token = correct_id_token
self.verify_param = verify_param
self.session_token_exp_second = session_token_exp_second
self.threshold = threshold
self.pub_k_x = pub_k_x
self.pub_k_y = pub_k_y
self.timestamp = timestamp
}
}

0 comments on commit f929165

Please sign in to comment.