1 | import { Callback, HttpError, RemoteUser } from '../commons';
|
2 | import { Config } from '../configuration';
|
3 | export interface AuthPluginPackage {
|
4 | packageName: string;
|
5 | packageVersion?: string;
|
6 | tag?: string;
|
7 | }
|
8 | export declare type AuthError = HttpError & {
|
9 | code: number;
|
10 | };
|
11 | export declare type AuthAccessCallback = (error: AuthError | null, access: boolean) => void;
|
12 | export declare type AuthCallback = (error: AuthError | null, groups: string[] | false) => void;
|
13 | export interface IBasicAuth<T> {
|
14 | config: T & Config;
|
15 | aesEncrypt(username: string, password: string): string;
|
16 | authenticate(user: string, password: string, cb: Callback): void;
|
17 | changePassword(user: string, password: string, newPassword: string, cb: Callback): void;
|
18 | allow_access(pkg: AuthPluginPackage, user: RemoteUser, callback: Callback): void;
|
19 | add_user(user: string, password: string, cb: Callback): any;
|
20 | }
|