import { Request, Response, Plugin } from '@blinkk/root'; export declare enum PasswordProtectError { UNKNOWN = "UNKNOWN", PASSWORD_REQUIRED = "PASSWORD_REQUIRED", PASSWORD_INVALID = "PASSWORD_INVALID" } export interface PasswordProtectedRoute { /** * URL glob pattern to match (regex not supported yet). */ source: string; password: { /** * A hash of the password. Note: a plain-text password should never be * stored in code. Consider storing this value in a `.env` file for extra * security. * * Generate this by running: * ``` * root-password-protect generate-hash "MY_PASSWORD" * ```` */ hash: string; /** * A random string used to generate the password hash. * * Generate this by running: * ``` * root-password-protect generate-hash "MY_PASSWORD" * ```` */ salt: string; }; } export interface PasswordProtectPluginOptions { protectedRoutes: PasswordProtectedRoute[]; } export declare function passwordProtectPlugin(options: PasswordProtectPluginOptions): Plugin; /** * Renders the login page to a response. */ export declare function renderPasswordPage(req: Request, res: Response, options?: { error?: PasswordProtectError; }): Promise;