@verdaccio/types
Version:
verdaccio types definitions
21 lines (20 loc) • 905 B
TypeScript
import { Callback, HttpError, RemoteUser } from '../commons';
import { Config } from '../configuration';
export interface AuthPluginPackage {
packageName: string;
packageVersion?: string;
tag?: string;
}
export declare type AuthError = HttpError & {
code: number;
};
export declare type AuthAccessCallback = (error: AuthError | null, access: boolean) => void;
export declare type AuthCallback = (error: AuthError | null, groups: string[] | false) => void;
export interface IBasicAuth<T> {
config: T & Config;
aesEncrypt(username: string, password: string): string;
authenticate(user: string, password: string, cb: Callback): void;
changePassword(user: string, password: string, newPassword: string, cb: Callback): void;
allow_access(pkg: AuthPluginPackage, user: RemoteUser, callback: Callback): void;
add_user(user: string, password: string, cb: Callback): any;
}