@weave-kit/engine 1.1.0 → 1.2.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 +27 -0
- package/README.md +210 -210
- package/dist/adapters/auth/index.d.ts +1 -1
- package/dist/adapters/auth/index.d.ts.map +1 -1
- package/dist/adapters/auth/index.js +1 -1
- package/dist/adapters/auth/index.js.map +1 -1
- package/dist/adapters/auth/subject.d.ts +6 -0
- package/dist/adapters/auth/subject.d.ts.map +1 -1
- package/dist/adapters/auth/subject.js +16 -1
- package/dist/adapters/auth/subject.js.map +1 -1
- package/dist/adapters/events/index.d.ts.map +1 -1
- package/dist/adapters/events/index.js +4 -2
- package/dist/adapters/events/index.js.map +1 -1
- package/dist/adapters/rest/audit.d.ts.map +1 -1
- package/dist/adapters/rest/audit.js +8 -7
- package/dist/adapters/rest/audit.js.map +1 -1
- package/dist/adapters/rest/capabilities.d.ts +23 -0
- package/dist/adapters/rest/capabilities.d.ts.map +1 -0
- package/dist/adapters/rest/capabilities.js +27 -0
- package/dist/adapters/rest/capabilities.js.map +1 -0
- package/dist/adapters/rest/common.d.ts +10 -1
- package/dist/adapters/rest/common.d.ts.map +1 -1
- package/dist/adapters/rest/common.js +4 -0
- package/dist/adapters/rest/common.js.map +1 -1
- package/dist/adapters/rest/identityAdmin.d.ts +6 -3
- package/dist/adapters/rest/identityAdmin.d.ts.map +1 -1
- package/dist/adapters/rest/identityAdmin.js +53 -9
- package/dist/adapters/rest/identityAdmin.js.map +1 -1
- package/dist/adapters/rest/identitySync.d.ts +23 -0
- package/dist/adapters/rest/identitySync.d.ts.map +1 -0
- package/dist/adapters/rest/identitySync.js +28 -0
- package/dist/adapters/rest/identitySync.js.map +1 -0
- package/dist/adapters/rest/index.d.ts +5 -0
- package/dist/adapters/rest/index.d.ts.map +1 -1
- package/dist/adapters/rest/index.js +2 -0
- package/dist/adapters/rest/index.js.map +1 -1
- package/dist/adapters/rest/plugin.d.ts +6 -0
- package/dist/adapters/rest/plugin.d.ts.map +1 -1
- package/dist/adapters/rest/plugin.js +9 -9
- package/dist/adapters/rest/plugin.js.map +1 -1
- package/dist/adapters/rest/workflow.js +9 -9
- package/dist/adapters/rest/workflow.js.map +1 -1
- package/dist/cli/commands/identity.d.ts +5 -1
- package/dist/cli/commands/identity.d.ts.map +1 -1
- package/dist/cli/commands/identity.js +29 -0
- package/dist/cli/commands/identity.js.map +1 -1
- package/dist/cli/index.js +14 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/types/commands.d.ts +12 -0
- package/dist/cli/types/commands.d.ts.map +1 -1
- package/dist/cli/types/index.d.ts +1 -1
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/cli/types/values.d.ts +2 -0
- package/dist/cli/types/values.d.ts.map +1 -1
- package/dist/cli/types/values.js +2 -0
- package/dist/cli/types/values.js.map +1 -1
- package/dist/core/audit/types.d.ts +4 -0
- package/dist/core/audit/types.d.ts.map +1 -1
- package/dist/core/audit/types.js.map +1 -1
- package/dist/core/limiter/index.d.ts +1 -1
- package/dist/core/limiter/index.d.ts.map +1 -1
- package/dist/core/limiter/index.js +1 -1
- package/dist/core/limiter/index.js.map +1 -1
- package/dist/core/limiter/quota.d.ts +6 -3
- package/dist/core/limiter/quota.d.ts.map +1 -1
- package/dist/core/limiter/quota.js +7 -4
- package/dist/core/limiter/quota.js.map +1 -1
- package/dist/core/object/validate/field.d.ts.map +1 -1
- package/dist/core/object/validate/field.js +4 -2
- package/dist/core/object/validate/field.js.map +1 -1
- package/dist/core/provider/capabilities/index.d.ts +3 -0
- package/dist/core/provider/capabilities/index.d.ts.map +1 -0
- package/dist/core/provider/capabilities/index.js +2 -0
- package/dist/core/provider/capabilities/index.js.map +1 -0
- package/dist/core/provider/capabilities/types.d.ts +22 -0
- package/dist/core/provider/capabilities/types.d.ts.map +1 -0
- package/dist/core/provider/capabilities/types.js +3 -0
- package/dist/core/provider/capabilities/types.js.map +1 -0
- package/dist/core/provider/identity/directory.d.ts +23 -0
- package/dist/core/provider/identity/directory.d.ts.map +1 -1
- package/dist/core/provider/identity/index.d.ts +1 -1
- package/dist/core/provider/identity/index.d.ts.map +1 -1
- package/dist/core/provider/identity/index.js.map +1 -1
- package/dist/core/provider/identity/types.d.ts +6 -0
- package/dist/core/provider/identity/types.d.ts.map +1 -1
- package/dist/core/provider/index.d.ts +1 -0
- package/dist/core/provider/index.d.ts.map +1 -1
- package/dist/core/provider/index.js +1 -0
- package/dist/core/provider/index.js.map +1 -1
- package/dist/core/rbac/index.d.ts +1 -0
- package/dist/core/rbac/index.d.ts.map +1 -1
- package/dist/core/rbac/index.js +1 -0
- package/dist/core/rbac/index.js.map +1 -1
- package/dist/core/rbac/rls.d.ts.map +1 -1
- package/dist/core/rbac/rls.js +9 -3
- package/dist/core/rbac/rls.js.map +1 -1
- package/dist/core/rbac/rowScope.d.ts.map +1 -1
- package/dist/core/rbac/rowScope.js +19 -15
- package/dist/core/rbac/rowScope.js.map +1 -1
- package/dist/core/rbac/scopeMarker.d.ts +10 -0
- package/dist/core/rbac/scopeMarker.d.ts.map +1 -0
- package/dist/core/rbac/scopeMarker.js +25 -0
- package/dist/core/rbac/scopeMarker.js.map +1 -0
- package/dist/core/script/types.d.ts +2 -0
- package/dist/core/script/types.d.ts.map +1 -1
- package/dist/core/script/types.js.map +1 -1
- package/dist/core/types/fields.d.ts +2 -0
- package/dist/core/types/fields.d.ts.map +1 -1
- package/dist/core/types/principal.d.ts +3 -0
- package/dist/core/types/principal.d.ts.map +1 -1
- package/dist/core/types/principal.js +6 -0
- package/dist/core/types/principal.js.map +1 -1
- package/dist/core/types/values.d.ts +7 -1
- package/dist/core/types/values.d.ts.map +1 -1
- package/dist/core/types/values.js +7 -1
- package/dist/core/types/values.js.map +1 -1
- package/dist/runtime/data-access/formula.js +1 -1
- package/dist/runtime/data-access/index.d.ts +1 -1
- package/dist/runtime/data-access/index.d.ts.map +1 -1
- package/dist/runtime/data-access/index.js +1 -1
- package/dist/runtime/data-access/index.js.map +1 -1
- package/dist/runtime/data-access/query.d.ts.map +1 -1
- package/dist/runtime/data-access/query.js +13 -16
- package/dist/runtime/data-access/query.js.map +1 -1
- package/dist/runtime/data-access/rbac.js +3 -3
- package/dist/runtime/data-access/rbac.js.map +1 -1
- package/dist/runtime/data-access/sql-executor.d.ts +2 -1
- package/dist/runtime/data-access/sql-executor.d.ts.map +1 -1
- package/dist/runtime/data-access/sql-executor.js +7 -2
- package/dist/runtime/data-access/sql-executor.js.map +1 -1
- package/dist/runtime/data-access/types.d.ts +4 -0
- package/dist/runtime/data-access/types.d.ts.map +1 -1
- package/dist/runtime/data-access/types.js +5 -1
- package/dist/runtime/data-access/types.js.map +1 -1
- package/dist/runtime/data-access/workflow.js +27 -27
- package/dist/runtime/engine.d.ts +27 -0
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +19 -2
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/identity/admin.d.ts +13 -5
- package/dist/runtime/identity/admin.d.ts.map +1 -1
- package/dist/runtime/identity/admin.js +24 -4
- package/dist/runtime/identity/admin.js.map +1 -1
- package/dist/runtime/identity/store.d.ts +7 -1
- package/dist/runtime/identity/store.d.ts.map +1 -1
- package/dist/runtime/identity/store.js +57 -24
- package/dist/runtime/identity/store.js.map +1 -1
- package/dist/runtime/metadata/revision.js +2 -2
- package/dist/runtime/record-meta/store.js +2 -2
- package/dist/subsystems/audit/store.d.ts.map +1 -1
- package/dist/subsystems/audit/store.js +6 -4
- package/dist/subsystems/audit/store.js.map +1 -1
- package/dist/subsystems/script/backend/types.d.ts +1 -0
- package/dist/subsystems/script/backend/types.d.ts.map +1 -1
- package/dist/subsystems/script/bridge.d.ts.map +1 -1
- package/dist/subsystems/script/bridge.js +2 -1
- package/dist/subsystems/script/bridge.js.map +1 -1
- package/dist/subsystems/workflow/store.js +13 -13
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/cli/commands/workflow-migrate.d.ts +0 -11
- package/dist/cli/commands/workflow-migrate.d.ts.map +0 -1
- package/dist/cli/commands/workflow-migrate.js +0 -120
- package/dist/cli/commands/workflow-migrate.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to `@weave-kit/engine`. Format follows [Keep a Changelog](https://keepachangelog.com/);
|
|
4
4
|
the project uses [Semantic Versioning](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## [1.2.0] - 2026-10-11
|
|
7
|
+
|
|
8
|
+
Additive (no `CONTRACT_VERSION` bump): seams for the Cloud/Console control plane.
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Generic row-scope (`scope`).** The canonical twin of `tenant`: a field marked `"scope": true`
|
|
13
|
+
scopes reads/writes to `subject.scopeId ?? subject.tenantId` — RBAC row scope + native RLS
|
|
14
|
+
(`weavekit.scope_id` GUC; `weavekit.tenant_id` retained and set alongside) + audit (`scopeId`).
|
|
15
|
+
`EngineConfig.scope`, `withDefaultScope`, `principalScopeId` / `scopeOf` / `scopedKey`, and the
|
|
16
|
+
`scopeId` alias on `IdentitySubject` / `AuditEvent` / `AuditQuery` / SSE events are additive; the
|
|
17
|
+
`tenant` names keep working.
|
|
18
|
+
- **REST `principalFor` seam.** `EngineRestConfig.principalFor` maps an authenticated request to an
|
|
19
|
+
`AccessPrincipal`, letting a control plane run requests under a **system/admin scope**
|
|
20
|
+
(`systemPrincipal(SYSTEM_CAPABILITIES.INTERNAL_ADMIN)`) for cross-tenant global views.
|
|
21
|
+
- **Identity sync trigger.** `POST {prefix}/identity/sync` (admin-gated) runs the configured
|
|
22
|
+
`identity.source` (`runIdentitySync`) on demand — the manual projection step for site members
|
|
23
|
+
(`dryRun` supported).
|
|
24
|
+
- **Capabilities read seam.** `EngineConfig.capabilities.provider` + `GET {prefix}/capabilities`
|
|
25
|
+
(baseline + host-injected `Capabilities`). The engine surfaces entitlements verbatim and never
|
|
26
|
+
judges licensing.
|
|
27
|
+
- **Identity admin write completeness.** `IdentityStore`/`IdentityAdmin` gain `updateUserRoles` /
|
|
28
|
+
`deleteUser` / `createDepartment` / `listDepartments` (rows now carry `name`/`email`/`mobile`,
|
|
29
|
+
departments `name`/`code`). REST adds `PATCH` roles on `/identity/users/:id`, `DELETE`
|
|
30
|
+
`/identity/users/:id`, and `/identity/departments` (`GET`/`POST`); CLI adds
|
|
31
|
+
`weave identity:set-roles` / `weave identity:delete`.
|
|
32
|
+
|
|
6
33
|
## [1.1.0] - 2026-10-10
|
|
7
34
|
|
|
8
35
|
### Removed
|
package/README.md
CHANGED
|
@@ -1,210 +1,210 @@
|
|
|
1
|
-
<h1 align="center">Let AI agents operate your data — safely</h1>
|
|
2
|
-
|
|
3
|
-
Define your data model once in `schema.json`, and WeaveKit compiles it into PostgreSQL tables, REST
|
|
4
|
-
and GraphQL APIs with row- and field-level RBAC, an immutable audit log with execution evidence, and
|
|
5
|
-
an MCP tool surface that AI agents call with typed tools — never raw SQL. Self-hosted: your data
|
|
6
|
-
stays in your database.
|
|
7
|
-
|
|
8
|
-
```
|
|
9
|
-
objects/leads/schema.json → Git commit (source of truth)
|
|
10
|
-
PostgreSQL tables + indexes + RLS
|
|
11
|
-
REST + GraphQL APIs (CRUD + RBAC)
|
|
12
|
-
MCP tools (per-identity surface + guardrails + approvals)
|
|
13
|
-
Immutable audit log + execution evidence
|
|
14
|
-
TypeScript types
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Why WeaveKit
|
|
18
|
-
|
|
19
|
-
- **Safe by construction** — every agent action is authorized by row- and field-level RBAC and
|
|
20
|
-
native PostgreSQL RLS, and recorded in an immutable audit log. Guardrails (and optional
|
|
21
|
-
approvals) sit in front.
|
|
22
|
-
- **Your model is a Git repository** — schema, hooks and policies are files you review, diff and
|
|
23
|
-
revert; the engine commits every change for you, and PostgreSQL is a derived cache.
|
|
24
|
-
- **One agent, many users** — each MCP call carries the acting user's identity (on-behalf-of), and
|
|
25
|
-
the engine compiles a per-identity tool surface: a salesperson's agent sees only their own leads,
|
|
26
|
-
a finance agent cannot read sales notes. Prompt injection cannot bypass RBAC/RLS.
|
|
27
|
-
- **Bring your existing PostgreSQL** — point the engine at a live database and declare the tables
|
|
28
|
-
you want to expose; existing tables stay read-only unless you explicitly allow additive DDL, and
|
|
29
|
-
`weave introspect` can reverse-model them into `schema.json`.
|
|
30
|
-
- **Typed tools in minutes, not weeks** — hand-writing an MCP server (tools + permissions + audit)
|
|
31
|
-
for a few tables takes days; here it is a few `schema.json` files, and new fields or tables
|
|
32
|
-
extend the tool surface automatically.
|
|
33
|
-
- **More than MCP** — the same schema also drives REST and GraphQL APIs and generated TypeScript
|
|
34
|
-
types, so people and agents share one governed contract.
|
|
35
|
-
- **Self-hosted** — the engine runs in your environment; no data leaves your database.
|
|
36
|
-
|
|
37
|
-
## How it works
|
|
38
|
-
|
|
39
|
-
`weave` reads `objects/<name>/schema.json`, validates it, and syncs it to PostgreSQL (state-diff
|
|
40
|
-
migrations; existing tables stay read-only unless you allow additive DDL). The same metadata drives
|
|
41
|
-
the REST routes and the MCP tool surface, and the data-access layer enforces RBAC and audits every
|
|
42
|
-
write.
|
|
43
|
-
|
|
44
|
-
## Features
|
|
45
|
-
|
|
46
|
-
- **Git-versioned metadata** — schema, hooks and policies are plain files in your repository; every
|
|
47
|
-
change is a scoped, atomic Git commit, so review, history and rollback come for free. PostgreSQL
|
|
48
|
-
stays a derived cache.
|
|
49
|
-
- **Schema as the source of truth** — `objects/<name>/schema.json` drives the tables, REST API and MCP
|
|
50
|
-
surface; state-diff migrations to PostgreSQL.
|
|
51
|
-
- **Custom field types** — register business-semantic types (`money`, `address`, …) as thin, namespaced
|
|
52
|
-
layers over a built-in primitive; they inherit storage, REST/MCP/OpenAPI schemas and generated
|
|
53
|
-
types. Declared in a project-local, Git-committed `field-types/` directory.
|
|
54
|
-
- **Named enums** — declare a shared enum once in `enums/` and reference it from any object by
|
|
55
|
-
`enumType`; every field shares one native PostgreSQL type and one set of per-value labels.
|
|
56
|
-
- **Governed REST API** — object CRUD with row-level (`all`/`own`/`department`) and field-level RBAC
|
|
57
|
-
and a uniform error contract.
|
|
58
|
-
- **MCP tool surface** — a streamable HTTP endpoint at `/mcp` with a per-identity tool surface and
|
|
59
|
-
guardrails.
|
|
60
|
-
- **GraphQL API** — an opt-in read/write GraphQL endpoint compiled from the same `schema.json`, with
|
|
61
|
-
nested relations, the same RBAC/audit, per-request batching and query hardening.
|
|
62
|
-
- **Schema revisions & atomic deploys** — `weave deploy plan` previews the diff; `weave deploy apply`
|
|
63
|
-
commits the DDL, the metadata cache and a global **schema revision** in one transaction (no
|
|
64
|
-
half-applied deploys).
|
|
65
|
-
- **Agent execution pipeline** — every write and tool call runs through one
|
|
66
|
-
Plan → Validate → Authorize → Guardrail → Approval → Execute → Commit → Evidence pipeline, so
|
|
67
|
-
guardrails and approvals cover REST, MCP and GraphQL alike; enable `evidence` to record a
|
|
68
|
-
`weavekit_evidence` row per execution (correlated by request / trace / schema revision).
|
|
69
|
-
- **Query budget** — bound a read/query across the engine: rows, filters and sorts in data-access,
|
|
70
|
-
joins / SQL length / statement timeout in restricted SQL, and GraphQL depth.
|
|
71
|
-
- **Multi-tenancy (row)** — mark a field `"tenant": true` and every read/write is scoped to the
|
|
72
|
-
subject's tenant (RBAC row scope + PostgreSQL RLS + audit); single-tenant by default.
|
|
73
|
-
- **Audit log** — an immutable event log for data mutations, with durability modes
|
|
74
|
-
(`best-effort` / `transactional` / `durable`) and a keyset-cursor query.
|
|
75
|
-
- **Observability** — a low-level metrics/trace seam (`MetricsSink` / `TraceSink`, `METRIC_NAMES`)
|
|
76
|
-
that emits request latency, RBAC denials, query-budget rejects and W3C `traceparent`-correlated
|
|
77
|
-
spans; the engine ships a no-op default and brings no backend.
|
|
78
|
-
- **Sandboxed hooks** — `*.server.js` lifecycle hooks running in isolated workers.
|
|
79
|
-
- **Type generation** — object-level TypeScript types derived from the schema.
|
|
80
|
-
- **Live events** — an SSE stream with replay.
|
|
81
|
-
- **Operations** — `weave doctor` preflight, health / readiness / version endpoints, request rate
|
|
82
|
-
limiting, CORS and structured logging.
|
|
83
|
-
|
|
84
|
-
## Requirements
|
|
85
|
-
|
|
86
|
-
- Node.js 22+
|
|
87
|
-
- PostgreSQL 12+ (the engine's tested floor; `weave doctor` reports the version)
|
|
88
|
-
|
|
89
|
-
## Quick start
|
|
90
|
-
|
|
91
|
-
```sh
|
|
92
|
-
npm create weavekit-app my-app -- --type=agent
|
|
93
|
-
cd my-app
|
|
94
|
-
cp .env.example .env # set DATABASE_URL
|
|
95
|
-
weave migrate # state-diff migration: schema.json → PostgreSQL tables (+ metadata cache)
|
|
96
|
-
weave dev # http://localhost:3000 — hot reload
|
|
97
|
-
weave types # object-level TS types → generated/types.ts
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
**Existing database?** Reverse-model it instead of authoring from scratch:
|
|
101
|
-
|
|
102
|
-
```sh
|
|
103
|
-
weave introspect # live tables → objects/<table>/schema.json (read-only)
|
|
104
|
-
weave schema:map # schema field ↔ PostgreSQL column mapping + drift
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
**Connect an agent** (MCP is available at `/mcp`):
|
|
108
|
-
|
|
109
|
-
```sh
|
|
110
|
-
weave mcp:config # ready-to-paste config for Claude Code / Cursor / VS Code / Claude Desktop
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Documentation
|
|
114
|
-
|
|
115
|
-
Full documentation: **[docs.weavekit.io/engine](https://docs.weavekit.io/engine)**
|
|
116
|
-
|
|
117
|
-
- [Getting started](https://docs.weavekit.io/engine/guides/getting-started) — scaffold, migrate, run, consume
|
|
118
|
-
- [Git-versioned metadata](https://docs.weavekit.io/engine/guides/model/git-versioned-metadata) — your data model as reviewable Git commits
|
|
119
|
-
- [Schema guide](https://docs.weavekit.io/engine/guides/model/schema) · [RBAC](https://docs.weavekit.io/engine/guides/access/rbac) · [Multi-tenancy](https://docs.weavekit.io/engine/guides/access/multi-tenancy) · [Formulas](https://docs.weavekit.io/engine/guides/model/formulas) · [Audit](https://docs.weavekit.io/engine/guides/platform/audit)
|
|
120
|
-
- [CLI reference](https://docs.weavekit.io/engine/guides/platform/cli) · [Observability](https://docs.weavekit.io/engine/guides/platform/observability) · [MCP](https://docs.weavekit.io/engine/guides/agents/mcp) · [Execution & evidence](https://docs.weavekit.io/engine/guides/agents/execution-and-evidence) · [Script hooks](https://docs.weavekit.io/engine/guides/automation/script-hooks)
|
|
121
|
-
- [Custom tools & guardrails](https://docs.weavekit.io/engine/guides/agents/custom-tools-and-guardrails) · [Query budget](https://docs.weavekit.io/engine/guides/automation/query-budget) · [Custom field types](https://docs.weavekit.io/engine/reference/schema/custom-field-types) · [Quotas](https://docs.weavekit.io/engine/guides/automation/quotas) · [Inbound events](https://docs.weavekit.io/engine/guides/integration/ingress)
|
|
122
|
-
- [Public API & dependency budget](https://docs.weavekit.io/engine/reference/api/public-api) · [Enterprise seams](https://docs.weavekit.io/engine/reference/enterprise-seams) · [Contract freeze](https://docs.weavekit.io/engine/reference/contract-freeze)
|
|
123
|
-
- [Practices & operations](https://docs.weavekit.io/engine/practices/agent/existing-crm-to-mcp) · [Release checklist](https://docs.weavekit.io/engine/operations/release) — real integration and deployment walkthroughs
|
|
124
|
-
|
|
125
|
-
The Markdown sources live in [`docs/`](https://github.com/weavekit/engine/tree/main/docs).
|
|
126
|
-
|
|
127
|
-
## Programmatic use
|
|
128
|
-
|
|
129
|
-
```ts
|
|
130
|
-
import { createEngine } from '@weave-kit/engine';
|
|
131
|
-
|
|
132
|
-
const engine = await createEngine({
|
|
133
|
-
databaseUrl: process.env.DATABASE_URL,
|
|
134
|
-
schemaDir: '.', // project root containing objects/
|
|
135
|
-
auth: { source: { 'sk-admin': { id: 'admin', roles: ['admin'] } } },
|
|
136
|
-
});
|
|
137
|
-
await engine.app.listen({ port: 3000 });
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## Metadata
|
|
141
|
-
|
|
142
|
-
- **Objects** live in `objects/<name>/schema.json` (one directory per object; the directory name must
|
|
143
|
-
equal the object name).
|
|
144
|
-
- **`weavekit.config.ts`** is the single wiring point — a default export `satisfies EngineConfig`
|
|
145
|
-
(`schemaDir`, `auth`, `adapters`, `subsystems`).
|
|
146
|
-
- `schema.json` is versioned in Git and is the source of truth; the engine syncs it to PostgreSQL and
|
|
147
|
-
a metadata cache.
|
|
148
|
-
|
|
149
|
-
## CLI
|
|
150
|
-
|
|
151
|
-
| Command | Description |
|
|
152
|
-
| --- | --- |
|
|
153
|
-
| `weave migrate [--dry-run]` | State-diff migration + metadata cache + auto-commit |
|
|
154
|
-
| `weave deploy plan` / `weave deploy apply` | Preview / atomically apply schema changes and record a global schema revision |
|
|
155
|
-
| `weave doctor` | Read-only preflight (connection, PostgreSQL compatibility, drift, system tables, RLS + sandbox) |
|
|
156
|
-
| `weave dev [--port]` | Run with hot reload |
|
|
157
|
-
| `weave build` | Bundle the server entry (esbuild) |
|
|
158
|
-
| `weave test` | Proxy the project test suite |
|
|
159
|
-
| `weave types [--outdir]` | Compile `schema.json` into object-level TS types |
|
|
160
|
-
| `weave introspect` | Reverse-model an existing Postgres DB into `objects/*/schema.json` |
|
|
161
|
-
| `weave schema:map [object] [--drift]` | Report the schema field ↔ PostgreSQL column mapping |
|
|
162
|
-
| `weave schema:upgrade [--dry-run]` | Upgrade `objects/*/schema.json` to the current format version |
|
|
163
|
-
| `weave openapi [--out] [--generic] [--server]` | Emit an OpenAPI 3.1 document for the REST API |
|
|
164
|
-
| `weave graphql:schema [--out]` | Emit the GraphQL SDL for this project |
|
|
165
|
-
| `weave mcp:config [--host]` | Print MCP client config for this project's `/mcp` endpoint |
|
|
166
|
-
| `weave connect` | Connect a self-hosted engine out to a governance tunnel endpoint |
|
|
167
|
-
| `weave object:create <name>` | Scaffold `objects/<name>/schema.json` + `server.js` hooks |
|
|
168
|
-
| `weave field:add <object>` | Add a validated field to a schema |
|
|
169
|
-
| `weave field-type:list` | List built-in + registered field types |
|
|
170
|
-
| `weave field-type:check` | Validate registrations + schemas against the registry |
|
|
171
|
-
| `weave enum:list` | List declared named enums (`enums/<name>.json`) |
|
|
172
|
-
| `weave enum:check` | Validate enum declarations + schema references |
|
|
173
|
-
| `weave module:add` / `module:remove <name>` | Enable/disable an optional subsystem (audit/script/workflow) |
|
|
174
|
-
|
|
175
|
-
## Object-level types
|
|
176
|
-
|
|
177
|
-
```sh
|
|
178
|
-
weave types # → generated/types.ts
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
```ts
|
|
182
|
-
import type { Lead } from './generated/types';
|
|
183
|
-
import { createClient } from '@weave-kit/client';
|
|
184
|
-
|
|
185
|
-
const leads = createClient({ baseUrl, apiKey }).objects<Lead>('lead');
|
|
186
|
-
const { rows } = await leads.find({ filter: { status: 'open' } });
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
## Development
|
|
190
|
-
|
|
191
|
-
```sh
|
|
192
|
-
npm install
|
|
193
|
-
npm run build # tsc → dist
|
|
194
|
-
npm test # unit + e2e (e2e needs DATABASE_URL)
|
|
195
|
-
npm run test:coverage # coverage gate on security-critical paths
|
|
196
|
-
npm run typecheck
|
|
197
|
-
npm run lint
|
|
198
|
-
node scripts/check-exports.mjs # verify package exports + contract names
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
Issues and pull requests are welcome. See [`AGENTS.md`](AGENTS.md) for architecture notes and
|
|
202
|
-
contribution invariants.
|
|
203
|
-
|
|
204
|
-
## Support
|
|
205
|
-
|
|
206
|
-
Questions, bug reports and security reports: **support@weavekit.io**.
|
|
207
|
-
|
|
208
|
-
## License
|
|
209
|
-
|
|
210
|
-
[MIT](LICENSE) · For support, contact **support@weavekit.io**.
|
|
1
|
+
<h1 align="center">Let AI agents operate your data — safely</h1>
|
|
2
|
+
|
|
3
|
+
Define your data model once in `schema.json`, and WeaveKit compiles it into PostgreSQL tables, REST
|
|
4
|
+
and GraphQL APIs with row- and field-level RBAC, an immutable audit log with execution evidence, and
|
|
5
|
+
an MCP tool surface that AI agents call with typed tools — never raw SQL. Self-hosted: your data
|
|
6
|
+
stays in your database.
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
objects/leads/schema.json → Git commit (source of truth)
|
|
10
|
+
PostgreSQL tables + indexes + RLS
|
|
11
|
+
REST + GraphQL APIs (CRUD + RBAC)
|
|
12
|
+
MCP tools (per-identity surface + guardrails + approvals)
|
|
13
|
+
Immutable audit log + execution evidence
|
|
14
|
+
TypeScript types
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Why WeaveKit
|
|
18
|
+
|
|
19
|
+
- **Safe by construction** — every agent action is authorized by row- and field-level RBAC and
|
|
20
|
+
native PostgreSQL RLS, and recorded in an immutable audit log. Guardrails (and optional
|
|
21
|
+
approvals) sit in front.
|
|
22
|
+
- **Your model is a Git repository** — schema, hooks and policies are files you review, diff and
|
|
23
|
+
revert; the engine commits every change for you, and PostgreSQL is a derived cache.
|
|
24
|
+
- **One agent, many users** — each MCP call carries the acting user's identity (on-behalf-of), and
|
|
25
|
+
the engine compiles a per-identity tool surface: a salesperson's agent sees only their own leads,
|
|
26
|
+
a finance agent cannot read sales notes. Prompt injection cannot bypass RBAC/RLS.
|
|
27
|
+
- **Bring your existing PostgreSQL** — point the engine at a live database and declare the tables
|
|
28
|
+
you want to expose; existing tables stay read-only unless you explicitly allow additive DDL, and
|
|
29
|
+
`weave introspect` can reverse-model them into `schema.json`.
|
|
30
|
+
- **Typed tools in minutes, not weeks** — hand-writing an MCP server (tools + permissions + audit)
|
|
31
|
+
for a few tables takes days; here it is a few `schema.json` files, and new fields or tables
|
|
32
|
+
extend the tool surface automatically.
|
|
33
|
+
- **More than MCP** — the same schema also drives REST and GraphQL APIs and generated TypeScript
|
|
34
|
+
types, so people and agents share one governed contract.
|
|
35
|
+
- **Self-hosted** — the engine runs in your environment; no data leaves your database.
|
|
36
|
+
|
|
37
|
+
## How it works
|
|
38
|
+
|
|
39
|
+
`weave` reads `objects/<name>/schema.json`, validates it, and syncs it to PostgreSQL (state-diff
|
|
40
|
+
migrations; existing tables stay read-only unless you allow additive DDL). The same metadata drives
|
|
41
|
+
the REST routes and the MCP tool surface, and the data-access layer enforces RBAC and audits every
|
|
42
|
+
write.
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- **Git-versioned metadata** — schema, hooks and policies are plain files in your repository; every
|
|
47
|
+
change is a scoped, atomic Git commit, so review, history and rollback come for free. PostgreSQL
|
|
48
|
+
stays a derived cache.
|
|
49
|
+
- **Schema as the source of truth** — `objects/<name>/schema.json` drives the tables, REST API and MCP
|
|
50
|
+
surface; state-diff migrations to PostgreSQL.
|
|
51
|
+
- **Custom field types** — register business-semantic types (`money`, `address`, …) as thin, namespaced
|
|
52
|
+
layers over a built-in primitive; they inherit storage, REST/MCP/OpenAPI schemas and generated
|
|
53
|
+
types. Declared in a project-local, Git-committed `field-types/` directory.
|
|
54
|
+
- **Named enums** — declare a shared enum once in `enums/` and reference it from any object by
|
|
55
|
+
`enumType`; every field shares one native PostgreSQL type and one set of per-value labels.
|
|
56
|
+
- **Governed REST API** — object CRUD with row-level (`all`/`own`/`department`) and field-level RBAC
|
|
57
|
+
and a uniform error contract.
|
|
58
|
+
- **MCP tool surface** — a streamable HTTP endpoint at `/mcp` with a per-identity tool surface and
|
|
59
|
+
guardrails.
|
|
60
|
+
- **GraphQL API** — an opt-in read/write GraphQL endpoint compiled from the same `schema.json`, with
|
|
61
|
+
nested relations, the same RBAC/audit, per-request batching and query hardening.
|
|
62
|
+
- **Schema revisions & atomic deploys** — `weave deploy plan` previews the diff; `weave deploy apply`
|
|
63
|
+
commits the DDL, the metadata cache and a global **schema revision** in one transaction (no
|
|
64
|
+
half-applied deploys).
|
|
65
|
+
- **Agent execution pipeline** — every write and tool call runs through one
|
|
66
|
+
Plan → Validate → Authorize → Guardrail → Approval → Execute → Commit → Evidence pipeline, so
|
|
67
|
+
guardrails and approvals cover REST, MCP and GraphQL alike; enable `evidence` to record a
|
|
68
|
+
`weavekit_evidence` row per execution (correlated by request / trace / schema revision).
|
|
69
|
+
- **Query budget** — bound a read/query across the engine: rows, filters and sorts in data-access,
|
|
70
|
+
joins / SQL length / statement timeout in restricted SQL, and GraphQL depth.
|
|
71
|
+
- **Multi-tenancy (row)** — mark a field `"tenant": true` and every read/write is scoped to the
|
|
72
|
+
subject's tenant (RBAC row scope + PostgreSQL RLS + audit); single-tenant by default.
|
|
73
|
+
- **Audit log** — an immutable event log for data mutations, with durability modes
|
|
74
|
+
(`best-effort` / `transactional` / `durable`) and a keyset-cursor query.
|
|
75
|
+
- **Observability** — a low-level metrics/trace seam (`MetricsSink` / `TraceSink`, `METRIC_NAMES`)
|
|
76
|
+
that emits request latency, RBAC denials, query-budget rejects and W3C `traceparent`-correlated
|
|
77
|
+
spans; the engine ships a no-op default and brings no backend.
|
|
78
|
+
- **Sandboxed hooks** — `*.server.js` lifecycle hooks running in isolated workers.
|
|
79
|
+
- **Type generation** — object-level TypeScript types derived from the schema.
|
|
80
|
+
- **Live events** — an SSE stream with replay.
|
|
81
|
+
- **Operations** — `weave doctor` preflight, health / readiness / version endpoints, request rate
|
|
82
|
+
limiting, CORS and structured logging.
|
|
83
|
+
|
|
84
|
+
## Requirements
|
|
85
|
+
|
|
86
|
+
- Node.js 22+
|
|
87
|
+
- PostgreSQL 12+ (the engine's tested floor; `weave doctor` reports the version)
|
|
88
|
+
|
|
89
|
+
## Quick start
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
npm create weavekit-app my-app -- --type=agent
|
|
93
|
+
cd my-app
|
|
94
|
+
cp .env.example .env # set DATABASE_URL
|
|
95
|
+
weave migrate # state-diff migration: schema.json → PostgreSQL tables (+ metadata cache)
|
|
96
|
+
weave dev # http://localhost:3000 — hot reload
|
|
97
|
+
weave types # object-level TS types → generated/types.ts
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Existing database?** Reverse-model it instead of authoring from scratch:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
weave introspect # live tables → objects/<table>/schema.json (read-only)
|
|
104
|
+
weave schema:map # schema field ↔ PostgreSQL column mapping + drift
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Connect an agent** (MCP is available at `/mcp`):
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
weave mcp:config # ready-to-paste config for Claude Code / Cursor / VS Code / Claude Desktop
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Documentation
|
|
114
|
+
|
|
115
|
+
Full documentation: **[docs.weavekit.io/engine](https://docs.weavekit.io/engine)**
|
|
116
|
+
|
|
117
|
+
- [Getting started](https://docs.weavekit.io/engine/guides/getting-started) — scaffold, migrate, run, consume
|
|
118
|
+
- [Git-versioned metadata](https://docs.weavekit.io/engine/guides/model/git-versioned-metadata) — your data model as reviewable Git commits
|
|
119
|
+
- [Schema guide](https://docs.weavekit.io/engine/guides/model/schema) · [RBAC](https://docs.weavekit.io/engine/guides/access/rbac) · [Multi-tenancy](https://docs.weavekit.io/engine/guides/access/multi-tenancy) · [Formulas](https://docs.weavekit.io/engine/guides/model/formulas) · [Audit](https://docs.weavekit.io/engine/guides/platform/audit)
|
|
120
|
+
- [CLI reference](https://docs.weavekit.io/engine/guides/platform/cli) · [Observability](https://docs.weavekit.io/engine/guides/platform/observability) · [MCP](https://docs.weavekit.io/engine/guides/agents/mcp) · [Execution & evidence](https://docs.weavekit.io/engine/guides/agents/execution-and-evidence) · [Script hooks](https://docs.weavekit.io/engine/guides/automation/script-hooks)
|
|
121
|
+
- [Custom tools & guardrails](https://docs.weavekit.io/engine/guides/agents/custom-tools-and-guardrails) · [Query budget](https://docs.weavekit.io/engine/guides/automation/query-budget) · [Custom field types](https://docs.weavekit.io/engine/reference/schema/custom-field-types) · [Quotas](https://docs.weavekit.io/engine/guides/automation/quotas) · [Inbound events](https://docs.weavekit.io/engine/guides/integration/ingress)
|
|
122
|
+
- [Public API & dependency budget](https://docs.weavekit.io/engine/reference/api/public-api) · [Enterprise seams](https://docs.weavekit.io/engine/reference/enterprise-seams) · [Contract freeze](https://docs.weavekit.io/engine/reference/contract-freeze)
|
|
123
|
+
- [Practices & operations](https://docs.weavekit.io/engine/practices/agent/existing-crm-to-mcp) · [Release checklist](https://docs.weavekit.io/engine/operations/release) — real integration and deployment walkthroughs
|
|
124
|
+
|
|
125
|
+
The Markdown sources live in [`docs/`](https://github.com/weavekit/engine/tree/main/docs).
|
|
126
|
+
|
|
127
|
+
## Programmatic use
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import { createEngine } from '@weave-kit/engine';
|
|
131
|
+
|
|
132
|
+
const engine = await createEngine({
|
|
133
|
+
databaseUrl: process.env.DATABASE_URL,
|
|
134
|
+
schemaDir: '.', // project root containing objects/
|
|
135
|
+
auth: { source: { 'sk-admin': { id: 'admin', roles: ['admin'] } } },
|
|
136
|
+
});
|
|
137
|
+
await engine.app.listen({ port: 3000 });
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Metadata
|
|
141
|
+
|
|
142
|
+
- **Objects** live in `objects/<name>/schema.json` (one directory per object; the directory name must
|
|
143
|
+
equal the object name).
|
|
144
|
+
- **`weavekit.config.ts`** is the single wiring point — a default export `satisfies EngineConfig`
|
|
145
|
+
(`schemaDir`, `auth`, `adapters`, `subsystems`).
|
|
146
|
+
- `schema.json` is versioned in Git and is the source of truth; the engine syncs it to PostgreSQL and
|
|
147
|
+
a metadata cache.
|
|
148
|
+
|
|
149
|
+
## CLI
|
|
150
|
+
|
|
151
|
+
| Command | Description |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| `weave migrate [--dry-run]` | State-diff migration + metadata cache + auto-commit |
|
|
154
|
+
| `weave deploy plan` / `weave deploy apply` | Preview / atomically apply schema changes and record a global schema revision |
|
|
155
|
+
| `weave doctor` | Read-only preflight (connection, PostgreSQL compatibility, drift, system tables, RLS + sandbox) |
|
|
156
|
+
| `weave dev [--port]` | Run with hot reload |
|
|
157
|
+
| `weave build` | Bundle the server entry (esbuild) |
|
|
158
|
+
| `weave test` | Proxy the project test suite |
|
|
159
|
+
| `weave types [--outdir]` | Compile `schema.json` into object-level TS types |
|
|
160
|
+
| `weave introspect` | Reverse-model an existing Postgres DB into `objects/*/schema.json` |
|
|
161
|
+
| `weave schema:map [object] [--drift]` | Report the schema field ↔ PostgreSQL column mapping |
|
|
162
|
+
| `weave schema:upgrade [--dry-run]` | Upgrade `objects/*/schema.json` to the current format version |
|
|
163
|
+
| `weave openapi [--out] [--generic] [--server]` | Emit an OpenAPI 3.1 document for the REST API |
|
|
164
|
+
| `weave graphql:schema [--out]` | Emit the GraphQL SDL for this project |
|
|
165
|
+
| `weave mcp:config [--host]` | Print MCP client config for this project's `/mcp` endpoint |
|
|
166
|
+
| `weave connect` | Connect a self-hosted engine out to a governance tunnel endpoint |
|
|
167
|
+
| `weave object:create <name>` | Scaffold `objects/<name>/schema.json` + `server.js` hooks |
|
|
168
|
+
| `weave field:add <object>` | Add a validated field to a schema |
|
|
169
|
+
| `weave field-type:list` | List built-in + registered field types |
|
|
170
|
+
| `weave field-type:check` | Validate registrations + schemas against the registry |
|
|
171
|
+
| `weave enum:list` | List declared named enums (`enums/<name>.json`) |
|
|
172
|
+
| `weave enum:check` | Validate enum declarations + schema references |
|
|
173
|
+
| `weave module:add` / `module:remove <name>` | Enable/disable an optional subsystem (audit/script/workflow) |
|
|
174
|
+
|
|
175
|
+
## Object-level types
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
weave types # → generated/types.ts
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
import type { Lead } from './generated/types';
|
|
183
|
+
import { createClient } from '@weave-kit/client';
|
|
184
|
+
|
|
185
|
+
const leads = createClient({ baseUrl, apiKey }).objects<Lead>('lead');
|
|
186
|
+
const { rows } = await leads.find({ filter: { status: 'open' } });
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Development
|
|
190
|
+
|
|
191
|
+
```sh
|
|
192
|
+
npm install
|
|
193
|
+
npm run build # tsc → dist
|
|
194
|
+
npm test # unit + e2e (e2e needs DATABASE_URL)
|
|
195
|
+
npm run test:coverage # coverage gate on security-critical paths
|
|
196
|
+
npm run typecheck
|
|
197
|
+
npm run lint
|
|
198
|
+
node scripts/check-exports.mjs # verify package exports + contract names
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Issues and pull requests are welcome. See [`AGENTS.md`](AGENTS.md) for architecture notes and
|
|
202
|
+
contribution invariants.
|
|
203
|
+
|
|
204
|
+
## Support
|
|
205
|
+
|
|
206
|
+
Questions, bug reports and security reports: **support@weavekit.io**.
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
[MIT](LICENSE) · For support, contact **support@weavekit.io**.
|
|
@@ -4,7 +4,7 @@ import { type AuthConfig, type Authenticator } from './source.js';
|
|
|
4
4
|
export type { Authenticator, AuthConfig, AuthResolver, AuthSource } from './source.js';
|
|
5
5
|
export { createAuth } from './source.js';
|
|
6
6
|
export type { AuthVerifier } from './verify.js';
|
|
7
|
-
export { createDirectoryAuthenticator, enforceSyncedIdentity, withDefaultTenant } from './subject.js';
|
|
7
|
+
export { createDirectoryAuthenticator, enforceSyncedIdentity, withDefaultTenant, withDefaultScope } from './subject.js';
|
|
8
8
|
/**
|
|
9
9
|
* Resolve the Authorization header into a subject, or throw a 401-family
|
|
10
10
|
* {@link SchemaError}. Missing header → `auth.missingKey`; present but
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9E,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9E,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAExH;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,CAAC,CAK1B;AAED,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAEpE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaError } from '../../core/index.js';
|
|
2
2
|
import { createAuth } from './source.js';
|
|
3
3
|
export { createAuth } from './source.js';
|
|
4
|
-
export { createDirectoryAuthenticator, enforceSyncedIdentity, withDefaultTenant } from './subject.js';
|
|
4
|
+
export { createDirectoryAuthenticator, enforceSyncedIdentity, withDefaultTenant, withDefaultScope } from './subject.js';
|
|
5
5
|
/**
|
|
6
6
|
* Resolve the Authorization header into a subject, or throw a 401-family
|
|
7
7
|
* {@link SchemaError}. Missing header → `auth.missingKey`; present but
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAuC,MAAM,aAAa,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAuC,MAAM,aAAa,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAExH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,aAA4B,EAC5B,MAA0B,EAC1B,MAAc;IAEd,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS;QAAE,MAAM,IAAI,WAAW,CAAC,iBAAiB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAC/E,MAAM,IAAI,WAAW,CAAC,iBAAiB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,kBAAkB,CAAC,MAAkB;IACnD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -25,4 +25,10 @@ export declare function enforceSyncedIdentity(inner: Authenticator, directory: I
|
|
|
25
25
|
* deployments). A subject that already carries a tenant is left untouched.
|
|
26
26
|
*/
|
|
27
27
|
export declare function withDefaultTenant(inner: Authenticator, defaultTenant: string): Authenticator;
|
|
28
|
+
/**
|
|
29
|
+
* Generic scope stamping (the `scope` twin of {@link withDefaultTenant}): a
|
|
30
|
+
* subject without a scope is stamped with the configured default scope. A
|
|
31
|
+
* subject that already carries `scopeId`/`tenantId` is left untouched.
|
|
32
|
+
*/
|
|
33
|
+
export declare function withDefaultScope(inner: Authenticator, defaultScope: string): Authenticator;
|
|
28
34
|
//# sourceMappingURL=subject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/subject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,uCAAuC,CAAC;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IACpD,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,aAAa,CAahB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,GACb,aAAa,CAYf;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAQ5F"}
|
|
1
|
+
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../../../src/adapters/auth/subject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,uCAAuC,CAAC;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IACpD,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,aAAa,CAahB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,GACb,aAAa,CAYf;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAQ5F;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAQ1F"}
|
|
@@ -48,10 +48,25 @@ export function withDefaultTenant(inner, defaultTenant) {
|
|
|
48
48
|
return {
|
|
49
49
|
async resolve(header) {
|
|
50
50
|
const subject = await inner.resolve(header);
|
|
51
|
-
if (subject === null || subject.tenantId !== undefined)
|
|
51
|
+
if (subject === null || subject.scopeId !== undefined || subject.tenantId !== undefined)
|
|
52
52
|
return subject;
|
|
53
53
|
return { ...subject, tenantId: defaultTenant };
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Generic scope stamping (the `scope` twin of {@link withDefaultTenant}): a
|
|
59
|
+
* subject without a scope is stamped with the configured default scope. A
|
|
60
|
+
* subject that already carries `scopeId`/`tenantId` is left untouched.
|
|
61
|
+
*/
|
|
62
|
+
export function withDefaultScope(inner, defaultScope) {
|
|
63
|
+
return {
|
|
64
|
+
async resolve(header) {
|
|
65
|
+
const subject = await inner.resolve(header);
|
|
66
|
+
if (subject === null || subject.scopeId !== undefined || subject.tenantId !== undefined)
|
|
67
|
+
return subject;
|
|
68
|
+
return { ...subject, scopeId: defaultScope };
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
57
72
|
//# sourceMappingURL=subject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subject.js","sourceRoot":"","sources":["../../../src/adapters/auth/subject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKlD;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAI5C;IACC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAChD,OAAO;QACL,KAAK,CAAC,OAAO,CAAC,MAA0B;YACtC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC/C,IAAI,QAAQ,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC;YACnC,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;YACvE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,MAAM,IAAI,WAAW,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;YAC7E,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC;AAED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D9G"}
|
|
@@ -16,8 +16,10 @@ function passesFilter(event, subject, readable, isAdmin) {
|
|
|
16
16
|
return true;
|
|
17
17
|
if (payload.event.actorId !== subject.id)
|
|
18
18
|
return false;
|
|
19
|
-
//
|
|
20
|
-
|
|
19
|
+
// row-scope boundary: a scoped identity never sees another scope's events
|
|
20
|
+
const eventScope = payload.event.scopeId ?? payload.event.tenantId;
|
|
21
|
+
const subjectScope = subject.scopeId ?? subject.tenantId;
|
|
22
|
+
return subjectScope === undefined || eventScope === undefined || eventScope === subjectScope;
|
|
21
23
|
}
|
|
22
24
|
default:
|
|
23
25
|
return true; // schema.changed — broadcast
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/events/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AASzE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAkB,MAAM,aAAa,CAAC;AAwC9D,SAAS,YAAY,CAAC,KAAkB,EAAE,OAAwB,EAAE,QAAqB,EAAE,OAAgB;IACzG,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,WAAW,CAAC,cAAc,CAAC;QAChC,KAAK,WAAW,CAAC,cAAc,CAAC;QAChC,KAAK,WAAW,CAAC,cAAc,CAAC;QAChC,KAAK,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACrC,MAAM,OAAO,GAAG,KAAK,CAAC,OAA6B,CAAC;YACpD,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACtC,CAAC;QACD,KAAK,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;YAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAA4B,CAAC;YACnD,IAAI,OAAO;gBAAE,OAAO,IAAI,CAAC;YACzB,IAAI,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AAE,CAAC;gBACrB,wEAAwE;gBACxE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,EAAE;oBAC1C,IAAI,EAAE,WAAW,CAAC,cAAc;oBAChC,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE;iBAC7C,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/adapters/rest/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAuBzD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/adapters/rest/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAuBzD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI,CAyDzG"}
|