Skip to content

About

EndpointGuard is a Python-based tool that helps developers check whether their APIs work correctly and reliably. It tests how APIs respond, detects errors and unexpected behavior, and generates detailed reports to help developers identify and fix problems.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Endpoint Guard · API reliability and contract checks

Endpoint Guard

Check API availability, validate JSON responses, and compare their structure with an approved baseline.

CI Python 3.11–3.13 MIT license

The local demo report shows seven endpoints, five intentional failures, and the interactive endpoint explorer

Endpoint explorer detail · Structural drift detail

An HTTP 200 does not guarantee a healthy API contract

A response can arrive late, contain stale data, omit a required header, or change a field type while still returning HTTP 200. Configure checks for the APIs you are authorized to monitor and review the results offline.

  • Availability and latency track HTTP status, connection errors, timeouts, retries, and final-attempt latency.
  • Response contracts check JSON responses against a Draft 2020-12 schema, verify required headers, and check timestamp freshness.
  • Schema drift compares nested fields, arrays, types, optionality, and nullability with an approved baseline.
  • Reports include a terminal summary, versioned JSON, JUnit XML, and self-contained interactive HTML.

Review a contract change

The local demo captures a baseline with integer IDs, then checks a response with string IDs and an added label. The report presents the observed shapes and classifies the type change as potentially breaking.

Public path Previous shape Current shape Classification
$.items[].id integer · required string · required Potentially breaking
$.items[].label — string · required Nonbreaking

Run the demo

From a clone of this repository, use Python 3.11, 3.12, or 3.13.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install .
.\.venv\Scripts\endpointguard.exe demo -o reports
Invoke-Item .\reports\report.html

Linux and macOS

python3 -m venv .venv
.venv/bin/python -m pip install .
.venv/bin/endpointguard demo -o reports

The demo starts and stops its own localhost server and writes report.html, report.json, and report.xml to reports/. The default run reports two passes and five intentional failures, so expect exit code 1. Latency varies by machine.

When you have the URL of an authorized endpoint, run endpointguard init to create a starter configuration. Review the allowlist and validate it offline with endpointguard validate endpointguard.yaml. See the CLI reference for running checks and approving baselines.

How it works

flowchart LR
    A[CLI and YAML allowlist] --> B[Public DNS policy and pinned connection]
    B --> C[HTTP and JSON checks]
    C --> D[Structured evidence]
    E[Approved baseline] --> D
    D --> F[Terminal, JSON, JUnit and HTML]
    G[Saved JSON] --> H[Offline HTML re-render]
Loading

The engine runs GET and HEAD only, validates DNS answers before connecting, pins the selected public address while preserving the HTTP host and TLS name, and disables redirects and environment proxies. Response bodies and request values stay out of reports. Field labels are masked unless the configuration explicitly marks them for publication. The bundled demo has a separate, limited loopback exception. Security model

Project guide

CI checks Ruff, strict mypy, and offline pytest across Python 3.11–3.13 on Ubuntu and Windows. A manual GitHub Actions workflow uploads the local demo reports.

Drift describes observed samples, so empty arrays and unsampled variants leave gaps. The engine targets direct public connections, with bounded samples and identity-encoded bodies up to 1 MiB. The built-in demo is the supported localhost workflow. Operational limitations

MIT license

About

EndpointGuard is a Python-based tool that helps developers check whether their APIs work correctly and reliably. It tests how APIs respond, detects errors and unexpected behavior, and generates detailed reports to help developers identify and fix problems.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages