Delete NWC plaintext credentials that allow payments (#2367)

* Delete NWC plaintext credentials that allow payments

* Fix row in Wallet and WalletProtocol not deleted

* Fix wallet delete because CTE evaluated too late iiuc

* Mention badges

* Fix missing semicolon
This commit is contained in:
ekzyis 2025-09-15 22:09:12 +02:00 committed by GitHub
parent 5aa5956afc
commit 75de9d68e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,19 @@
-- delete protocols that have accidentally been saved in plaintext with permissions to spend
DELETE FROM "WalletProtocol"
WHERE id IN (
SELECT "protocolId" FROM "WalletRecvNWC"
WHERE id IN (
7,
67,
140,
157,
158,
166
)
);
-- delete wallets that now have no protocols
DELETE FROM "Wallet"
WHERE NOT EXISTS (SELECT 1 FROM "WalletProtocol" WHERE "walletId" = "Wallet"."id");
-- badges will not be updated but that's okay, not important enough for the effort