/** * Navidrome MCP Server - Web remote login, logout and session routes * Copyright (C) 2025 * SPDX-License-Identifier: AGPL-3.0-or-later */ import type { IncomingMessage, ServerResponse } from 'node:http'; import type { AuthService } from '../auth/auth-service.js'; import { type Principal } from '../auth/principal.js'; import type { GuestQueue } from '../jukebox/guest-queue.js'; /** * Public in every mode, so the page learns whether to show the login view before any gated call. An * admin session outside the access level reads as anonymous, with the refusal its owner can act on. * `isLocal` lets the page hide the system settings and Shut down, which only a local request holds. * `jukeboxOpen` tells an admin session's guest page whether the host can queue, or shows the closed card. * `noAdminPasswordMessage` reaches only a source that may log in. `passwordlessHere` tells the page to * post the login itself, and stays free of side effects, so a read mints no session. */ export declare function handleAuthSession(req: IncomingMessage, res: ServerResponse, auth: AuthService): void; /** * A source outside the admin access level gets 404, so the internet never sees an admin login at * the default level. A source that cannot log in while no password is saved gets 503 before its body * is read. The body is read before the throttle starts an attempt, so a client that trickles its body * cannot hold the one attempt slot. The passwordless rule is checked again after the read, since the * heartbeat or another request may load a newly saved password or ask meanwhile. A request it admits * that carries the launch key skips the password and the throttle, and spends from its own budget instead. * One without the key gets the password login, since a tunnel or proxy on the host also passes the rule. * The level is checked again after the hash runs, since a newly saved level may have narrowed meanwhile. */ export declare function handleLogin(req: IncomingMessage, res: ServerResponse, auth: AuthService): Promise; /** Mode none reaches this with the open principal, which holds no session, so only the cookie is expired. */ export declare function handleLogout(req: IncomingMessage, res: ServerResponse, auth: AuthService, principal: Principal): void; /** * Public in mode `jukebox`, so a guest page with the code from the QR code signs in. An admin the * access level admits already queues from the guest page as the host, so for the live code its * session stays and no guest session is minted for it. Neither the code nor the device id reaches a log. */ export declare function handleJoin(req: IncomingMessage, res: ServerResponse, auth: AuthService, guests: Pick): Promise; //# sourceMappingURL=auth.d.ts.map