Title: CLI: add 'jss account delete' (and refactor 'passwd' to use the same wrapper) · Issue #292 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: CLI: add 'jss account delete' (and refactor 'passwd' to use the same wrapper) · Issue #292 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: CLI: add 'jss account delete' (and refactor 'passwd' to use the same wrapper) · Issue #292 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Two related gaps 1. No CLI for account deletion `src/idp/accounts.js` already exports `deleteAccount(id)` — it removes the account JSON, prunes the username/email/webId indexes, the works. But there's no CLI surface for it. Operators cur...
Open Graph Description: Two related gaps 1. No CLI for account deletion `src/idp/accounts.js` already exports `deleteAccount(id)` — it removes the account JSON, prunes the username/email/webId indexes, the works. But ther...
X Description: Two related gaps 1. No CLI for account deletion `src/idp/accounts.js` already exports `deleteAccount(id)` — it removes the account JSON, prunes the username/email/webId indexes, the works. But ther...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/292
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CLI: add 'jss account delete' (and refactor 'passwd' to use the same wrapper)","articleBody":"## Two related gaps\n\n### 1. No CLI for account deletion\n\n\\`src/idp/accounts.js\\` already exports \\`deleteAccount(id)\\` — it removes the account JSON, prunes the username/email/webId indexes, the works. But there's **no CLI surface** for it. Operators currently delete accounts by hand-editing index JSON files and removing the account file, which is fragile.\n\n### 2. \\`passwd\\` bypasses the wrapper it should use\n\nThe existing \\`jss passwd \u003cusername>\\` command (\\`bin/jss.js:628\\`) reads the username index and account file with raw \\`fs.readJson\\` / \\`fs.writeJson\\` instead of going through \\`accounts.js\\`. Notably, \\`accounts.js\\` already exports \\`updatePassword(id, newPassword)\\` — \\`passwd\\` re-implements that logic inline (including the bcrypt round) rather than calling it. The other \\`bin/jss.js\\` commands (\\`invite\\`, \\`quota\\`) all consume their respective \\`src/\\` modules via imports — \\`passwd\\` is the odd one out.\n\n## Proposal\n\nAdd an \\`account\\` command group with \\`delete\\` (and room for future siblings like \\`list\\`, \\`info\\`, \\`disable\\`), and refactor \\`passwd\\` to use the wrapper too.\n\n### \\`jss account delete \u003cusername>\\`\n\nSketch:\n\n\\`\\`\\`js\nimport { findByUsername, deleteAccount } from '../src/idp/accounts.js';\n\nprogram\n .command('account')\n .description('Manage user accounts');\n\nprogram\n .command('account delete \u003cusername>')\n .description('Delete a user account from the IdP')\n .option('-r, --root \u003cpath>', 'Data directory')\n .option('-y, --yes', 'Skip the confirmation prompt')\n .option('--purge', 'Also delete pod data at \u003cdataRoot>/\u003cusername>/')\n .action(async (username, opts) => {\n if (opts.root) process.env.DATA_ROOT = path.resolve(opts.root);\n const account = await findByUsername(username);\n if (!account) { console.error(\\`User not found: \\${username}\\`); process.exit(1); }\n if (!opts.yes) {\n const ok = await confirm(\\`Delete account '\\${username}' (\\${account.webId})?\\`);\n if (!ok) process.exit(1);\n }\n await deleteAccount(account.id);\n if (opts.purge) {\n await fs.remove(path.join(process.env.DATA_ROOT || './data', username));\n }\n console.log(\\`Deleted \\${username}.\\${opts.purge ? ' Pod data removed.' : ''}\\`);\n });\n\\`\\`\\`\n\n### \\`--purge\\` is opt-in for a reason\n\nAccount record removal revokes identity. Pod data removal is destructive and irreversible. Keeping them separate behind an explicit flag means the safe default (\\`account delete melvin\\`) frees the username for re-registration without touching files at \\`\u003cdataRoot>/melvin/\\`. \\`--purge\\` is for the \\\"start over completely\\\" case.\n\n### Refactor \\`passwd\\`\n\nDrop the inline \\`bcrypt.hash\\` and \\`fs.readJson\\`/\\`writeJson\\` in favour of:\n\n\\`\\`\\`js\nconst account = await findByUsername(username);\nif (!account) { /* error */ }\nawait updatePassword(account.id, newPassword);\n\\`\\`\\`\n\nSame external behaviour, ~30 fewer lines, and a single source of truth for hashing parameters / index updates.\n\n## Why both in one issue\n\nThey're the same shape of fix — the CLI layer should consume \\`accounts.js\\` consistently. Doing both together makes the pattern obvious and removes the temptation to copy the inline-fs pattern into the new \\`delete\\` command.\n\n## Non-goals\n\n- Account listing / info / disable (good follow-ups; out of scope here).\n- HTTP \\`DELETE /idp/account\\` endpoint (requires an auth story for self-service deletion vs admin deletion; deserves its own issue).\n- Federation / cleaning up sessions or refresh tokens issued to the deleted account (separate concern; tokens expire naturally, but a thorough deletion would revoke them).\n\nHappy to PR.","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-04-22T04:03:29Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/292"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:18a5aa04-7ef8-3b49-d794-718b76712d9c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C4A2:12B0B0:A48EEF:DAD8E0:6B03A671 |
| html-safe-nonce | c5af833bd5fd3444518df40f8395449317f234d5aa49afd1cf22a8b48c2bcec5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEEyOjEyQjBCMDpBNDhFRUY6REFEOEUwOjZCMDNBNjcxIiwidmlzaXRvcl9pZCI6IjUyNjQxNDA2ODI2MTYwODgxNzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 025fc3964a97a414dec325a16e52a36d10342ae149e69d47c6f09c3af7c3956f |
| hovercard-subject-tag | issue:4306625286 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/292/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fc45578c70dacff6a633053fe09b62ce86cc433e3216363da2bb594162bf5c51/JavaScriptSolidServer/JavaScriptSolidServer/issues/292 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fc45578c70dacff6a633053fe09b62ce86cc433e3216363da2bb594162bf5c51/JavaScriptSolidServer/JavaScriptSolidServer/issues/292 |
| og:image:alt | Two related gaps 1. No CLI for account deletion `src/idp/accounts.js` already exports `deleteAccount(id)` — it removes the account JSON, prunes the username/email/webId indexes, the works. But ther... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width