Skip to content

feat: add IrmaClient::health() wrapper for the /health endpoint#15

Merged
rubenhensen merged 1 commit into
mainfrom
feat/irmaclient-health
Jun 17, 2026
Merged

feat: add IrmaClient::health() wrapper for the /health endpoint#15
rubenhensen merged 1 commit into
mainfrom
feat/irmaclient-health

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented Jun 16, 2026

Copy link
Copy Markdown

Adds IrmaClient::health() to the typed client surface so downstream consumers can run a liveness/readiness check against the IRMA server without reaching for reqwest directly.

Changes

  • src/irmaclient.rs: new pub async fn health(&self) -> Result<(), Error> that issues GET {base}/health (the endpoint added in irmago v0.15.0) and returns Ok(()) on a 2xx response, mapping any failure to Error::NetworkError via the existing error_for_status()? pattern. Mirrors the style of cancel().
  • tests/test_health.rs: integration test (gated behind RUN_INTEGRATION_TESTS, like the other tests) that starts an IRMA server and asserts a running server reports healthy.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test ✅ (integration tests compile and no-op locally without RUN_INTEGRATION_TESTS; CI runs them against a real IRMA server)

Closes #10

Adds IrmaClient::health() which issues GET {base}/health (the endpoint
added in irmago v0.15.0) and returns Ok(()) on a 2xx response, mapping
any failure to Error::NetworkError. Useful as a liveness/readiness check
before starting a session, mirroring the existing client method style.

Includes an integration test gated behind RUN_INTEGRATION_TESTS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rubenhensen rubenhensen marked this pull request as ready for review June 17, 2026 13:20
@rubenhensen rubenhensen merged commit 3a6aa4d into main Jun 17, 2026
4 checks passed
@rubenhensen rubenhensen deleted the feat/irmaclient-health branch June 17, 2026 13:20
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.

Add IrmaClient::health() wrapper for the /health endpoint

1 participant