Skip to content

Repository files navigation

Contract Lens

Contract Lens is a zero-dependency OpenAPI 3.x contract and security auditor. It turns a JSON specification into a prioritized Markdown or JSON report that is suitable for CI, vendor review, and pre-release API gates.

What it catches

  • unspecified authentication and missing security schemes
  • cleartext server URLs
  • missing success and authentication-error responses
  • undeclared or optional path parameters
  • request bodies without schemas
  • missing stable operation IDs

Run it

npm test
node src/cli.mjs examples/insecure-api.json > audit.md
node src/cli.mjs examples/insecure-api.json --format=json

The CLI exits with code 2 when it finds a critical or high-severity issue, making it useful as a CI quality gate. It has no runtime dependencies and does not upload API contracts anywhere.

Example result

The included insecure contract scores below a passing grade and produces a remediation for every finding. See examples/sample-audit.md.

Professional audit

The scanner is the reproducible first pass behind MercurioCodex's fixed-scope API contract audit. A professional engagement adds manual threat modeling, ambiguity analysis, breaking-change review, request/response examples, and an implementation-ready remediation plan.

License

MIT

About

Zero-dependency OpenAPI contract and security auditor with Markdown and JSON reports

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages