Skip to content

[transports-http/diagnostics] Validate diagnostics response-size limits before endpoint registration #1699

Description

@kang-heewon

Priority: P1

Problem

Diagnostics endpoint limits are copied without validation. Negative, non-finite, or fractional values reach slice and message truncation, making bounded output unreliable.

Evidence

  • packages/transports-http/src/libs/operationalEndpoints.ts:49-63 accepts recentErrorLimit and messageLimit.
  • Lines 121-140 copy the values into policy without validation.
  • Lines 184 and 233-243 consume them in slice and message capping.

Desired outcome

Operational diagnostics have explicit, safe output bounds.

Implementation path

  1. Validate a finite nonnegative error count and finite positive message limit.
  2. Return a stable configuration Problem before exposing the endpoint.
  3. Test negative, NaN, Infinity, fractional, and normal options.

Acceptance criteria

  • Invalid limits are rejected before requests are served.
  • Valid limits cap error entries and messages predictably.
  • Error messaging identifies the invalid option.

Validation

pnpm --filter @croco/transports-http test

Scope boundaries

Does not change timeout configuration covered by existing health work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions