-
-
Notifications
You must be signed in to change notification settings - Fork 132
Wallet v2 #2169
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
base: master
Are you sure you want to change the base?
Conversation
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
16991000 | Triggered | Generic High Entropy Secret | c2c2f3a | docker/db/wallet-seed.sql | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
8ab0a08
to
afcc412
Compare
d9af095
to
e94cfe7
Compare
412f2c6
to
690b10b
Compare
The old schema can contain '' instead of NULL in the columns of wallets for receiving.
The loading state would go from false -> true -> false because it's false when the lazy query wasn't called yet.
Feel free to merge updates, but rebasing or forced pushes will make me grumpy. :D |
This reverts commit 926c706.
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.
Bug: Hook Array Access Without Validation
The useSendRecvParam
and useWalletProtocolParam
hooks perform unsafe array access on params.slug
(at indices [1]
and [2]
respectively) without checking if params.slug
exists or has sufficient length. This can lead to a TypeError
if the URL structure is unexpected or params.slug
is undefined.
wallets/client/components/forms.js#L292-L302
stacker.news/wallets/client/components/forms.js
Lines 292 to 302 in b69bada
const params = useParams() | |
// returns only :send in /wallets/:name/:send | |
return ['send', 'receive'].includes(params.slug[1]) ? params.slug[1] : null | |
} | |
function useWalletProtocolParam () { | |
const params = useParams() | |
const name = params.slug[2] | |
// returns only :protocol in /wallets/:name/:send/:protocol | |
return name ? unurlify(name) : null | |
} |
Bug: Unhandled Null in Wallet Protocol Mutations
The getWalletProtocolMutation
function can return null
for unsupported protocol combinations (e.g., LN_ADDR send, CLN_REST send). This null
value is passed directly to useMutation()
within useWalletProtocolUpsert
and to client.mutate()
within useWalletMigrationMutation
without validation, which will cause errors or unexpected behavior.
wallets/client/hooks/query.js#L120-L123
stacker.news/wallets/client/hooks/query.js
Lines 120 to 123 in b69bada
export function useWalletProtocolUpsert (wallet, protocol) { | |
const mutation = getWalletProtocolMutation(protocol) | |
const [mutate] = useMutation(mutation) |
wallets/client/hooks/query.js#L433-L437
stacker.news/wallets/client/hooks/query.js
Lines 433 to 437 in b69bada
}) | |
}, [client, encryptConfig]) | |
return useMemo(() => ({ migrate, ready: ready && !loading }), [migrate, ready, loading]) | |
} |
Was this report helpful? Give feedback by reacting with 👍 or 👎
So far this looks/works great - strict upgrade over v1. I've only done a very cursory QA/code review so far. I'll continue with my surface level exploration today, then go deep tomorrow on the important stuff:
Questions so far
|
Description
close #1495 fix #2234
DX for supporting a new wallet: 926c706
TODOs / Overview of Changes
Vault
table no longer contains foreign keys to wallets or usersWalletTemplate
Wallet
WalletProtocol
WalletSendNWC
,WalletRecvNWC
, ...)WalletTemplate
tableadd placeholder wallets like Phoenix?master
)(Use test payments with HODL invoices for wallet validation #1287)include wizard / multi-step formsprobably not in this PRCryptoKey
show status of wallet network tests on attach in dedicated UI instead of relying on wallet logsdon't show "logs", show wallet events like a walletthis means that there won't be multiple log messages for the same payment. we will just show the current status of a payment, just like a wallet would do.WALLETS
vsWALLET
query)WALLET
on save or detachWALLETS
if wallets changedCUSTOM
wallet intoNWC
andLN_ADDR
walletcan key hash and wallet encryption get out of sync?Test instructions
test_wallet_v2
(id 21001)sndev login test_wallet_v2
Screenshots
we now show wallets instead of protocols:
each wallet can now support multiple protocols for send or receive:
Checklist
Are your changes backwards compatible? Please answer below:
no
On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:
8
For frontend changes: Tested on mobile, light and dark mode? Please answer below:
yes
Did you introduce any new environment variables? If so, call them out explicitly here:
no