Skip to content

feat(audit): implement machine-readable JSON reporter for CI (closes #78) - #164

Open
MehulSehgal wants to merge 20 commits into
sidd190:mainfrom
MehulSehgal:feat/audit-json-reporter
Open

MehulSehgal wants to merge 20 commits into
sidd190:mainfrom
MehulSehgal:feat/audit-json-reporter

Conversation

@MehulSehgal

Copy link
Copy Markdown

Summary

Closes #78

Implements the machine-readable JSON reporter for auth.audit(). It emits audit findings as structured JSON suitable for CI workflows, automated gating, and external security analyzers.

Key Changes

  1. formatJsonReport (backend/audit/reporters/json.js):

    • Emits structured JSON output with tool version, status (passed / failed), error/warning summary counters, and complete finding details.
    • Supports both pretty-printed JSON (default) and compact single-line JSON (pretty: false).
  2. Integration into audit() Runner:

    • Added support for audit(app, { format: 'json' }).
    • Comprehensive unit test coverage (__tests__/auditJsonReporter.test.js).
    • Documentation update in README.md.

Verification

  • npm test: 9 test suites passed, 60 tests passed.
  • npm run lint: Clean (0 errors, 0 warnings).

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b7e7606-2063-4f34-8327-5dcf31a406aa
Commits

Reviewing files that changed from the base of the PR and between 805e9f4 and 5818025.

Files selected for processing: 15

  • CONTRIBUTING.md
  • README.md
  • SECURITY.md
  • __tests__/auditCorsOrigin.test.js
  • __tests__/auditHumanReporter.test.js
  • __tests__/auditJsonReporter.test.js
  • __tests__/auditJwtSecrets.test.js
  • backend/audit/checks/corsOrigin.js
  • backend/audit/checks/jwtSecrets.js
  • backend/audit/index.js
  • backend/audit/reporters/human.js
  • backend/audit/reporters/json.js
  • backend/index.js
  • index.js
  • package.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

auth.audit() JSON reporter

1 participant