Skip to content

fix: health endpoint and oracle service improvements (#564, #565, #566, #567) - #633

Merged
nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
sanmipaul:feature-health-oracle-improvements
Sep 25, 2026
Merged

nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
sanmipaul:feature-health-oracle-improvements

Conversation

@sanmipaul

Copy link
Copy Markdown
Contributor

Summary

This PR addresses four related health endpoint and oracle service issues:

Changes

Issue #564 - Security: Sanitize Error Messages

Prevents information disclosure via the health endpoint by mapping internal error details to generic messages while logging full details server-side.

Changes:

  • sanitizeErrorMessage() helper masks passwords, connection strings, and credentials
  • Error responses show safe messages like "Service dependency unavailable"
  • Full error context still available in server logs for debugging

Issue #565 - A11y: Status Field Format Support

Adds support for Spring Boot Actuator health format via Accept header for better monitoring tool compatibility.

Changes:

  • getStatusFormat() detects application/vnd.spring-boot.actuator Accept header
  • transformStatusFormat() converts status values: 'ok'/'degraded' → 'UP'/'DOWN'
  • Maintains backward compatibility with standard format

Issue #566 - Bug: API Rate Limit Handling

Implements exponential backoff for Open-Meteo and AviationStack rate limiting (429 responses).

Changes:

  • New executeWithRateLimitBackoff() method with exponential backoff retry logic
  • Respects Retry-After headers from external APIs
  • Up to 3 retry attempts (configurable)
  • Applied to all weather and flight oracle API calls
  • Improves reliability during high-volume oracle updates

Issue #567 - UX: Server Uptime Tracking

Adds uptime field to health response for deployment correlation.

Changes:

  • New uptimeMs field in HealthResponseDto
  • Populated from process.uptime() × 1000 on each health check
  • Allows ops teams to correlate service health with restarts

Files Modified

  • src/health/dto/health-response.dto.ts
  • src/health/health.controller.ts
  • src/oracle/oracle.service.ts

Resolves

…ng, and status format support

Addresses issues Parashield-Protocol#564, Parashield-Protocol#565, Parashield-Protocol#566, and Parashield-Protocol#567:

- Parashield-Protocol#564: Sanitize internal error messages in health endpoint responses to prevent
  information disclosure. Map sensitive errors (connection, password, credentials)
  and overly verbose messages to generic client-facing messages while logging
  full details server-side for debugging.

- Parashield-Protocol#565: Add support for Spring Boot Actuator status format via Accept header.
  Clients sending 'application/vnd.spring-boot.actuator' will receive status
  values as 'UP'/'DOWN' instead of 'ok'/'degraded', enabling integration with
  standard monitoring tools.

- Parashield-Protocol#566: Implement exponential backoff for Open-Meteo and AviationStack API
  rate limiting (HTTP 429 responses). New executeWithRateLimitBackoff method
  respects Retry-After headers and backs off with exponential delays (up to
  3 retry attempts), improving reliability during high-volume oracle updates.

- Parashield-Protocol#567: Add server uptime tracking to health response via uptimeMs field
  populated from process.uptime(), allowing operations teams to correlate
  service health with deployments and restarts.
@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@sanmipaul Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nonsobethel0-dev
nonsobethel0-dev merged commit 00ca401 into Parashield-Protocol:main Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants