Skip to content

feat(health): BA-113 validate health endpoint query parameters and reject unsupported probe options - #1046

Open
ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/health-probe-validation-1026
Open

ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/health-probe-validation-1026

Conversation

@ranjeetprabhatedu-dotcom

Copy link
Copy Markdown

Summary

This PR implements BA-113 to validate query parameters on the health check endpoint, rejecting unsupported probe options while cleanly handling accepted defaults and diagnostic options.

  • Validates incoming probe query options against SUPPORTED_PROBES (liveness, readiness, startup, full), throwing BadRequestException on unrecognized values.
  • Retains default behavior falling back to full probe when parameter is omitted.
  • Adds verbose query parameter support returning system uptime and Node version for telemetry inspection.
  • Fixes exception import in coverage.ts to use HttpException with HttpStatus.TOO_MANY_REQUESTS.
  • Adds unit tests in app.controller.spec.ts covering default probe behavior, supported probe acceptance, unsupported probe rejection with detailed error messaging, and verbose flag output.
  • Scoped strictly to the 3 allowlisted files:
    • BackendAcademy/src/health/health.controller.ts
    • BackendAcademy/src/health/coverage.ts
    • BackendAcademy/src/app.controller.spec.ts

Closes #1026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BA-113 — Validate health endpoint query parameters

1 participant