HomePhabricator
Diffusion Comm 37da7bacc051

[rust-node-addon] add rust function and binding type for privilegedDeleteUsers

Description

[rust-node-addon] add rust function and binding type for privilegedDeleteUsers

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

Details

Provenance
varunAuthored on Oct 7 2024, 7:45 PM
Reviewer
bartek
Differential Revision
D13631: [rust-node-addon] add rust function and binding type for privilegedDeleteUsers
Parents
rCOMMbad0b9aafcb2: [identity] implement privileged delete users RPC
Branches
Unknown
Tags
Unknown