Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rust-node-addon] add rust function and binding type for privilegedDe…
…leteUsers Summary: we'll call this RPC from a keyserver script, so we need rust bindings Depends on D13630 Test Plan: created two test users on staging. manually added a token for user ID 256 to staging. then called privileged_delete_users from keyserver.js to delete the two test users. confirmed their data was removed from ddb ``` diff --git a/keyserver/src/keyserver.js b/keyserver/src/keyserver.js index 88dcd0b4a2..950680086d 100644 --- a/keyserver/src/keyserver.js +++ b/keyserver/src/keyserver.js @@ -11,6 +11,7 @@ import type { $Request, $Response } from 'express'; import expressWs from 'express-ws'; import os from 'os'; import qrcode from 'qrcode'; +import { getRustAPI } from 'rust-node-addon'; import stoppable from 'stoppable'; import './cron/cron.js'; @@ -76,6 +77,13 @@ void (async () => { initFCCache(), ]); + const rustAPI = await getRustAPI(); + const response = await rustAPI.privilegedDeleteUsers('256', 'asdf', '1234', [ + 'C4E8C417-DD67-4084-8282-4A788DF38F57', + '78941137-03DB-4A23-A17F-890A94948493', + ]); + console.log(response); + ``` Reviewers: bartek, will Reviewed By: bartek Subscribers: ashoat, tomek Differential Revision: https://phab.comm.dev/D13631
- Loading branch information