import { Request, Response } from 'express'; import { DyFM_Error, DyFM_Errors, DyFM_ServerStatus } from '@futdevpro/fsm-dynamo'; import { DyNTS_Errors_ControlService } from '../errors/errors.control-service'; import { DyNTS_Controller } from '../../../_services/route/controller.service'; import { DyNTS_Endpoint_Params } from '../../../_models/control-models/endpoint-params.control-model'; import { DyNTS_ServerStatus_ControlService } from './server-status.control-service'; import { DyNTS_ServerStatusSnapshot_ControlService } from './server-status-snapshot.control-service'; /** * Auth retrofit config a `DyNTS_ServerStatus_Controller`-hez. Opt-in — ha az * `authPreProcess` nincs megadva, a controller a regi (auth nelkuli) viselkedest * tartja. Ugyanaz a mintazat, mint a `DyNTS_Errors_Controller`-ben, DE biztonsagosabb * default-tal: a liveness/readiness/client-version **probak SOHA nem gate-eltek** * (orchestrator/LB auth nelkul hivja oket), es a default `protectedEndpoints` csak az * admin-adat vegpontokat fedi (NEM a probakat). * * **Subclass-szintu konfiguracio:** az `authConfig` static, igy az abstract osztaly * minden subclass-a kozott OSZTOTT (TypeScript a static field-eket per-class hatarozza meg). */ export interface DyNTS_ServerStatusController_AuthConfig { /** * Pre-process fuggveny ami minden vedett endpoint elott fut. Ha hianyzik vagy * `undefined`, a controller NEM ad hozza auth-ot semelyik endpoint-hoz (regi * viselkedes, opt-in safety). */ authPreProcess?: (req: Request, res: Response) => Promise; /** * Vedett endpoint nevek listaja. Ha hianyzik, a default = csak az admin-adat * vegpontok (`getServerStatus`, `getErrorStatistics`) — a probak NEM. A * `PUBLIC_PROBE_ENDPOINTS` (`getServerHealth`/`getServerReadiness`/ * `getServerStatusForClient`) MEG explicit listazva sem gate-elheto. */ protectedEndpoints?: string[]; } /** * Endpoints: * * getServerStatus * GET /status * * getServerStatusForClient * GET /status/:version * * getErrorStatistics * GET /statistics/error/:range * */ export declare abstract class DyNTS_ServerStatus_Controller, T_Errors_ControlService extends DyNTS_Errors_ControlService, T_ServerStatusSnapshot extends DyFM_ServerStatus, T_ServerStatusSnapshot_ControlService extends DyNTS_ServerStatusSnapshot_ControlService, T_ServerStatus_ControlService extends DyNTS_ServerStatus_ControlService> extends DyNTS_Controller { protected abstract readonly server_CS: T_ServerStatus_ControlService; protected readonly additionalEndpoints: DyNTS_Endpoint_Params[]; /** * Static auth config — opt-in retrofit. Default ures objektum → NO auth * (a meglevo integraciok valtoznatlan viselkedessel folytatodnak). */ protected static authConfig: DyNTS_ServerStatusController_AuthConfig; /** * Static config setter. Hivhato a szerver startup-jan az endpoint registration ELOTT. * * Use case (host app): * ```ts * ServerStatus_Controller.configure({ * authPreProcess: async (req, res) => auth.authenticate_tokenAndPermission(req, res, FDP_Permission.X), * }); * ``` * A probak (`getServerHealth`/`getServerReadiness`/`getServerStatusForClient`) ettol * fuggetlenul NYITVA maradnak. */ static configure(config: DyNTS_ServerStatusController_AuthConfig): void; /** * Aktualis auth config olvasasa (test/diagnosztika celokra). */ static getAuthConfig(): DyNTS_ServerStatusController_AuthConfig; /** * Test-only: visszaallitja az auth config-ot ures objektumra. Production code NE hivja. */ static _resetAuthConfigForTesting(): void; /** * Vissza-adja az adott endpoint-hoz tartozo `preProcesses` array-t. * - Ha az auth NINCS configurolva → ures (regi viselkedes). * - A public probak SOHA nem gate-eltek. * - Egyebkent az endpoint a `protectedEndpoints` (default = admin-only) listan van-e. */ protected getPreProcessesFor(endpointName: string): ((req: Request, res: Response) => Promise)[]; /** * FR-263 (2026-06-26) — LAZY, REQUEST-IDŐBEN kiértékelt guard-wrapper (lásd a DyNTS_Errors_Controller * azonos fixét). A `setupEndpoints()` a host-app `configure()`-ja ELŐTT futhat (korai singleton- * konstrukció) → a guard ürès configgal kötődött → a `getServerStatus`/`getErrorStatistics` admin-adat * token nélkül 200-at adott (info-disclosure). A wrapper a configot KÉRÉS-IDŐBEN olvassa → sorrend- * független. A 401-et a valódi guard küldi; `headersSent`-re leállunk; nem-védett endpointnál no-op. */ protected lazyPreProcessesFor(endpointName: string): ((req: Request, res: Response) => Promise)[]; setupEndpoints(): void; } //# sourceMappingURL=server-status.controller.d.ts.map