{"_id":"@dhaneshpurohit/mockstar","_rev":"4-9e72bccfb5ab1af4f0aa4ebe98ae1265","name":"@dhaneshpurohit/mockstar","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.3":{"name":"@dhaneshpurohit/mockstar","version":"0.1.3","keywords":["mock","mock-server","api-mocking","bun","testing","wiremock-alternative","mockoon-alternative"],"license":"MIT","_id":"@dhaneshpurohit/mockstar@0.1.3","maintainers":[{"name":"dhaneshpurohit","email":"dhanesh.purohit@gmail.com"}],"bin":{"mockstar":"dist/cli.js"},"dist":{"shasum":"7777af709150daa69f74d727597de56485ae0966","tarball":"https://registry.npmjs.org/@dhaneshpurohit/mockstar/-/mockstar-0.1.3.tgz","fileCount":156,"integrity":"sha512-xjIk6We7JVH124N/h1jKldLi6L8eLiM/f7ztqc2XYelA7k1BrepSCaz0siloj3uERTFWZleBWygIN209deuKZg==","signatures":[{"sig":"MEUCIHEbF29YPZqLvjYU59GOXRGraMMrEfqdK7EcpHFIJMWiAiEA2CJMN+DzMnyWp5uQhHJmgLT6wrYQTt9qv84QucGo1iE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2015714},"type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.3.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"c8dda755ae3fbba1e90d51044471777de47ab72c","scripts":{"dev":"bun run src/cli.ts ./examples/mocks","lint":"bunx @biomejs/biome check src tests bench","test":"bun test tests","bench":"bun run bench/harness.ts","build":"bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm && bun run build:types","format":"bunx @biomejs/biome format --write src tests bench","typecheck":"tsc --noEmit","test:watch":"bun test --watch tests","bench:proxy":"bun run bench/proxy.bench.ts","build:types":"tsc -p tsconfig.build.json","build:binary":"bun run scripts/build-binaries.ts"},"_npmUser":{"name":"dhaneshpurohit","email":"dhanesh.purohit@gmail.com"},"_npmVersion":"11.18.0","description":"Bun-based mock server with static + dynamic mocking, JSON config, named JS handlers, pass-through, multi-tenancy, and test-data utilities.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"zod":"^3.23.0","hono":"^4.6.0","p-queue":"^8.0.1","jsonpath-plus":"^10.0.0","@faker-js/faker":"^9.0.0","zod-to-json-schema":"^3.23.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.6.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/mockstar_0.1.3_1783354963214_0.0383057736861947","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@dhaneshpurohit/mockstar","version":"0.2.2","keywords":["mock","mock-server","api-mocking","bun","testing","wiremock-alternative","mockoon-alternative"],"license":"MIT","_id":"@dhaneshpurohit/mockstar@0.2.2","maintainers":[{"name":"dhaneshpurohit","email":"dhanesh.purohit@gmail.com"}],"homepage":"https://github.com/dhanesh/mockstar#readme","bugs":{"url":"https://github.com/dhanesh/mockstar/issues"},"bin":{"mockstar":"dist/cli.js"},"dist":{"shasum":"71550390c456fde7087e02b4709010017d723337","tarball":"https://registry.npmjs.org/@dhaneshpurohit/mockstar/-/mockstar-0.2.2.tgz","fileCount":156,"integrity":"sha512-RdKxd7ZuZLVb0i/52cp3sMuQLF0ctsAkbTNpxy67cHeCB9orGUJwe1OuMzzlelH1catrRvNzL2ylNhI/LPSr7w==","signatures":[{"sig":"MEQCIFcIHC+rV5t8jvgaKy0Zrc6u5x4M7L0l5u7QNagGPV8yAiALAM3d0CrluVz6EKQmVgsc5611FyY88HbaiV7hhDF9tg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dhaneshpurohit%2fmockstar@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2020381},"type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.3.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"3aeebcdfaad64bf8a57815e0af132f11e0d1273c","scripts":{"dev":"bun run src/cli.ts ./examples/mocks","lint":"bunx @biomejs/biome check src tests bench","test":"bun test tests","bench":"bun run bench/harness.ts","build":"bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm && bun run build:types","format":"bunx @biomejs/biome format --write src tests bench","typecheck":"tsc --noEmit","test:watch":"bun test --watch tests","bench:proxy":"bun run bench/proxy.bench.ts","build:types":"tsc -p tsconfig.build.json","build:binary":"bun run scripts/build-binaries.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:14254263-2f7d-4705-afa4-f269c9b5439d"}},"repository":{"url":"git+https://github.com/dhanesh/mockstar.git","type":"git"},"_npmVersion":"11.18.0","description":"Bun-based mock server with static + dynamic mocking, JSON config, named JS handlers, pass-through, multi-tenancy, and test-data utilities.","directories":{},"_nodeVersion":"22.23.1","dependencies":{"zod":"^3.23.0","hono":"^4.6.0","p-queue":"^8.0.1","jsonpath-plus":"^10.0.0","@faker-js/faker":"^9.0.0","zod-to-json-schema":"^3.23.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.6.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/mockstar_0.2.2_1783373247905_0.6210929949908626","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dhaneshpurohit/mockstar","version":"0.3.0","keywords":["mock","mock-server","api-mocking","bun","testing","wiremock-alternative","mockoon-alternative"],"license":"MIT","_id":"@dhaneshpurohit/mockstar@0.3.0","maintainers":[{"name":"dhaneshpurohit","email":"dhanesh.purohit@gmail.com"}],"homepage":"https://github.com/dhanesh/mockstar#readme","bugs":{"url":"https://github.com/dhanesh/mockstar/issues"},"bin":{"mockstar":"dist/cli.js"},"dist":{"shasum":"8ac63e6127b15b18ccb3fd6884c766386112380e","tarball":"https://registry.npmjs.org/@dhaneshpurohit/mockstar/-/mockstar-0.3.0.tgz","fileCount":158,"integrity":"sha512-pRluWNxs5kZdBg6YV2FAH7UNZOucaZMVgjQCQABoBOOp2szeCygjAuL5tUCuSJyCObqRWOmhGFovlSi4vqNnlQ==","signatures":[{"sig":"MEYCIQDybHyjwZWL0iecy52aE+yAc4iPv+6eIBHg08b/vtjHqQIhAKBzKSMhXJG1a0rVnwrKnixJO8e1Q2WBKGS/ZStrxPcu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDBFHGZxKS7yjfhJsFTSXBUAuxyz/qNTw9Dwnuph41m5QIhALDBHmtqS9XCuSAsKR8AXDR3kq0P2iUXdX9+en+YknvC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dhaneshpurohit%2fmockstar@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2050914},"type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.3.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"58b1d2bd0fca9ced74e93a0dc6e3388528050792","scripts":{"dev":"bun run src/cli.ts ./examples/mocks","lint":"bunx @biomejs/biome check src tests bench","test":"bun test tests","bench":"bun run bench/harness.ts","build":"bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm && bun run build:types","format":"bunx @biomejs/biome format --write src tests bench","verify":"bun run lint && bun run typecheck && bun run build && bun run test","typecheck":"tsc --noEmit","test:watch":"bun test --watch tests","bench:proxy":"bun run bench/proxy.bench.ts","build:types":"tsc -p tsconfig.build.json","build:binary":"bun run scripts/build-binaries.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:14254263-2f7d-4705-afa4-f269c9b5439d"}},"repository":{"url":"git+https://github.com/dhanesh/mockstar.git","type":"git"},"_npmVersion":"12.0.2","description":"Bun-based mock server with static + dynamic mocking, JSON config, named JS handlers, pass-through, multi-tenancy, and test-data utilities.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"zod":"^3.23.0","hono":"^4.6.0","p-queue":"^8.0.1","jsonpath-plus":"^10.0.0","@faker-js/faker":"^9.0.0","zod-to-json-schema":"^3.23.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.6.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/mockstar_0.3.0_1788488582294_0.3987992358783057","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"_id":"@dhaneshpurohit/mockstar@0.4.0","bin":{"mockstar":"dist/cli.js"},"bugs":{"url":"https://github.com/dhanesh/mockstar/issues"},"dist":{"shasum":"af0adc4dce45f660b3c0b484ca13ee9711ec7e4c","tarball":"https://registry.npmjs.org/@dhaneshpurohit/mockstar/-/mockstar-0.4.0.tgz","fileCount":162,"integrity":"sha512-/j1rX6C6mfS0t+adqtJZAi4ia7HlTNweckNiIzEr1icAZOCFvs6+ZNl+/h0gpfjk1HKc00Ib7YmSu56sAsNPEQ==","signatures":[{"sig":"MEUCIEnuspR0JNa31DPQ71OVz03a5M9sVdzgkjjkX64S8pinAiEA8n9exqc/TMwAnsbB9figpOehMQoK2jTdRYT7YrwNzms=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAc06ecNR+GvPq8DslmR9NN/IWOWvdg2pQuFEOgH3l5zAiBkaI96abHJSnabqob3iGYIwnBz7hkbOKX0FZta6p+0Og=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dhaneshpurohit%2fmockstar@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2104428},"name":"@dhaneshpurohit/mockstar","type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.3.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"688a075340d0afc9115f5c758c58332ae061a57f","license":"MIT","scripts":{"dev":"bun run src/cli.ts ./examples/mocks","lint":"bunx @biomejs/biome check src tests bench","test":"bun test tests","bench":"bun run bench/harness.ts","build":"bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm && bun run build:types","format":"bunx @biomejs/biome format --write src tests bench","verify":"bun run lint && bun run typecheck && bun run build && bun run test","typecheck":"tsc --noEmit","test:watch":"bun test --watch tests","bench:proxy":"bun run bench/proxy.bench.ts","build:types":"tsc -p tsconfig.build.json","build:binary":"bun run scripts/build-binaries.ts"},"version":"0.4.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:14254263-2f7d-4705-afa4-f269c9b5439d"}},"homepage":"https://github.com/dhanesh/mockstar#readme","keywords":["mock","mock-server","api-mocking","bun","testing","wiremock-alternative","mockoon-alternative"],"repository":{"url":"git+https://github.com/dhanesh/mockstar.git","type":"git"},"_npmVersion":"12.0.2","description":"Bun-based mock server with static + dynamic mocking, JSON config, named JS handlers, pass-through, multi-tenancy, and test-data utilities.","directories":{},"maintainers":[{"name":"dhaneshpurohit","email":"dhanesh.purohit@gmail.com"}],"_nodeVersion":"22.23.2","dependencies":{"zod":"^3.23.0","hono":"^4.6.0","p-queue":"^8.0.1","jsonpath-plus":"^10.0.0","@faker-js/faker":"^9.0.0","zod-to-json-schema":"^3.23.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.6.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mockstar_0.4.0_1788959189547_0.6222458268252773"}}},"time":{"created":"2026-07-06T16:22:43.020Z","modified":"2026-09-09T13:06:30.084Z","0.1.3":"2026-07-06T16:22:43.391Z","0.2.2":"2026-07-06T21:27:28.069Z","0.3.0":"2026-09-04T02:23:02.469Z","0.4.0":"2026-09-09T13:06:29.737Z"},"bugs":{"url":"https://github.com/dhanesh/mockstar/issues"},"license":"MIT","homepage":"https://github.com/dhanesh/mockstar#readme","keywords":["mock","mock-server","api-mocking","bun","testing","wiremock-alternative","mockoon-alternative"],"repository":{"url":"git+https://github.com/dhanesh/mockstar.git","type":"git"},"description":"Bun-based mock server with static + dynamic mocking, JSON config, named JS handlers, pass-through, multi-tenancy, and test-data utilities.","maintainers":[{"name":"dhaneshpurohit","email":"dhanesh.purohit@gmail.com"}],"readme":"# Mockstar\n\n[![quickstart-smoke](https://github.com/dhanesh/mockstar/actions/workflows/quickstart-smoke.yml/badge.svg)](https://github.com/dhanesh/mockstar/actions/workflows/quickstart-smoke.yml)\n[![release](https://github.com/dhanesh/mockstar/actions/workflows/release.yml/badge.svg)](https://github.com/dhanesh/mockstar/actions/workflows/release.yml)\n\n> **Status:** pre-1.0. Minors may break mocks-file shape — see [docs/VERSIONING.md](./docs/VERSIONING.md). Pin `$schema` to `https://schemas.mockstar.dev/v0.<N>/mock.json` for stability.\n\n> A Bun-based mock server with static + dynamic mocking, JSON config, named JS handlers, pass-through routing, multi-tenancy, and test-data utilities.\n\n## Demo\n\n![mockstar demo — make docker-run + curl](./docs/media/demo.svg)\n\n<sub>Recorded with [asciinema](https://asciinema.org/) — raw cast at [`docs/media/demo.cast`](./docs/media/demo.cast). Regenerate with `make record-demo` (requires `asciinema`, `jq`, `npx`, Docker).</sub>\n\n## For SDETs\n\nMockstar ships a library embed (`import { launch } from '@dhaneshpurohit/mockstar'`) supported\nacross Jest 30, Jest 29, Vitest, and `bun test`. See [docs/SDET.md](./docs/SDET.md)\n+ the [`examples/sdet-*`](./examples) directories.\n\n## Contributing\n\nRead [CONTRIBUTING.md](./CONTRIBUTING.md). Maintainers: [docs/TEAM-WORKFLOW.md](./docs/TEAM-WORKFLOW.md).\n\n\nMockstar targets three personas equally:\n\n- **SDETs** — library-embed in test suites, ephemeral instances per CI run, deterministic mode\n- **Developers** — `bunx @dhaneshpurohit/mockstar ./mocks` with file-watch hot reload\n- **DevOps** — Docker image in shared staging with per-tenant ConfigMap mounts\n\n> Built on [Hono](https://hono.dev/) on [Bun](https://bun.sh/). Targets p99 < 5ms for static mock responses. See [DECISIONS.md](./docs/DECISIONS.md) for the constraint-first design record.\n\n## Quick start\n\n```bash\nbun install\nbun run src/cli.ts ./examples/mocks\n# http://localhost:3000\n```\n\nA persona-specific deployment walkthrough lives in [docs/DEPLOYMENT.md](./docs/DEPLOYMENT.md).\n\n## Config layout\n\n```\nmocks/\n  default/              # one directory per tenant\n    users.json          # a mock config file\n    orders.json\nhandlers/               # named JS function handlers\n  echo.ts\n```\n\nSee [docs/CONFIG.md](./docs/CONFIG.md) for the full schema and [docs/HANDLERS.md](./docs/HANDLERS.md) for dynamic handlers.\n\n## Response templating\n\nAny string value inside `response.body` or `response.headers` can contain `{{ … }}` placeholders. Whole-string placeholders in a JSON body preserve their source type — a number stays a number, an object stays an object.\n\n### Request reflection\n\n| Token | Value |\n|---|---|\n| `{{request.method}}` | HTTP verb (`GET`, `POST`, …) |\n| `{{request.path}}` | Full request path |\n| `{{request.params.<name>}}` | Path parameter captured by `:name` in `match.path` |\n| `{{request.query.<name>}}` | URL query-string value |\n| `{{request.headers.<name>}}` | Request header value (case-insensitive) |\n| `{{request.body.<dot.path>}}` | Dot-path into the parsed JSON request body |\n\n### Context\n\n| Token | Value |\n|---|---|\n| `{{tenant}}` | Tenant identifier the request was routed to |\n| `{{requestId}}` | Per-request UUID assigned by mockstar |\n\n### Random data (faker)\n\n| Token | Value |\n|---|---|\n| `{{faker.uuid}}` | Random UUID v4 |\n| `{{faker.email}}` | Random email address |\n| `{{faker.name}}` | Random full name |\n| `{{faker.integer(min, max)}}` | Random integer in `[min, max]` |\n| `{{faker.pick([\"a\",\"b\",\"c\"])}}` | Random element from the array |\n| `{{faker.boolean}}` | `true` or `false` |\n| `{{faker.dateIso}}` | Random recent date as ISO 8601 string |\n\n### Provider-shape IDs\n\n| Token | Value |\n|---|---|\n| `{{id(\"prefix_\", 14)}}` | `prefix_` + 14 random base62 chars — e.g. `order_4OwxzMjhPIt4YQ` |\n| `{{id(\"prefix_\", 14, \"0123456789abcdef\")}}` | Same with a custom alphabet (hex shown) |\n| `{{id.named(\"key\", \"prefix_\", 14)}}` | Mint once per request per name — repeated calls with the same `key` return the identical value, useful when the same ID appears in multiple fields |\n\n### Timestamps\n\n| Token | Value |\n|---|---|\n| `{{now.unix}}` | Current time as Unix seconds (number) |\n| `{{now.millis}}` | Current time as Unix milliseconds (number) |\n| `{{now.iso}}` | Current time as ISO 8601 string |\n\nIn `--deterministic` mode (`MOCKSTAR_DETERMINISTIC=1`) all faker and `now.*` tokens return fixed seed-derived values so CI replays are byte-identical.\n\nFull reference including type-preservation rules and worked examples: [docs/TIER2.md](./docs/TIER2.md).\n\n## Outbound webhooks\n\nAttach `webhooks: [...]` to any mock entry to fire HTTP deliveries **after** the matched response flushes — useful for verifying receiver-side webhook handlers in integration tests, dogfooding partner integrations, and modeling provider behavior in fixtures.\n\n```jsonc\n{\n  \"id\": \"orders-create\",\n  \"match\": { \"method\": \"POST\", \"path\": \"/orders\" },\n  \"response\": { \"kind\": \"static\", \"status\": 201, \"body\": { \"id\": \"{{id(\\\"ord_\\\", 12)}}\" } },\n  \"webhooks\": [{\n    \"id\": \"order-created\",\n    \"url\": \"https://api.partner.example/hooks/order-created\",\n    \"method\": \"POST\",\n    \"headers\": { \"content-type\": \"application/json\" },\n    \"body\": { \"orderId\": \"{{request.body.orderId}}\", \"tenant\": \"{{tenant}}\" }\n  }]\n}\n```\n\nCapabilities at a glance:\n\n| | |\n|---|---|\n| **Configuration channels** | Per-route `url`, `{{ env.NAME }}` interpolation, admin API, opt-in `X-Mockstar-Webhook-Url` request header (gated by `--allow-webhook-url-header`) |\n| **Delivery contract** | At-least-once within queue + circuit bounds, exponential backoff with jitter (default `[1s, 2s, 4s, 8s, 16s]`), idempotent `X-Mockstar-Delivery-Id` header |\n| **Signing** | Opt-in HMAC-SHA256, Stripe-style `${ts}.${rawBody}` payload, secrets via `{{ env.X }}` or `file:/path` (inline rejected at config-load) |\n| **Reliability** | Per-webhook circuit breaker, drop-oldest queue cap, per-attempt `AbortSignal.timeout`, optional `expectResponse: { status, body }` body assertion |\n| **Observability** | `/__admin/tenants/:t/webhooks` list (secrets redacted), `/webhooks/journal` history, `POST /webhooks/await?id=…` for sync test assertions, `POST /webhooks/:id/replay` for recovery |\n| **Metrics** | `webhook_delivery_total{outcome}`, `webhook_delivery_latency_us`, `webhook_queue_depth`, `webhook_queue_dropped_total`, `webhook_circuit_state` |\n| **Distribution** | In-process (no Redis); single-binary and SDET-embed friendly |\n\nFull guide, decisions log, and security model: [docs/webhooks/README.md](./docs/webhooks/README.md), [docs/webhooks/DECISIONS.md](./docs/webhooks/DECISIONS.md), [docs/webhooks/SECURITY.md](./docs/webhooks/SECURITY.md). Worked example loadable via `bun run dev`: [examples/mocks/default/webhooks-example.json](./examples/mocks/default/webhooks-example.json).\n\n## What's in v1, what's deferred\n\nSee [CHANGELOG.md](./CHANGELOG.md). TL;DR: static + dynamic + pass-through + scenarios + outbound webhooks + OpenAPI import + admin read endpoints + multi-tenancy ship in v1. Stateful mocks, GraphQL, gRPC, fault injection, and a config-mutation admin API are explicitly deferred to v1.1.\n\n## HTTPS transparent upstream (`mockstar proxy`)\n\nPoint real HTTPS traffic at your local mocks with zero application code changes — `https://api.razorpay.com` resolves to `127.0.0.1`, terminates on a mkcert-trusted leaf, and forwards to mockstar-on-3000. macOS + Linux only in v1.\n\n```bash\nmockstar proxy install           # one-time: installs CA, DNS, port-bind grant\nmockstar proxy start             # runs the HTTPS listener on :443\n```\n\nSee [docs/PROXY.md](./docs/PROXY.md) for the full guide and [docs/PROXY-RECOVERY.md](./docs/PROXY-RECOVERY.md) for incident recovery.\n\n## Running with Docker\n\nThe image is published multi-arch (`linux/amd64` + `linux/arm64`), public, and signed:\n\n```bash\ndocker pull ghcr.io/dhanesh/mockstar:latest        # or a pinned tag, e.g. :v0.1.0-alpha.1\n```\n\nThe image is **lean — it ships no mocks**. You mount your mock content at run time. The\ndefault command serves `/config/mocks`; named JS handlers (if any) are read from\n`/config/handlers`. It listens on port `3000` and runs as a non-root user (uid `10001`).\n\n### Run with your mocks mounted\n\nPoint a host folder at `/config/mocks` (and `/config/handlers` if you use named handlers):\n\n```bash\ndocker run --rm -p 3000:3000 \\\n  -v \"$PWD/mocks:/config/mocks:ro\" \\\n  -v \"$PWD/handlers:/config/handlers:ro\" \\\n  ghcr.io/dhanesh/mockstar:latest\n\n# in another shell:\ncurl localhost:3000/health        # {\"status\":\"ok\"}\ncurl localhost:3000/users/123     # your mocked response\n```\n\nHardened run (read-only root filesystem + writable temp), matching the Helm chart's\nsecurity posture:\n\n```bash\ndocker run --rm -p 3000:3000 \\\n  --read-only --tmpfs /tmp \\\n  -v \"$PWD/mocks:/config/mocks:ro\" \\\n  ghcr.io/dhanesh/mockstar:latest\n```\n\n### Adding more mocks\n\nThe mounted folder follows the [Config layout](#config-layout) — **one sub-directory per\ntenant**, one JSON file per resource:\n\n```\nmocks/\n  default/            # the default tenant\n    users.json\n    orders.json\n    billing.json      # ← drop in new files to add more routes\n  acme/               # add a directory to add a tenant\n    users.json\nhandlers/             # optional named JS/TS handlers referenced by dynamic mocks\n  computeTotal.ts\n```\n\nAdd a file (or tenant directory) under your mounted `mocks/` folder and it's served — no\nimage rebuild. Mock JSON changes are hot-reloaded on the mounted volume; **named handler\nchanges require a container restart** (handlers are loaded at boot).\n\n### Bake mocks into an image (shared deployments)\n\nFor a self-contained, versioned fixture set your team/CI can pull and run with **no mount**,\nbuild a thin image on top of the published base:\n\n```dockerfile\n# Dockerfile\nFROM ghcr.io/dhanesh/mockstar:latest\n# Copy your fixtures in (owned by the non-root runtime user)\nCOPY --chown=10001:10001 mocks/     /config/mocks/\nCOPY --chown=10001:10001 handlers/  /config/handlers/   # omit if you have no handlers\n# Base image already sets ENTRYPOINT + CMD (serve /config/mocks on :3000)\n```\n\n```bash\ndocker build -t ghcr.io/your-org/team-fixtures:1.0 .\ndocker run --rm -p 3000:3000 ghcr.io/your-org/team-fixtures:1.0   # mocks are baked in\n```\n\nPin the base by digest (`FROM ghcr.io/dhanesh/mockstar@sha256:…`) for reproducible builds,\npush the result to your own registry, and every consumer gets the identical mock set.\n\n## Kubernetes / Helm\n\nDeploy the mock + webhook server with the chart in [`charts/mockstar`](./charts/mockstar) — secure-by-default (read-only root FS, non-root uid 10001, dropped caps, admin token via Secret).\n\n```bash\nhelm install mockstar oci://ghcr.io/dhanesh/charts/mockstar \\\n  --version 0.1.0 --namespace mockstar --create-namespace\n```\n\n- **Single replica by design** (`replicaCount: 1`, `Recreate`): the journal, scenario state, and webhook queue are in-memory and per-pod — scaling beyond 1 splits that state.\n- The TLS-intercepting `mockstar proxy` is a local-only experimental dev tool and is **not** deployed by the chart.\n\nFull guide — tenant ConfigMaps, handlers, admin token Secret, NetworkPolicy egress, probes/metrics, image-by-digest: [docs/deployment/helm.md](./docs/deployment/helm.md).\n\n## Security\n\nSee [docs/SECURITY.md](./docs/SECURITY.md) for the threat model, [SECURITY.md](./SECURITY.md) for the security policy and posture. Admin endpoints are disabled by default. Pass-through and OpenAPI import share a hardened URL validator that rejects private-range targets by default (addressing CVE-2026-39885-class OpenAPI `$ref` attacks).\n\n## License & governance\n\nMIT — see [LICENSE](./LICENSE). Governance policy, irreversible-decision watch list, and the protocol for changing project-level commitments live in [docs/GOVERNANCE.md](./docs/GOVERNANCE.md).\n","readmeFilename":"README.md"}