cedar-mcp-server 1.0.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/.editorconfig +12 -0
- package/.github/workflows/ci.yml +31 -0
- package/.github/workflows/release.yml +42 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +241 -0
- package/CONTRIBUTING.md +83 -0
- package/LICENSE +182 -0
- package/README.md +1635 -0
- package/SECURITY.md +37 -0
- package/dist/http-server.d.ts +61 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +194 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +270 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/policy-ast.d.ts +49 -0
- package/dist/parser/policy-ast.d.ts.map +1 -0
- package/dist/parser/policy-ast.js +311 -0
- package/dist/parser/policy-ast.js.map +1 -0
- package/dist/prompts/index.d.ts +38 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +172 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/ref-resolver.d.ts +23 -0
- package/dist/resources/ref-resolver.d.ts.map +1 -0
- package/dist/resources/ref-resolver.js +128 -0
- package/dist/resources/ref-resolver.js.map +1 -0
- package/dist/resources/store-manager.d.ts +64 -0
- package/dist/resources/store-manager.d.ts.map +1 -0
- package/dist/resources/store-manager.js +221 -0
- package/dist/resources/store-manager.js.map +1 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +539 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/advise/avp-rules.d.ts +49 -0
- package/dist/tools/advise/avp-rules.d.ts.map +1 -0
- package/dist/tools/advise/avp-rules.js +59 -0
- package/dist/tools/advise/avp-rules.js.map +1 -0
- package/dist/tools/advise/cedar-patterns.d.ts +24 -0
- package/dist/tools/advise/cedar-patterns.d.ts.map +1 -0
- package/dist/tools/advise/cedar-patterns.js +57 -0
- package/dist/tools/advise/cedar-patterns.js.map +1 -0
- package/dist/tools/advise/context-builder.d.ts +28 -0
- package/dist/tools/advise/context-builder.d.ts.map +1 -0
- package/dist/tools/advise/context-builder.js +89 -0
- package/dist/tools/advise/context-builder.js.map +1 -0
- package/dist/tools/advise/gotchas.d.ts +15 -0
- package/dist/tools/advise/gotchas.d.ts.map +1 -0
- package/dist/tools/advise/gotchas.js +83 -0
- package/dist/tools/advise/gotchas.js.map +1 -0
- package/dist/tools/advise.d.ts +96 -0
- package/dist/tools/advise.d.ts.map +1 -0
- package/dist/tools/advise.js +258 -0
- package/dist/tools/advise.js.map +1 -0
- package/dist/tools/authorize-batch.d.ts +35 -0
- package/dist/tools/authorize-batch.d.ts.map +1 -0
- package/dist/tools/authorize-batch.js +262 -0
- package/dist/tools/authorize-batch.js.map +1 -0
- package/dist/tools/authorize.d.ts +115 -0
- package/dist/tools/authorize.d.ts.map +1 -0
- package/dist/tools/authorize.js +373 -0
- package/dist/tools/authorize.js.map +1 -0
- package/dist/tools/check-change.d.ts +19 -0
- package/dist/tools/check-change.d.ts.map +1 -0
- package/dist/tools/check-change.js +91 -0
- package/dist/tools/check-change.js.map +1 -0
- package/dist/tools/diff-schema.d.ts +103 -0
- package/dist/tools/diff-schema.d.ts.map +1 -0
- package/dist/tools/diff-schema.js +379 -0
- package/dist/tools/diff-schema.js.map +1 -0
- package/dist/tools/diff-stores.d.ts +45 -0
- package/dist/tools/diff-stores.d.ts.map +1 -0
- package/dist/tools/diff-stores.js +222 -0
- package/dist/tools/diff-stores.js.map +1 -0
- package/dist/tools/explain.d.ts +80 -0
- package/dist/tools/explain.d.ts.map +1 -0
- package/dist/tools/explain.js +187 -0
- package/dist/tools/explain.js.map +1 -0
- package/dist/tools/format.d.ts +11 -0
- package/dist/tools/format.d.ts.map +1 -0
- package/dist/tools/format.js +20 -0
- package/dist/tools/format.js.map +1 -0
- package/dist/tools/generate-sample.d.ts +28 -0
- package/dist/tools/generate-sample.d.ts.map +1 -0
- package/dist/tools/generate-sample.js +568 -0
- package/dist/tools/generate-sample.js.map +1 -0
- package/dist/tools/link-template.d.ts +17 -0
- package/dist/tools/link-template.d.ts.map +1 -0
- package/dist/tools/link-template.js +78 -0
- package/dist/tools/link-template.js.map +1 -0
- package/dist/tools/list-template-links.d.ts +16 -0
- package/dist/tools/list-template-links.d.ts.map +1 -0
- package/dist/tools/list-template-links.js +22 -0
- package/dist/tools/list-template-links.js.map +1 -0
- package/dist/tools/list-templates.d.ts +16 -0
- package/dist/tools/list-templates.d.ts.map +1 -0
- package/dist/tools/list-templates.js +36 -0
- package/dist/tools/list-templates.js.map +1 -0
- package/dist/tools/translate.d.ts +11 -0
- package/dist/tools/translate.d.ts.map +1 -0
- package/dist/tools/translate.js +53 -0
- package/dist/tools/translate.js.map +1 -0
- package/dist/tools/validate-entities.d.ts +19 -0
- package/dist/tools/validate-entities.d.ts.map +1 -0
- package/dist/tools/validate-entities.js +88 -0
- package/dist/tools/validate-entities.js.map +1 -0
- package/dist/tools/validate-schema.d.ts +22 -0
- package/dist/tools/validate-schema.d.ts.map +1 -0
- package/dist/tools/validate-schema.js +89 -0
- package/dist/tools/validate-schema.js.map +1 -0
- package/dist/tools/validate-template.d.ts +18 -0
- package/dist/tools/validate-template.d.ts.map +1 -0
- package/dist/tools/validate-template.js +59 -0
- package/dist/tools/validate-template.js.map +1 -0
- package/dist/tools/validate.d.ts +90 -0
- package/dist/tools/validate.d.ts.map +1 -0
- package/dist/tools/validate.js +351 -0
- package/dist/tools/validate.js.map +1 -0
- package/dist/utils/format-detector.d.ts +49 -0
- package/dist/utils/format-detector.d.ts.map +1 -0
- package/dist/utils/format-detector.js +298 -0
- package/dist/utils/format-detector.js.map +1 -0
- package/examples/README.md +36 -0
- package/examples/abac-multi-tenant/README.md +150 -0
- package/examples/abac-multi-tenant/entities/users-and-docs.json +33 -0
- package/examples/abac-multi-tenant/policies/member-read-internal.cedar +9 -0
- package/examples/abac-multi-tenant/policies/owner-full-access.cedar +9 -0
- package/examples/abac-multi-tenant/policies/premium-share-guard.cedar +9 -0
- package/examples/abac-multi-tenant/policies/private-doc-guard.cedar +13 -0
- package/examples/abac-multi-tenant/run.ts +92 -0
- package/examples/abac-multi-tenant/schema.json +60 -0
- package/examples/api-gateway-path-routing/README.md +154 -0
- package/examples/api-gateway-path-routing/entities/users-and-roles.json +20 -0
- package/examples/api-gateway-path-routing/policies/admin-full-access.cedar +6 -0
- package/examples/api-gateway-path-routing/policies/developer-projects.cedar +14 -0
- package/examples/api-gateway-path-routing/policies/viewer-readonly.cedar +10 -0
- package/examples/api-gateway-path-routing/run.ts +108 -0
- package/examples/api-gateway-path-routing/schema.json +54 -0
- package/examples/rbac-document-management/README.md +167 -0
- package/examples/rbac-document-management/entities/users-and-docs.json +43 -0
- package/examples/rbac-document-management/policies/admin.cedar +6 -0
- package/examples/rbac-document-management/policies/editor.cedar +6 -0
- package/examples/rbac-document-management/policies/top-secret-forbid.cedar +13 -0
- package/examples/rbac-document-management/policies/viewer.cedar +6 -0
- package/examples/rbac-document-management/run.ts +87 -0
- package/examples/rbac-document-management/schema.json +57 -0
- package/package.json +50 -0
- package/src/http-server.ts +239 -0
- package/src/index.ts +294 -0
- package/src/parser/policy-ast.ts +345 -0
- package/src/prompts/README.md +3 -0
- package/src/prompts/index.ts +217 -0
- package/src/resources/ref-resolver.ts +134 -0
- package/src/resources/store-manager.ts +248 -0
- package/src/server.ts +711 -0
- package/src/tools/advise/avp-rules.ts +70 -0
- package/src/tools/advise/cedar-patterns.ts +73 -0
- package/src/tools/advise/context-builder.ts +109 -0
- package/src/tools/advise/gotchas.ts +92 -0
- package/src/tools/advise.ts +366 -0
- package/src/tools/authorize-batch.ts +345 -0
- package/src/tools/authorize.ts +464 -0
- package/src/tools/check-change.ts +119 -0
- package/src/tools/diff-schema.ts +510 -0
- package/src/tools/diff-stores.ts +298 -0
- package/src/tools/explain.ts +278 -0
- package/src/tools/format.ts +33 -0
- package/src/tools/generate-sample.ts +665 -0
- package/src/tools/link-template.ts +109 -0
- package/src/tools/list-template-links.ts +41 -0
- package/src/tools/list-templates.ts +55 -0
- package/src/tools/translate.ts +66 -0
- package/src/tools/validate-entities.ts +125 -0
- package/src/tools/validate-schema.ts +128 -0
- package/src/tools/validate-template.ts +72 -0
- package/src/tools/validate.ts +459 -0
- package/src/utils/format-detector.ts +356 -0
- package/test/fixtures/docmgmt.ts +121 -0
- package/test/fixtures/multitenant.ts +163 -0
- package/test/index.test.ts +96 -0
- package/test/integration/e2e/behavior.test.ts +359 -0
- package/test/integration/e2e/edge-cases.test.ts +365 -0
- package/test/integration/e2e/failure-modes.test.ts +266 -0
- package/test/integration/e2e/protocol.test.ts +252 -0
- package/test/integration/http-smoke.test.ts +588 -0
- package/test/integration/smoke.test.ts +475 -0
- package/test/prompts/prompts.test.ts +173 -0
- package/test/property/properties.test.ts +234 -0
- package/test/resources/ref-resolver.test.ts +186 -0
- package/test/resources/store-manager.test.ts +344 -0
- package/test/setup.test.ts +7 -0
- package/test/tools/advise/avp-rules.test.ts +76 -0
- package/test/tools/advise.test.ts +339 -0
- package/test/tools/authorize-batch.test.ts +459 -0
- package/test/tools/authorize.test.ts +682 -0
- package/test/tools/check-change.test.ts +104 -0
- package/test/tools/cross-fixture.test.ts +170 -0
- package/test/tools/diff-schema.test.ts +355 -0
- package/test/tools/diff-stores.test.ts +291 -0
- package/test/tools/explain.test.ts +221 -0
- package/test/tools/format.test.ts +33 -0
- package/test/tools/generate-sample.test.ts +480 -0
- package/test/tools/link-template.test.ts +90 -0
- package/test/tools/list-templates.test.ts +151 -0
- package/test/tools/translate.test.ts +89 -0
- package/test/tools/validate-entities.test.ts +178 -0
- package/test/tools/validate-schema.test.ts +86 -0
- package/test/tools/validate-template.test.ts +89 -0
- package/test/tools/validate.test.ts +331 -0
- package/test/utils/format-detector.test.ts +518 -0
- package/tsconfig.json +17 -0
- package/vitest.config.ts +13 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout
|
|
13
|
+
uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Setup Node
|
|
16
|
+
uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version-file: .nvmrc
|
|
19
|
+
cache: npm
|
|
20
|
+
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: npm ci
|
|
23
|
+
|
|
24
|
+
- name: Build (typecheck)
|
|
25
|
+
run: npm run build
|
|
26
|
+
|
|
27
|
+
- name: Unit tests
|
|
28
|
+
run: npm test
|
|
29
|
+
|
|
30
|
+
- name: Integration tests
|
|
31
|
+
run: npm run test:integration
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
|
|
20
|
+
- name: Setup Node
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version-file: .nvmrc
|
|
24
|
+
cache: npm
|
|
25
|
+
registry-url: "https://registry.npmjs.org"
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: npm ci
|
|
29
|
+
|
|
30
|
+
- name: Build
|
|
31
|
+
run: npm run build
|
|
32
|
+
|
|
33
|
+
- name: Unit tests
|
|
34
|
+
run: npm test
|
|
35
|
+
|
|
36
|
+
- name: Integration tests
|
|
37
|
+
run: npm run test:integration
|
|
38
|
+
|
|
39
|
+
- name: Publish to npm
|
|
40
|
+
run: npm publish --access public --provenance
|
|
41
|
+
env:
|
|
42
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
25
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `cedar-mcp-server` are documented here.
|
|
4
|
+
|
|
5
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project uses [SemVer](https://semver.org/) from v1.0.0 onward. The `0.x` line is pre-release; breaking changes can happen between `0.x` releases.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
(No unreleased changes yet.)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## [1.0.0] — 2026-05-22
|
|
16
|
+
|
|
17
|
+
First published release. Twelve months of design + implementation + multi-round dogfood discipline now under SemVer. The 1.0.0 surface is 17 MCP tools, 8 MCP resource templates, 3 MCP prompts, plus a CLI entry that runs stdio (default) or Streamable HTTP.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
#### `cedar_advise`: structured context bundle, not a sampling round-trip
|
|
22
|
+
|
|
23
|
+
- `cedar_advise` returns a deterministic context bundle (schema summary, AST-classified policy inventory, intent-selected gotcha catalog, AVP `UpdatePolicy` mutability rules, Cedar patterns reference, sequencing guidance, next-steps text). The calling assistant produces the plan from the bundle. No MCP sampling capability required; no client LLM round-trip on the server side.
|
|
24
|
+
- Auto-resolves to the single loaded store when `store_ref` is omitted (`auto_discovered.store_from: "single_loaded_store"`). With multiple stores loaded and no `store_ref`, returns `store_status: "ambiguous"` plus `available_stores` so the calling LLM can recover. Schemaless single-store cases degrade to `store_status: "not_provided"` rather than self-referential `not_found`.
|
|
25
|
+
|
|
26
|
+
#### Stable policy IDs in `determining_policies`
|
|
27
|
+
|
|
28
|
+
- Three-tier resolution: `@id("name")` annotation → file basename (when policies loaded via `cedar://policies/{store}` ref) → positional `policy<index>` fallback.
|
|
29
|
+
- Applied to both `cedar_authorize` and `cedar_authorize_batch`; the two return identical ID shapes for the same policy set.
|
|
30
|
+
- `cedar_authorize` also returns `decision_reason` with four explicit values: `permit_policy_fired`, `forbid_policy_fired`, `default_deny_no_permit_matched`, `evaluation_error`.
|
|
31
|
+
|
|
32
|
+
#### Parser feedback and source locations
|
|
33
|
+
|
|
34
|
+
- `cedar_validate` returns `line` and `column` (1-indexed) on every parse error, derived from the WASM source location and correctly accounting for multi-byte UTF-8 chars.
|
|
35
|
+
- A 17-entry typo table populates the `hint` field for common misspellings (`int`/`in`, `prinicpal`/`principal`, `permint`/`permit`, `wen`/`when`, etc.); falls back to Cedar's own diagnostic help when no entry matches; `null` otherwise.
|
|
36
|
+
|
|
37
|
+
#### Two-mode `cedar_validate`
|
|
38
|
+
|
|
39
|
+
- Syntax-only mode (no schema): runs the parser alone. Useful for typo / scope sanity checks.
|
|
40
|
+
- Syntax-and-schema mode (schema supplied or auto-discovered): adds attribute typing, action applicability, `UnsafeOptionalAttributeAccess` warnings.
|
|
41
|
+
- Explicit `validation_mode: "auto" | "syntax_only" | "syntax_and_schema"` parameter forces a specific mode (default `"auto"`).
|
|
42
|
+
|
|
43
|
+
#### Workspace auto-discovery for stdio
|
|
44
|
+
|
|
45
|
+
- When stdio launches in a directory that looks like a Cedar policy store (`schema.cedarschema`, `schema.json`, or a `policies/` subdirectory), the server loads the cwd **synchronously before the transport accepts client requests**. By the time the first `resources/list` arrives, the store is already populated.
|
|
46
|
+
- `cedar_validate`, `cedar_authorize`, `cedar_explain` consult the loaded store when their required inputs are omitted; the response's `auto_discovered.*_from` fields name which store satisfied each missing input.
|
|
47
|
+
- Multi-store deployments surface an `ambiguous` error listing candidate names; pass `store: "<name>"` to disambiguate.
|
|
48
|
+
- Security guard: refuses to load roots whose normalized path is empty (`file:///`), preventing the `isPathAllowed` `startsWith("")` bypass that would otherwise grant access to every filesystem path.
|
|
49
|
+
|
|
50
|
+
#### `cedar_authorize_batch`: decision matrix over a shared policy set
|
|
51
|
+
|
|
52
|
+
- Runs N authorization requests through one policy set in a single call. Returns total / allowed / denied / errored counts plus a per-request decision array with `determining_policies` (basenames, same H1 resolution as `cedar_authorize`). Schema-violating requests resolve to `decision: "Error"` when `schema + validateRequest` is in play.
|
|
53
|
+
|
|
54
|
+
#### Template operations
|
|
55
|
+
|
|
56
|
+
- `cedar_validate_template`: validates a Cedar policy template against a schema; supports cedarschema and JSON forms.
|
|
57
|
+
- `cedar_link_template`: links a template to a concrete principal and resource, producing a template-linked policy.
|
|
58
|
+
- `cedar_list_templates` / `cedar_list_template_links`: lists templates and links in a store; per-item read errors surface as structured errors rather than throwing.
|
|
59
|
+
- `StoreManager` extended with `listTemplates`, `readTemplate`, `listTemplateLinks`, `readTemplateLink`.
|
|
60
|
+
- New MCP Resources: `cedar://templates/{store}`, `cedar://templates/{store}/{id}`, `cedar://template-links/{store}`, `cedar://template-links/{store}/{id}`.
|
|
61
|
+
|
|
62
|
+
#### Schema and entity standalone operations
|
|
63
|
+
|
|
64
|
+
- `cedar_validate_schema`: standalone schema validation, JSON or cedarschema text. Returns validity flag, format, namespace list, entity/action/common-type counts, errors with source locations.
|
|
65
|
+
- `cedar_diff_schema`: structural schema diff with AVP-aware risk classification per change (`safe` / `review` / `breaking`) plus a top-level `risk_level`. Accepts inline schema text or `cedar://schema/{store}` URIs.
|
|
66
|
+
- `cedar_validate_entities`: validates an entity store against a schema; classifies errors by kind (`unknown_type`, `missing_required_attribute`, `type_mismatch`, `unknown_attribute`, `disallowed_parent_type`, `parse_error`, `other`).
|
|
67
|
+
|
|
68
|
+
#### `cedar_generate_sample_request`
|
|
69
|
+
|
|
70
|
+
- Generates a complete authorization request payload (principal, action, resource, entities) that produces a target Allow / Deny decision against a given policy and schema.
|
|
71
|
+
- Pre-fills required entity attributes from the schema (Cedar's `required: true` default for JSON-schema attributes).
|
|
72
|
+
- Verifies the generated payload against `cedar_authorize` with `validateRequest: true`; `ready_to_test: true` confirms a follow-up call with these exact inputs reproduces the documented decision. Schema-mismatched payloads return `ready_to_test: false` with an actionable error.
|
|
73
|
+
- Single-prefix entity refs (`MyApp::User::"alice"`) regardless of whether the schema was supplied as `.cedarschema` text or as JSON.
|
|
74
|
+
|
|
75
|
+
#### Streamable HTTP mode
|
|
76
|
+
|
|
77
|
+
- New transport for shared team deployment. CLI: `cedar-mcp-server --http <port> [--host <host>] [--root name=path]...`. Stdio remains the default.
|
|
78
|
+
- Per-session `McpServer` + transport pair with stateful `Mcp-Session-Id` routing.
|
|
79
|
+
- Shared `storeManager` across HTTP sessions; deployment model is "one server per policy-store set." Deployer-configured roots via repeatable `--root` flags.
|
|
80
|
+
- Security: localhost default-binding with DNS rebinding protection. Non-localhost binding (`--host 0.0.0.0`) is the deployer's responsibility (auth via reverse proxy).
|
|
81
|
+
- Max-sessions cap (default 100, configurable via `CEDAR_MAX_HTTP_SESSIONS`) returns HTTP 503 when reached.
|
|
82
|
+
- Idle-session TTL (default 30 min, configurable via `CEDAR_HTTP_SESSION_IDLE_TTL_MS`) with a periodic reaper.
|
|
83
|
+
- `/health` endpoint returns `{ status, transport, mode, active_sessions, max_sessions, session_idle_ttl_ms }`.
|
|
84
|
+
|
|
85
|
+
#### `cedar://` resources end-to-end
|
|
86
|
+
|
|
87
|
+
- Each `ResourceTemplate` carries a `list:` callback so MCP clients can enumerate via `resources/list` rather than guessing URIs. Eight resource templates registered.
|
|
88
|
+
- `notifications/resources/list_changed` emitted after every store reconciliation pass so cache-aware clients can refetch on root changes.
|
|
89
|
+
- `ref-resolver.ts` resolves `cedar://policies/{store}`, `cedar://schema/{store}`, `cedar://entities/{store}` (and per-id variants), `cedar://templates/{store}`, `cedar://template-links/{store}`.
|
|
90
|
+
- `cedar_authorize` / `cedar_authorize_batch` / `cedar_explain` / `cedar_validate` accept the matching `_ref` parameters.
|
|
91
|
+
|
|
92
|
+
#### MCP Prompts
|
|
93
|
+
|
|
94
|
+
- `cedar-review-policy-diff`: drives `cedar_diff_policy_stores` + `cedar_diff_schema`, summarizes risk, advises on promotion.
|
|
95
|
+
- `cedar-explain-denial`: runs `cedar_authorize` via `cedar://` refs + `cedar_explain` on the deciding policies; produces a plain-English explanation.
|
|
96
|
+
- `cedar-avp-migration-checklist`: guided checklist for AVP migration; optional `namespace` argument substitutes the placeholder.
|
|
97
|
+
|
|
98
|
+
#### Server instructions and discoverability
|
|
99
|
+
|
|
100
|
+
- `SERVER_INSTRUCTIONS` returned on `initialize`: a routing table that directs the MCP client to call `cedar_*` tools rather than `Read`/`Bash` on policy files, plus the workspace-auto-discovery directive. Truncated to fit under Claude Code's 2KB instructions budget.
|
|
101
|
+
|
|
102
|
+
### Changed (relative to the development 0.0.1 milestone)
|
|
103
|
+
|
|
104
|
+
- `cedar_advise`: replaced the sampling-based design with the deterministic context bundle described above. The old `previous_plan` delta-output API is gone with it; the calling assistant iterates the plan in conversation.
|
|
105
|
+
- `cedar_diff_policy_stores`: `schema_diff` field is now a structured `SchemaDiff` object (with per-change risk classification) replacing the previous `schema_changed: boolean` + `schema_diff_note: string` fields.
|
|
106
|
+
|
|
107
|
+
### Fixed (relative to the development 0.0.1 milestone)
|
|
108
|
+
|
|
109
|
+
- `cedar_validate`: line / column derivation correctly counts Unicode code points (not UTF-16 code units), so non-ASCII characters before the error site no longer drift the reported column.
|
|
110
|
+
- `cedar_validate_entities`: removed the incorrect `orphan_parent` error kind (no such Cedar concept); `disallowed_parent_type` now recognized rather than collapsing to `error_kind: "other"`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## [0.0.1] — 2026-05-20
|
|
115
|
+
|
|
116
|
+
Development milestone. Internal-only; never published to npm. Documents the four implementation phases (cedar_validate / cedar_authorize / cedar_format / cedar_translate; cedar_explain / cedar_check_policy_change / cedar_generate_sample_request; MCP Roots and Resources; cedar_advise via MCP sampling). Detailed feature breakdown below for historical reference; v1.0.0 above is the canonical surface.
|
|
117
|
+
|
|
118
|
+
### Phase 4 — Planning: `cedar_advise`
|
|
119
|
+
|
|
120
|
+
- `cedar_advise`: translates natural-language intent into a step-by-step Cedar policy change plan via MCP sampling. Server builds deterministic context (schema, policy inventory with patterns and Cedar text, selected gotchas, AVP rules summary); LLM produces intent interpretation, applicable Cedar pattern, ordered change steps with Cedar snippets, AVP deployment classification, and verification steps.
|
|
121
|
+
- Iterative refinement via `previous_plan`: passing a previous result triggers delta output (unchanged/modified/added/removed steps).
|
|
122
|
+
- Supporting modules: `avp-rules.ts` (10 AVP validation error categories, UpdatePolicy mutability map), `cedar-patterns.ts` (AST-based policy classifier), `gotchas.ts` (10-entry gotcha catalog with keyword-based selection), `context-builder.ts` (walks policy store files for prompt context).
|
|
123
|
+
- `postProcess()` enforces deterministic corrections: `policy_new` always maps to `new_policy_via_create_policy`, `policy_delete` always maps to `requires_delete_recreate`, schema-before-policy ordering violations surface as a gotcha.
|
|
124
|
+
|
|
125
|
+
(This sampling-based design was replaced in v1.0.0 by the deterministic context bundle. See the v1.0.0 entry above.)
|
|
126
|
+
|
|
127
|
+
### Phase 3 — Roots, Resources, Diffing
|
|
128
|
+
|
|
129
|
+
- MCP Roots integration: loads policy stores on server init, reloads on `RootsListChangedNotification`.
|
|
130
|
+
- `StoreManager`: maps `file://` root URIs to named stores; reads `.cedar` policy files from `policies/` subdirectory; reads `schema.cedarschema` or `schema.json`. Security: validates policy IDs against `^[a-zA-Z0-9_-]+$` (no path traversal); rejects non-`file://` URIs.
|
|
131
|
+
- `cedar://` MCP Resources: `cedar://policies/{store}`, `cedar://policies/{store}/{id}`, `cedar://schema/{store}`.
|
|
132
|
+
- `policy_ref` and `schema_ref` parameters on `cedar_validate`, `cedar_authorize`, and `cedar_explain`: accept `cedar://` URIs as alternatives to inline text.
|
|
133
|
+
- `cedar_diff_policy_stores`: structural diff (added/removed/modified policies with AVP immutability classification per change), schema diff, optional behavioral diff (runs authorization requests through both stores and surfaces decision drift).
|
|
134
|
+
|
|
135
|
+
### Phase 2 — Planning and Understanding
|
|
136
|
+
|
|
137
|
+
- `cedar_explain`: explains a Cedar policy in plain English with pattern detection. Supports templates via `templateToJson` fallback.
|
|
138
|
+
- `cedar_check_policy_change`: determines whether a policy modification can be applied in-place in AVP or requires delete-and-recreate. Uses AST comparison against AVP UpdatePolicy immutability rules.
|
|
139
|
+
- `cedar_generate_sample_request`: generates a complete authorization request payload (principal, action, resource, entities) that produces a target decision against a given policy. Verifies the generated payload against `cedar_authorize`.
|
|
140
|
+
|
|
141
|
+
### Phase 1 — Validation and Evaluation
|
|
142
|
+
|
|
143
|
+
- `cedar_validate`: validates Cedar policies against a schema using `@cedar-policy/cedar-wasm`. Returns errors with hints and source locations.
|
|
144
|
+
- `cedar_authorize`: evaluates an authorization request locally. Auto-detects and converts all three AVP SDK entity formats (snake_case Ruby, camelCase Python/JS, PascalCase official API). Unwraps typed attribute wrappers and entity reference wrappers recursively.
|
|
145
|
+
- `cedar_format`: formats Cedar policy text to canonical style.
|
|
146
|
+
- `cedar_translate`: translates between Cedar text and JSON formats for policies and schemas.
|
|
147
|
+
|
|
148
|
+
### Original [Unreleased] block (pre-v1.0.0, kept for archaeological reference)
|
|
149
|
+
|
|
150
|
+
The features below were originally batched under `[Unreleased]` during the v0.x development line; all of them shipped as part of v1.0.0 above.
|
|
151
|
+
|
|
152
|
+
#### Template operations (Batch A)
|
|
153
|
+
- `cedar_validate_template`: validates a Cedar policy template (static template text) against a schema; supports both cedarschema and JSON schema formats.
|
|
154
|
+
- `cedar_link_template`: links a policy template to a concrete principal and resource, producing a template-linked policy in the store.
|
|
155
|
+
- `cedar_list_templates`: lists all policy templates in a store; per-item read errors surface as structured errors rather than throwing.
|
|
156
|
+
- `cedar_list_template_links`: lists all template-linked policies in a store; per-item read errors surface as structured errors rather than throwing.
|
|
157
|
+
- `StoreManager` extended with `listTemplates`, `readTemplate`, `listTemplateLinks`, and `readTemplateLink` methods.
|
|
158
|
+
- New MCP Resources: `cedar://templates/{store}`, `cedar://templates/{store}/{id}`, `cedar://template-links/{store}`, `cedar://template-links/{store}/{id}`.
|
|
159
|
+
- `SECURITY.md` added to the repository.
|
|
160
|
+
|
|
161
|
+
#### Schema and entity standalone operations (Batch B)
|
|
162
|
+
- `cedar_validate_schema`: standalone schema validation accepting JSON or cedarschema text; returns validity flag, detected format, namespace list, entity/action counts, and errors with source locations.
|
|
163
|
+
- `cedar_diff_schema`: structural schema diff with AVP-aware risk classification; each change is classified as `safe`, `review`, or `breaking` with a reason; accepts inline schema text or `cedar://schema/{store}` URIs.
|
|
164
|
+
- `cedar_validate_entities`: validates an entity store against a schema; classifies errors by kind (`unknown_type`, `missing_required_attribute`, `type_mismatch`, `unknown_attribute`, `disallowed_parent_type`, `parse_error`, `other`).
|
|
165
|
+
|
|
166
|
+
#### Batch authorization (Batch C)
|
|
167
|
+
- `cedar_authorize_batch`: runs N authorization requests through one policy set and returns the decision matrix (total/allowed/denied/errored counts plus per-request decision array with `determining_policies` from WASM `diagnostics.reason`). Schema-violating requests resolve to `decision: "Error"` when `schema + validateRequest` is in play; without schema, the same request is silently evaluated.
|
|
168
|
+
|
|
169
|
+
#### MCP Prompts (Batch D)
|
|
170
|
+
- `cedar-review-policy-diff`: drives `cedar_diff_policy_stores` + `cedar_diff_schema`, summarizes risk, advises on promotion.
|
|
171
|
+
- `cedar-explain-denial`: runs `cedar_authorize` via `cedar://` refs + `cedar_explain` on deciding policies; produces plain-English explanation.
|
|
172
|
+
- `cedar-avp-migration-checklist`: guided checklist for AVP migration; optional `namespace` arg substitutes `<YourNamespace>` placeholder when omitted.
|
|
173
|
+
|
|
174
|
+
#### Entities resource access (Batch E)
|
|
175
|
+
- `StoreManager` extended with `listEntities`, `readEntities`, and `readAllEntities` methods (entity files live in `entities/*.json` under the store root).
|
|
176
|
+
- New MCP Resources: `cedar://entities/{store}` (merged JSON across entity files) and `cedar://entities/{store}/{file_id}` (single file).
|
|
177
|
+
- `ref-resolver.ts` now also resolves `cedar://templates/{store}`, `cedar://templates/{store}/{id}`, `cedar://template-links/{store}`, and `cedar://template-links/{store}/{id}` — previously the corresponding MCP Resources were registered but the URIs were not resolvable as `*_ref` parameters in tools.
|
|
178
|
+
- `cedar_authorize` and `cedar_authorize_batch` gained an `entities_ref` parameter; either inline `entities` or `entities_ref` is now accepted.
|
|
179
|
+
|
|
180
|
+
#### HTTP transport (Batch F)
|
|
181
|
+
- New Streamable HTTP transport for shared team deployment. CLI: `cedar-mcp-server --http <port> [--host <host>] [--root name=path]...`. Stdio remains the default.
|
|
182
|
+
- Per-session McpServer + transport pair with stateful `Mcp-Session-Id` routing (Streamable HTTP spec requires per-session protocol state).
|
|
183
|
+
- Shared `storeManager` across HTTP sessions — deployment model is "one server per policy-store set." Deployer-configured roots via repeatable `--root` flags; client `listRoots()` is not called in HTTP mode.
|
|
184
|
+
- Security: localhost default-binding with DNS rebinding protection via the SDK's `createMcpExpressApp`. Non-localhost binding is the deployer's responsibility (auth via reverse proxy).
|
|
185
|
+
- Max-sessions cap (default 100) returns HTTP 503 when reached; backpressure rather than eviction. Configurable via `maxSessions` option or `CEDAR_MAX_HTTP_SESSIONS` env var.
|
|
186
|
+
- Idle-session TTL (default 30 min) with a periodic reaper that evicts sessions whose last request exceeds the TTL. Catches the case where `transport.onclose` doesn't fire (network partition, TCP RST). Configurable via `sessionIdleTtlMs` option or `CEDAR_HTTP_SESSION_IDLE_TTL_MS` env var.
|
|
187
|
+
- New `/health` endpoint returns `{ status, transport, mode, active_sessions, max_sessions, session_idle_ttl_ms }`.
|
|
188
|
+
- New deps: `express`, `@types/express`.
|
|
189
|
+
- Integration smoke tests covering listTools/cedar_validate/cedar_authorize over real HTTP transport, the /health endpoint, malformed JSON body falsification, multiple concurrent sessions via independent Mcp-Session-Id, the deployer-configured `--root` path (cedar:// URI resolution end-to-end), max-sessions cap returning 503, and idle TTL eviction by the reaper.
|
|
190
|
+
|
|
191
|
+
### Changed
|
|
192
|
+
- `cedar_diff_policy_stores`: `schema_diff` field is now a structured `SchemaDiff` object (with per-change risk classification) replacing the previous `schema_changed: boolean` + `schema_diff_note: string` fields.
|
|
193
|
+
|
|
194
|
+
### Fixed
|
|
195
|
+
- `cedar_validate_entities`: removed incorrect `orphan_parent` error kind (no such Cedar concept); added `disallowed_parent_type` recognition that previously fell through to `error_kind: "other"`.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## [0.0.1] — 2026-05-20
|
|
200
|
+
|
|
201
|
+
First tagged release. All four implementation phases shipped.
|
|
202
|
+
|
|
203
|
+
### Phase 4 — Planning: `cedar_advise`
|
|
204
|
+
|
|
205
|
+
- `cedar_advise`: translates natural-language intent into a step-by-step Cedar policy change plan via MCP sampling. Server builds deterministic context (schema, policy inventory with patterns and Cedar text, selected gotchas, AVP rules summary); LLM produces intent interpretation, applicable Cedar pattern, ordered change steps with Cedar snippets, AVP deployment classification, and verification steps.
|
|
206
|
+
- Iterative refinement via `previous_plan`: passing a previous result triggers delta output (unchanged/modified/added/removed steps).
|
|
207
|
+
- Supporting modules: `avp-rules.ts` (10 AVP validation error categories, UpdatePolicy mutability map), `cedar-patterns.ts` (AST-based policy classifier), `gotchas.ts` (10-entry gotcha catalog with keyword-based selection), `context-builder.ts` (walks policy store files for prompt context).
|
|
208
|
+
- `postProcess()` enforces deterministic corrections: `policy_new` always maps to `new_policy_via_create_policy`, `policy_delete` always maps to `requires_delete_recreate`, schema-before-policy ordering violations surface as a gotcha.
|
|
209
|
+
|
|
210
|
+
### Phase 3 — Roots, Resources, Diffing
|
|
211
|
+
|
|
212
|
+
- MCP Roots integration: loads policy stores on server init, reloads on `RootsListChangedNotification`.
|
|
213
|
+
- `StoreManager`: maps `file://` root URIs to named stores; reads `.cedar` policy files from `policies/` subdirectory; reads `schema.cedarschema` or `schema.json`. Security: validates policy IDs against `^[a-zA-Z0-9_-]+$` (no path traversal); rejects non-`file://` URIs.
|
|
214
|
+
- `cedar://` MCP Resources: `cedar://policies/{store}`, `cedar://policies/{store}/{id}`, `cedar://schema/{store}`.
|
|
215
|
+
- `policy_ref` and `schema_ref` parameters on `cedar_validate`, `cedar_authorize`, and `cedar_explain`: accept `cedar://` URIs as alternatives to inline text.
|
|
216
|
+
- `cedar_diff_policy_stores`: structural diff (added/removed/modified policies with AVP immutability classification per change), schema diff, optional behavioral diff (runs authorization requests through both stores and surfaces decision drift).
|
|
217
|
+
|
|
218
|
+
### Phase 2 — Planning and Understanding
|
|
219
|
+
|
|
220
|
+
- `cedar_explain`: explains a Cedar policy in plain English with pattern detection. Supports templates via `templateToJson` fallback.
|
|
221
|
+
- `cedar_check_policy_change`: determines whether a policy modification can be applied in-place in AVP or requires delete-and-recreate. Uses AST comparison against AVP UpdatePolicy immutability rules.
|
|
222
|
+
- `cedar_generate_sample_request`: generates a complete authorization request payload (principal, action, resource, entities) that produces a target decision against a given policy. Verifies the generated payload against `cedar_authorize`.
|
|
223
|
+
|
|
224
|
+
### Phase 1 — Validation and Evaluation
|
|
225
|
+
|
|
226
|
+
- `cedar_validate`: validates Cedar policies against a schema using `@cedar-policy/cedar-wasm`. Returns errors with hints and source locations.
|
|
227
|
+
- `cedar_authorize`: evaluates an authorization request locally. Auto-detects and converts all three AVP SDK entity formats (snake_case Ruby, camelCase Python/JS, PascalCase official API). Unwraps typed attribute wrappers and entity reference wrappers recursively.
|
|
228
|
+
- `cedar_format`: formats Cedar policy text to canonical style.
|
|
229
|
+
- `cedar_translate`: translates between Cedar text and JSON formats for policies and schemas.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
[Unreleased]: https://github.com/Pigius/cedar-mcp-server/compare/v1.0.0...HEAD
|
|
234
|
+
[1.0.0]: https://github.com/Pigius/cedar-mcp-server/releases/tag/v1.0.0
|
|
235
|
+
[0.0.1]: https://github.com/Pigius/cedar-mcp-server/releases/tag/v0.0.1
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Release process
|
|
240
|
+
|
|
241
|
+
To release: bump version in `package.json`, commit, `git tag v0.X.Y`, `git push --tags`. The release workflow runs build + tests + `npm publish` with provenance. Requires `NPM_TOKEN` repo secret pre-configured.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome. This document covers how to set up locally, the conventions used in this project, and what's expected in a pull request.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Local setup
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/Pigius/cedar-mcp-server.git
|
|
11
|
+
cd cedar-mcp-server
|
|
12
|
+
npm install
|
|
13
|
+
npm test
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Requires Node.js 20 or higher.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Project structure
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
src/
|
|
24
|
+
index.ts MCP server entry point, roots loading
|
|
25
|
+
server.ts Tool registration and request routing
|
|
26
|
+
tools/ One handler file per tool
|
|
27
|
+
tools/advise/ Supporting modules for cedar_advise
|
|
28
|
+
resources/ StoreManager, ref-resolver
|
|
29
|
+
parser/ Cedar AST utilities
|
|
30
|
+
utils/ Format detection, shared helpers
|
|
31
|
+
test/
|
|
32
|
+
tools/ Unit tests for each tool handler
|
|
33
|
+
resources/ Unit tests for StoreManager and ref-resolver
|
|
34
|
+
integration/ End-to-end smoke tests
|
|
35
|
+
fixtures/ Shared test fixtures
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Each tool lives in `src/tools/<name>.ts` with a corresponding test in `test/tools/<name>.test.ts`. The pattern is one exported handler function per file, tested independently of the MCP server wiring.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Running tests
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm test # unit tests (fast, excludes integration)
|
|
46
|
+
npm run test:integration # integration smoke tests (spawns the server via stdio)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Unit tests are fast and self-contained. Integration tests spawn the server as a child process and require a built or runnable server; they run separately from the unit suite.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Test data and NDA discipline
|
|
54
|
+
|
|
55
|
+
Test fixtures in `test/fixtures/` use only the abstract datasets from this repository (DocMgmt, Gateway, generic SaaS namespaces). Do not add fixtures derived from real client systems. The same rule applies to examples in `examples/`: generic, abstract, no real company or product names.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Conventions
|
|
60
|
+
|
|
61
|
+
**TDD cadence.** For new tools and bug fixes, write a failing test first, then implement. Commits should reflect this: a red test commit, then a green implementation commit.
|
|
62
|
+
|
|
63
|
+
**Post-phase audit.** Before any release tag or `npm publish`, run the post-phase audit checklist: verify claims in README match code, check for dead links, confirm version numbers are consistent across `package.json`, `CHANGELOG.md`, and README compatibility table.
|
|
64
|
+
|
|
65
|
+
**No silent breaking changes.** If a tool's input or output shape changes in a way that breaks existing callers, that's a major version bump. Document it in `CHANGELOG.md` under the new version.
|
|
66
|
+
|
|
67
|
+
**No new dependencies without a reason.** The WASM approach keeps the install footprint minimal. New runtime dependencies need justification.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Pull request expectations
|
|
72
|
+
|
|
73
|
+
- Tests pass: `npm test` green.
|
|
74
|
+
- Type check clean: `npx tsc --noEmit` passes.
|
|
75
|
+
- `CHANGELOG.md` updated under `[Unreleased]` with a description of what changed.
|
|
76
|
+
- If you're adding a new tool, add it to the tools table and tool details section in `README.md`.
|
|
77
|
+
- If you're changing a tool's input or output schema, update the relevant section in `README.md`.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Issues
|
|
82
|
+
|
|
83
|
+
Bug reports and feature requests via GitHub Issues. For bugs, include the tool name, the input that triggered the issue, and the actual vs expected output.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other transformations
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of recording and
|
|
55
|
+
distributing the Work, but excluding communication that is conspicuously
|
|
56
|
+
marked or designated in writing by the copyright owner as "Not a
|
|
57
|
+
Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent claims licensable
|
|
76
|
+
by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by the combination of their Contribution(s)
|
|
78
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
79
|
+
institute patent litigation against any entity (including a cross-claim
|
|
80
|
+
or counterclaim in a lawsuit) alleging that the Work or any other
|
|
81
|
+
contribution embodied in the Work constitutes patent or contributory
|
|
82
|
+
patent infringement, then any patent licenses granted to You under
|
|
83
|
+
this License for that Work shall terminate as of the date such
|
|
84
|
+
litigation is filed.
|
|
85
|
+
|
|
86
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
+
modifications, and in Source or Object form, provided that You
|
|
89
|
+
meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
92
|
+
Works a copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices
|
|
95
|
+
stating that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
98
|
+
that You distribute, all copyright, patent, trademark, and
|
|
99
|
+
attribution notices from the Source form of the Work,
|
|
100
|
+
excluding those notices that do not pertain to any part of
|
|
101
|
+
the Derivative Works; and
|
|
102
|
+
|
|
103
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
104
|
+
distribution, You must include a readable copy of the
|
|
105
|
+
attribution notices contained within such NOTICE file, in
|
|
106
|
+
at least one of the following places: within a NOTICE text
|
|
107
|
+
file distributed as part of the Derivative Works; within
|
|
108
|
+
the Source form or documentation, if provided along with the
|
|
109
|
+
Derivative Works; or, within a display generated by the
|
|
110
|
+
Derivative Works, if and wherever such third-party notices
|
|
111
|
+
normally appear. The contents of the NOTICE file are for
|
|
112
|
+
informational purposes only and do not modify the License.
|
|
113
|
+
You may add Your own attribution notices within Derivative
|
|
114
|
+
Works that You distribute, alongside or in addition to the
|
|
115
|
+
NOTICE text from the Work, provided that such additional
|
|
116
|
+
attribution notices cannot be construed as modifying the
|
|
117
|
+
License.
|
|
118
|
+
|
|
119
|
+
You may add Your own license statement for Your modifications and
|
|
120
|
+
may provide additional grant of rights to use, copy, modify, merge,
|
|
121
|
+
publish, distribute, sublicense, and/or sell copies of the
|
|
122
|
+
Contribution.
|
|
123
|
+
|
|
124
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
125
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
126
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
127
|
+
this License, without any additional terms or conditions.
|
|
128
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
129
|
+
the terms of any separate license agreement you may have executed
|
|
130
|
+
with Licensor regarding such Contributions.
|
|
131
|
+
|
|
132
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
133
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
134
|
+
except as required for reasonable and customary use in describing the
|
|
135
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
136
|
+
|
|
137
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
138
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
139
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
140
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
141
|
+
implied, including, without limitation, any warranties or conditions
|
|
142
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
143
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
144
|
+
appropriateness of using or reproducing the Work and assume any
|
|
145
|
+
risks associated with Your exercise of permissions under this License.
|
|
146
|
+
|
|
147
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
148
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
149
|
+
unless required by applicable law (such as deliberate and grossly
|
|
150
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
151
|
+
liable to You for damages, including any direct, indirect, special,
|
|
152
|
+
incidental, or exemplary damages of a character arising as a result
|
|
153
|
+
of this License or out of the use or inability to use the Work
|
|
154
|
+
(even if such Contributor has been advised of the possibility of
|
|
155
|
+
such damages).
|
|
156
|
+
|
|
157
|
+
9. Accepting Warranty or Liability. While redistributing the Work or
|
|
158
|
+
Derivative Works thereof, You may choose to offer, and charge a fee
|
|
159
|
+
for, acceptance of support, warranty, indemnity, or other liability
|
|
160
|
+
obligations and/or rights consistent with this License. However, in
|
|
161
|
+
accepting such obligations, You may offer such obligations only on
|
|
162
|
+
Your own behalf and on Your sole responsibility, not on behalf of
|
|
163
|
+
any other Contributor, and only if You agree to indemnify, defend,
|
|
164
|
+
and hold each Contributor harmless for any liability incurred by,
|
|
165
|
+
or claims asserted against, such Contributor by reason of your
|
|
166
|
+
accepting any such warranty or liability.
|
|
167
|
+
|
|
168
|
+
END OF TERMS AND CONDITIONS
|
|
169
|
+
|
|
170
|
+
Copyright 2024 Daniel Aniszkiewicz
|
|
171
|
+
|
|
172
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
173
|
+
you may not use this file except in compliance with the License.
|
|
174
|
+
You may obtain a copy of the License at
|
|
175
|
+
|
|
176
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
177
|
+
|
|
178
|
+
Unless required by applicable law or agreed to in writing, software
|
|
179
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
180
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
181
|
+
See the License for the specific language governing permissions and
|
|
182
|
+
limitations under the License.
|