UNPKG

@nephele/authenticator-pam

Version:

PAM based authenticator (local system users) for the Nephele WebDAV server.

20 lines (19 loc) 767 B
import type { Request } from 'express'; import type { Authenticator as AuthenticatorInterface, AuthResponse as NepheleAuthResponse } from 'nephele'; import User from './User.js'; export type AuthenticatorConfig = { realm?: string; unauthorizedAccess?: boolean; allowedUIDs?: string; }; export type AuthResponse = NepheleAuthResponse<any, { user: User; }>; export default class Authenticator implements AuthenticatorInterface { realm: string; unauthorizedAccess: boolean; allowedUIDs: string[]; constructor({ realm, unauthorizedAccess, allowedUIDs, }?: AuthenticatorConfig); authenticate(request: Request, response: AuthResponse): Promise<User>; cleanAuthentication(_request: Request, _response: AuthResponse): Promise<void>; }