/** * Simple username/password authentication. */ export interface Authenticator { /** * Authenticate username/password. * @param username Username. * @param password Password. * @return true if user exists with that password, false otherwise. */ authenticate(username: string, password: string): boolean | Promise; } /** * Basic username/password-based authentication manager. */ export declare class PlainAuthenticator implements Authenticator { static validateUsername(username: string): void; private _users; /** * Add/replace user, using given password. * Note that a username cannot start with an `@`, because that is reserved * for group names. * @param username Username of user to add or replace * @param password Password to use for this user */ setUser(username: string, password: string): void; /** * Remove user, if it exists. */ deleteUser(username: string): void; authenticate(username: string, password: string): boolean; }