feat: add bulk user management - #529
Open
leojustry-f wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds administrator-facing bulk user management to the Users page.
crypto.getRandomValues().email,password; the administrator selects one default role in the import dialog, and that role is applied consistently to every imported row.email, an intentionally blankpassword, andpassword_status=not_stored_one_way_hash.Access control
The three bulk operations use independent permission keys:
user:batch-createuser:batch-importuser:exportThe permissions are seeded idempotently but are initially assigned to no standard role. Consequently, only super administrators can see and use these operations by default. Administrators can grant each capability separately through the existing permission-control UI. Both the Vue controls and Worker endpoints enforce the respective permission.
Password handling
Cloud Mail stores passwords as salted, one-way hashes rather than recoverable plaintext. Plaintext credentials are therefore available only for successful rows during the batch creation/import operation that generated them. They are never persisted for later retrieval. Existing-user exports explicitly leave
passwordblank and include a machine-readable status instead of suggesting that a usable password can be recovered from the hash.Implementation notes
typecolumn in source files so that the role selected in the dialog remains authoritative.wrangler-test.toml; the unsupported AI binding is omitted only from the local test configuration.Validation
The following checks completed successfully:
In addition, the adjusted Worker candidate was deployed and manually verified in production before this PR was opened. The existing Vite warning for chunks larger than 500 kB is non-blocking and was not introduced by this PR.