Personal open-source project. A small multi-tenant Billing API with Auth0-style auth (RS256 JWTs, JWKS, permissions claim) is attacked and specified by 136 Jest tests and a Postman/Newman collection, with a strict OpenAPI contract in between.
The focus is on what usually goes wrong in real APIs: broken object-level authorization, roles quietly widened, mass assignment, tokens accepted when they shouldn't be, and support tooling (impersonation) that turns into a backdoor.
What is tested
Authentication: 12 forged or misconfigured tokens, all refused: expired, wrong issuer/audience, unknown key, alg none, RS256 to HS256 algorithm confusion, payload edited after signing
Authorization matrix: 5 personas x 7 endpoints = 35 cases from a hand-written specification table, so a widened role fails the build
BOLA / tenant isolation (OWASP API1): cross-tenant access answers exactly like a missing id; property-based with fast-check
Mass assignment and excessive data exposure (OWASP API3)
Support impersonation: read-only, no permission escalation, audited
Business rules: money in integer cents, property-based totals against a BigInt oracle, state machine, idempotent creation
Contract: every documented operation and status code validated against a closed OpenAPI 3 schema
Postman / Newman: 18 requests over real HTTP with collection-level rules on every response
Coverage: about 97% statements and 94% branches.
0 likes · 0 views · Nov 10, 2026
Open-source lab: 136 Jest tests and a Postman/Newman collection attacking a multi-tenant billing API: forged JWTs, permission matrix, BOLA, mass assignment.