server: system accounts cannot be registered

While refactoring the previous commit, it seemed like the previous
authors expected that a system account could be registered somehow
and that this would be an error condition. However, as now made
explicit with this, it is not possible to register a system account.

This means that any account by that name could only ever have been
created by the system itself so fetching them should be fine and not
an error condition.
This commit is contained in:
Johann150 2023-04-20 22:10:31 +02:00
parent 688deda218
commit 9b8438cdfc
Signed by untrusted user: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 2 additions and 0 deletions

View File

@ -26,6 +26,8 @@ type IsMeAndIsUserDetailed<ExpectsMe extends boolean | null, Detailed extends bo
const ajv = new Ajv();
// It is important that localUsernameSchema does not allow any usernames
// containing dots because those are used for system actors.
const localUsernameSchema = { type: 'string', pattern: /^\w{1,20}$/.toString().slice(1, -1) } as const;
const passwordSchema = { type: 'string', minLength: 1 } as const;
const nameSchema = { type: 'string', minLength: 1, maxLength: 50 } as const;