Reference
Arcane.users.validate()
Validates candidate usernames without changing an account.
This focused page is derived from the mechanically checked full member inventory.
Syntax
Arcane.users.validate(usernames)
Parameters
Username or array
Return value
Promise<{valid, users, errors, policy}>
Description
Validates candidate usernames without changing an account.
Overview
Arcane.users.validate(usernames) validates one username or an array without
creating or changing an account. The wrapper always sends an array. The method
requires users.manage, the Provisioner application type, and Core; it is a
read with no event.
Microsoft NT permits 1–20 letters, numbers, periods, underscores, or hyphens, beginning with a letter or number and not ending in a period. Linux permits 1–32 lower-case letters, numbers, underscores, or hyphens, beginning with a lower-case letter or underscore. Both reject reserved, privileged, and current protected accounts.
Result
The exact result is {valid, users, errors, policy}. valid is true only when
at least one input is valid and there are no errors. Each successful item is
exactly {input, username, valid: true, exists}. Each failed item includes
input, valid: false, and the normalized Arcane error fields, including code,
message, and recovery guidance. policy is the five-field platform username
policy returned by users.list().
Errors and recovery
Individual invalid values are normally returned in errors as
INVALID_USERNAME or CURRENT_USER_PROTECTED; the whole call need not reject.
Use the returned policy and per-item resolution. Validate again immediately
before a confirmed add because account existence can change after this read.
Example
const validation = await Arcane.users.validate(['arcane-user']);
if (!validation.valid) {
for (const error of validation.errors) {
console.warn(error.code, error.message, error.resolution);
}
}