import { NextFunction, Request, Response } from 'express'; import { UserRoles } from '../../../common/entities/UserDTO'; export declare class AuthenticationMWs { static tryAuthenticate(req: Request, res: Response, next: NextFunction): Promise; static authenticate(req: Request, res: Response, next: NextFunction): Promise; static normalizePathParam(paramName: string): (req: Request, res: Response, next: NextFunction) => void; static authoriseMetaFiles(paramName: string): (req: Request, res: Response, next: NextFunction) => Promise; /** * Authorises the directory against the directory allow and block lists of the session (see DirectoryAccess). * Not available directories get the same error as not existing ones, so it can't be used to find out if a directory exists. * It sets req.directoryAccess for the next middlewares. */ static authoriseDirectory(paramName: string): (req: Request, res: Response, next: NextFunction) => Promise; /** * The response for not existing and not available directories. They need to be the same: * GalleryMWs.listDirectory answers not existing directories with the same status and error. */ private static directoryNotFound; static authoriseMedia(paramName: string): (req: Request, res: Response, next: NextFunction) => Promise; static authorise(role: UserRoles): (req: Request, res: Response, next: NextFunction) => void; static shareLogin(req: Request, res: Response, next: NextFunction): Promise; static inverseAuthenticate(req: Request, res: Response, next: NextFunction): void; static login(req: Request, res: Response, next: NextFunction): Promise; static oidcLogin(req: Request, res: Response, next: NextFunction): Promise; /** * Starts the session again from the current DB row of its user, * so changing the own user (e.g.: the password) does not end the session. Use it after user changes. */ static refreshSession(req: Request, res: Response, next: NextFunction): Promise; static logout(req: Request, res: Response, next: NextFunction): void; /** * Logs in the user (or sharing guest) for this session. * Only "remember me" sessions survive closing the browser. */ private static startSession; /** * The session is stored in the cookie. It ends if it timed out or its user or sharing got deleted or changed * (see SessionManager.getSessionStamp). * Returns false if there is no session (anymore). */ private static restoreSession; /** * Sessions expire after Server.sessionTimeout of inactivity. */ private static extendSession; /** * Returns true if the prebuilt queries of the context got lost (e.g.: during session serialization) */ private static isContextBroken; private static getSharingKey; private static getSharingUser; }