-
-
Notifications
You must be signed in to change notification settings - Fork 11
use native bs58 #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use native bs58 #177
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { INodePub, KEY_TYPE, SIGNER_MAP, TORUS_NETWORK_TYPE } from "@toruslabs/constants"; | ||
| import { generatePrivate, getPublic } from "@toruslabs/eccrypto"; | ||
| import { generateJsonRPCObject, get, post } from "@toruslabs/http-helpers"; | ||
| import { generateJsonRPCObject, post } from "@toruslabs/http-helpers"; | ||
|
|
||
| import { config } from "../config"; | ||
| import { JRPC_METHODS } from "../constants"; | ||
|
|
@@ -363,7 +363,7 @@ export async function retrieveOrImportShare(params: { | |
| newImportedShares?: ImportedShare[]; | ||
| checkCommitment?: boolean; | ||
| source?: string; | ||
| authorizationServerUrl?: string; | ||
| citadelServerUrl?: string; | ||
| }): Promise<TorusKey> { | ||
| const { | ||
| legacyMetadataHost, | ||
|
|
@@ -385,37 +385,20 @@ export async function retrieveOrImportShare(params: { | |
| serverTimeOffset, | ||
| checkCommitment = true, | ||
| source, | ||
| authorizationServerUrl, | ||
| citadelServerUrl, | ||
| } = params; | ||
| if (authorizationServerUrl) { | ||
| await post<void>( | ||
| authorizationServerUrl, | ||
| { | ||
| verifier, | ||
| verifier_id: verifierParams.verifier_id, | ||
| network, | ||
| client_id: clientId, | ||
| enable_gating: "true", | ||
| ...(source ? { source } : {}), | ||
| }, | ||
| {}, | ||
| { useAPIKey: true } | ||
| ); | ||
| } else { | ||
| await get<void>( | ||
| `${SIGNER_MAP[network]}/api/allow`, | ||
| { | ||
| headers: { | ||
| verifier, | ||
| verifierid: verifierParams.verifier_id, | ||
| network, | ||
| clientid: clientId, | ||
| enablegating: "true", | ||
| }, | ||
| }, | ||
| { useAPIKey: true } | ||
| ); | ||
| } | ||
|
|
||
| await post<void>( | ||
| citadelServerUrl || `${SIGNER_MAP[network]}/api/allow`, | ||
| { | ||
| verifier, | ||
| verifier_id: verifierParams.verifier_id, | ||
| network, | ||
| client_id: clientId, | ||
| source: source || "torus-utils-web", | ||
| }, | ||
| {} | ||
| ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Authorization POST request missing
|
||
|
|
||
| // generate temporary private and public key that is used to secure receive shares | ||
| const sessionAuthKey = generatePrivate(); | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated
@types/bs58added as unnecessary devDependencyLow Severity
The
@types/bs58package (v5.0.0) is deprecated and unnecessary —bs58v6 ships its own type definitions. The lockfile even explicitly says: "This is a stub types definition. bs58 provides its own type definitions, so you do not need this installed." This adds a redundant dependency that could confuse future contributors.