@crvouga/mockingbird-service-vanta 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog — @crvouga/mockingbird-service-vanta
2
+
3
+ ## 0.1.0 (2026-10-05)
4
+
5
+ Initial release.
package/DISCOVERY.md ADDED
@@ -0,0 +1,55 @@
1
+ # @crvouga/mockingbird-service-vanta discovery
2
+
3
+ This is the installed-package index for coding agents and tooling. All relative links resolve
4
+ inside `node_modules/@crvouga/mockingbird-service-vanta/`; no repository checkout is needed to discover the mock's
5
+ supported surface or documented behavior.
6
+
7
+ ## Capability and behavior sources
8
+
9
+ | Question | Authoritative file | What it contains |
10
+ | --- | --- | --- |
11
+ | Behaviour and integration | [`README.md`](README.md) | Routes, state transitions, auth, webhooks, controls, presets and deliberate omissions. |
12
+ | Exact capabilities | [`SUPPORT.md`](SUPPORT.md) | Supported, unsupported and parity-covered operations or commands, including reasons for gaps. |
13
+ | Wire contract | [`openapi.yaml`](openapi.yaml) | Machine-readable paths, methods, schemas, responses and parity annotations. |
14
+ | Public API | [`dist/index.d.ts`](dist/index.d.ts) | The installed package's exact TypeScript exports and signatures. |
15
+ | Package metadata | [`package.json`](package.json) | Runtime/entry-point claims, vendor links, parity scope/tier and `mockingbird.discovery`. |
16
+
17
+ Read these together: the contract/capability matrix says *what* is available, while the README
18
+ defines stateful behavior, lifecycle rules, test controls, and intentional oracle differences.
19
+ If prose and an executable surface disagree, report a parity mismatch instead of adding a
20
+ consumer-side workaround.
21
+
22
+ ## Parity and oracle
23
+
24
+ - Declared parity surface: **OAuth, people, evidence uploads and offboarding**.
25
+ - Parity tier: **cold** (the repository controls when live checks run).
26
+ - Oracle: **Live vendor API or sandbox**.
27
+ - Repository command: `bun run parity:service -- vanta`.
28
+ - Evidence model: Run from a Mockingbird checkout; credentials come only from .env.local or GitHub Actions secrets. Missing credentials exit 2.
29
+
30
+ The npm package contains evidence summaries and the exact contract, not credentials or the
31
+ repository-only parity harness. Self-parity/property and acceptance tests run in the Mockingbird
32
+ repository; live parity is an additional oracle check, not a substitute for the packaged matrix.
33
+
34
+ ## Runtime introspection
35
+
36
+ - `GET /__admin/health`
37
+ - `GET /__admin`
38
+ - `GET /__admin/state`
39
+ - `GET /__admin/requests`
40
+ - `GET /__admin/metrics`
41
+ - `GET /__admin/faults/presets`
42
+ - `GET /__admin/ui`
43
+
44
+ For HTTP services, use `x-mockingbird-namespace` (or the documented credential/path carrier) so
45
+ parallel tests do not share state. Admin state, journal, metrics and fault-preset endpoints are
46
+ designed for assertions and diagnosis by consuming test suites.
47
+
48
+ ## Report a mismatch or missing capability
49
+
50
+ Follow the [agent reporting contract](https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md). Include package version,
51
+ operation/command, a minimal redacted request, actual mock result, expected oracle result or vendor
52
+ documentation, and whether the mismatch appears in the matrix. Never include keys, tokens,
53
+ customer data, prompts, PHI, card data, or unredacted recordings.
54
+
55
+ Service key: `vanta`.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # @crvouga/mockingbird-service-vanta
2
+
3
+ > Familiar calls. Faithful echoes. Part of [Mockingbird](https://github.com/crvouga/mockingbird).
4
+
5
+ WIP Manage Vanta OAuth, paginated compliance records, evidence metadata and offboarding.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ bun add @crvouga/mockingbird-service-vanta
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { createRuntime } from "@crvouga/mockingbird-service-vanta"
17
+ const vanta = createRuntime()
18
+ const response = await vanta.fetch(new Request("http://vanta.test/v1/people?pageSize=10", {
19
+ headers: { authorization: "Bearer mock_vanta_token" },
20
+ }))
21
+ const { results } = await response.json()
22
+ console.log(results.pageInfo)
23
+ ```
24
+
25
+ Run `mockingbird-vanta serve --port 12129` and inject `http://localhost:12129` as the
26
+ consumer's API origin. There is no universal Vanta SDK environment variable for this override;
27
+ the requested consumer uses raw fetch. Credentials and records are synthetic only.
28
+
29
+ ### Contract
30
+
31
+ - `POST /oauth/token`: JSON client_credentials with client_id, client_secret and scope.
32
+ Default clients: mock_read / mock_read_secret (read scope), mock_write / mock_write_secret
33
+ (read, write and documents:upload). Tokens last one hour; minting another token for a client
34
+ revokes its preceding token. mock_vanta_token is a seeded write-client bearer token.
35
+ - `GET /v1/people`, `/v1/tests`, `/v1/controls`, `/v1/documents`: results.data and results.pageInfo,
36
+ pageSize (1–100, default 10), pageCursor. Follow endCursor while hasNextPage is true.
37
+ Fixture insertion order is stable; resource ids serve as opaque cursors.
38
+ - `GET /v1/people/{personId}`, `/v1/documents/{documentId}`: seeded resource fields by id.
39
+ - `POST /v1/documents/{documentId}/uploads`: multipart file plus optional description and
40
+ effectiveAtDate. Returns 201 uploaded-file metadata. Only metadata/byte length is retained,
41
+ never the evidence bytes. Requires documents:upload scope.
42
+ - `POST /v1/documents/{documentId}/submit`: requires a pending upload and write scope;
43
+ returns **204**, marks pending uploads submitted and document uploadStatus OK. The formal
44
+ Manage Vanta OpenAPI specifies 204; a guide's 200 example is not followed.
45
+ - `POST /v1/people/offboard`: updates[] containing id and acknowledgerId. Returns 200 with
46
+ ordered per-person SUCCESS/ERROR results. Only FORMER personnel with seeded eligibility
47
+ flags (monitoredAccountsInactive, customTasksComplete) and a known acknowledger succeed.
48
+ Failed items are unchanged. Successful items expose OFFBOARDING_COMPLETE in tasksSummary;
49
+ a separate admin offboardings collection records acknowledger and completion time.
50
+
51
+ Read calls require all:read scope, submission/offboarding all:write, and upload documents:upload
52
+ (each prefixed vanta-api.). Missing/invalid/expired resource bearer tokens return literal
53
+ `Unauthorized` with application/json content type, matching an unauthenticated live probe.
54
+ Consumers must not assume every error body is parseable JSON. Other documented failure classes
55
+ use status plus message, with deterministic mock messages rather than exact vendor wording.
56
+
57
+ ### Controls and proof
58
+
59
+ Seed clients, people, documents, tests and controls through constructor options. Shared
60
+ `/__admin/state/{collection}` also exposes tokens, uploads, eligibility and offboardings.
61
+ Token expiresAt, document metadata, eligibility and upload submitted flags are configurable.
62
+ Shared clock, Timeline/snapshot, reset, faults and metadata-only journals apply. Reset restores
63
+ constructor fixtures. Namespace carriers: header, mapped bearer token, `/__admin/ns/{name}`.
64
+ Set adminPrefix to relocate all controls.
65
+
66
+ Presets: unauthorized_once, rate_limited, server_error, upload_failed, submit_failed and
67
+ connection_drop. Shared fault rules support latency. No webhook is required by this subset.
68
+
69
+ Tests cover all issue #270 behaviors through raw fetch, per-person eligibility, scope and token
70
+ revocation, metadata-only multipart handling, namespace/reset, failures and served HTTP.
71
+ Self-parity covers every generated JSON operation; multipart uploads have explicit acceptance
72
+ tests. `bun scripts/parity.ts --unauthenticated` verifies the observed non-JSON 401; it passed
73
+ with no real credentials. The optional read-only pagination-envelope probe needs VANTA_ACCESS_TOKEN
74
+ and has not run. Oracle: official Manage Vanta OpenAPI and authentication documentation.
75
+
76
+ ### Deliberately not modelled
77
+
78
+ Real employee offboarding, accounts/integration task engines, evidence bytes/downloads, trust-center
79
+ UI, browser OAuth/refresh, automatic compliance evaluation, full vendor resource schemas, list
80
+ filter expressions and live quota accounting. Seed the fields the consumer reads; collections
81
+ echo them without fabricating compliance conclusions. Eligibility flags are explicit test controls,
82
+ not substitutes for real account deactivation. No real tenant mutation is ever necessary.
83
+
84
+ ## API
85
+
86
+ - `VantaAPI`: FetchAPI, reset and collections.
87
+ - `createRuntime`: shared namespace/admin/clock/fault contract.
88
+ - `VANTA_NAMESPACE`, `VANTA_SCOPES`, `VANTA_PRESETS`: service constants.
89
+ - `document`, `operationIds`, `supportedOperationIds`: generated contract metadata.
90
+ - `createServer`, `serveTarget`, `DEFAULT_PORT` from `./server`: Node server and CLI targets.
91
+
92
+ Public types: Resource, Client, Token, Upload, Eligibility, VantaAPIOptions, OperationId,
93
+ SupportedOperationId; VantaServerOptions and VantaServer from ./server.
package/SUPPORT.md ADDED
@@ -0,0 +1,20 @@
1
+ # Manage Vanta consumer subset — operation support
2
+
3
+ Generated from `openapi.yaml`; do not edit by hand.
4
+
5
+ - operations in spec: **10**
6
+ - supported by the mock: **10**
7
+ - parity enabled: **9**
8
+
9
+ | operationId | route | mock | parity | notes |
10
+ | --- | --- | --- | --- | --- |
11
+ | `ListPeople` | `GET /v1/people` | ✅ supported | ✅ | |
12
+ | `ListTests` | `GET /v1/tests` | ✅ supported | ✅ | |
13
+ | `ListControls` | `GET /v1/controls` | ✅ supported | ✅ | |
14
+ | `ListDocuments` | `GET /v1/documents` | ✅ supported | ✅ | |
15
+ | `GetPerson` | `GET /v1/people/{personId}` | ✅ supported | ✅ | |
16
+ | `GetDocument` | `GET /v1/documents/{documentId}` | ✅ supported | ✅ | |
17
+ | `OAuthToken` | `POST /oauth/token` | ✅ supported | ⚠️ unsafe (opt-in) | |
18
+ | `UploadFileForDocument` | `POST /v1/documents/{documentId}/uploads` | ✅ supported | ❌ disabled | Multipart file uploads exercised through raw-fetch acceptance tests. |
19
+ | `SubmitDocumentCollection` | `POST /v1/documents/{documentId}/submit` | ✅ supported | ⚠️ unsafe (opt-in) | |
20
+ | `OffboardPeople` | `POST /v1/people/offboard` | ✅ supported | ⚠️ unsafe (opt-in) | |