This project is a mock server for identity document authentication and verification workflows. It simulates endpoints for document verification, MRZ checks, and related flows, and is designed for integration testing and development without requiring real third-party services.
- Express.js API with endpoints for document verification, MRZ, and health checks
- Redis integration for storing and retrieving transaction tokens
- Mocked webhook callbacks for simulating document upload events
- Header and payload validation for all endpoints
- Configurable via environment variables
- POST: Document verification (requires
authorizationandcontent-type: application/jsonheaders)
- POST: Initiate a document verification request
- POST: MRZ check (requires
client-id,x-correlation-id,client-secret, andcontent-type: application/jsonheaders)
- GET: Health check endpoint
-
Install dependencies
yarn install # or npm install -
Configure environment variables
Create a.envfile in the project root:PORT=3002 API_KEY=your-api-key DEFAULT_IDP_DOCV_CALLBACK_URL=https://example.com/callback IDP_WEBHOOK_PATH=/webhook WEBHOOK_SECRET=your-webhook-secret REDIS_URL=redis://localhost:6379 -
Start the server
yarn start # or npm start
-
Run all tests
yarn test # or npm test
-
Lint the code
yarn lint # or npm run lint
- Endpoints and logic are organized under the
routes/andservices/directories. - Mock data for document verification is in
data/docv/results.js. - Tests are in the
test/directory and use Mocha, Chai, and Sinon.
This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.
Note: This project is for development and testing purposes only. Do not use in production environments.