@niscorp/charter 0.1.4 → 0.1.5
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 +8 -0
- package/DESIGN.md +1 -0
- package/DOCS.md +4 -3
- package/README.md +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @niscorp/charter
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- febd8b7: The docs cover the `functions` section: what it selects, which checks run on it (no leaves-only), and that moss enforces it.
|
|
8
|
+
|
|
9
|
+
**What to change:** nothing. Documentation only.
|
|
10
|
+
|
|
3
11
|
## 0.1.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/DESIGN.md
CHANGED
|
@@ -220,6 +220,7 @@ two:
|
|
|
220
220
|
| `actions` | action ids | the action map, filtered by ids | Nova's shell |
|
|
221
221
|
| `data` | `SCOPE_VERBS` leaves (`deals.write.insert`) | `createScopePolicy(grants, behaviors, scoping)` | Vex |
|
|
222
222
|
| `layouts` | variant ids | substitute the variant's layout on the definition | moss / Nova |
|
|
223
|
+
| `functions` | function names | a call is allowed when its name is in the resolved set | moss |
|
|
223
224
|
| (future) | tool names | a `ToolPolicy` constructor | Cortex's `policyGate` |
|
|
224
225
|
|
|
225
226
|
Each side stays pure and standalone: the charter is a string-set engine always
|
package/DOCS.md
CHANGED
|
@@ -170,7 +170,8 @@ at boot/CI; refuse to serve if `report.errors` is non-empty.
|
|
|
170
170
|
`layouts` universe is optional: absent, the section is inert (a charter's
|
|
171
171
|
`layouts` keys resolve against nothing and are not verified); handed in, its
|
|
172
172
|
dead-deny/dead-allow/orphan/leaves-only checks run like any other section.
|
|
173
|
-
So is `functions`, with the
|
|
173
|
+
So is `functions`, with the dead-deny, dead-allow and orphan checks;
|
|
174
|
+
leaves-only runs only on `actions` and `layouts`.
|
|
174
175
|
- `wearable?: readonly (readonly string[])[]` — the role combinations a principal
|
|
175
176
|
may wear, one entry per combination (not one per person). Defaults to `[]`.
|
|
176
177
|
Read only by the `subtractive-assigned` check. A composer that has an
|
|
@@ -208,11 +209,11 @@ type RoleClosure = { role: string; actions: string[]; data: string[]; layouts: s
|
|
|
208
209
|
| rule | level | meaning |
|
|
209
210
|
|---|---|---|
|
|
210
211
|
| `resolution` | error | a cycle or unknown-role reference (per section) |
|
|
211
|
-
| `leaves-only` | error | an id is a namespace of another id — namespaces are never actions (checked in the `actions` universe, and in `layouts` when handed in; not in `data`) |
|
|
212
|
+
| `leaves-only` | error | an id is a namespace of another id — namespaces are never actions (checked in the `actions` universe, and in `layouts` when handed in; not in `data` or `functions`) |
|
|
212
213
|
| `ambiguous-selection` | error | a role has both top-level `allow`/`deny` and an explicit `actions:` |
|
|
213
214
|
| `dead-deny` | error | a deny glob matches nothing — silent means unprotected |
|
|
214
215
|
| `dead-allow` | warning | an allow glob matches nothing — noise |
|
|
215
|
-
| `orphan` | warning | an action (or, when
|
|
216
|
+
| `orphan` | warning | an action (or, when handed in, a layout variant or a function) granted by no role — deployed but unreachable. An ungranted `data` id is not reported |
|
|
216
217
|
| `re-allow` | warning | a role re-allows an id an ancestor denied |
|
|
217
218
|
| `subtractive-assigned` | warning | a role used in `without` also appears in a `wearable` combination |
|
|
218
219
|
| *(closure)* | via `RoleClosure.issues` | cross-action wiring problems from the injected auditor |
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ if (report.errors.length > 0) throw new Error('charter is incoherent');
|
|
|
42
42
|
|
|
43
43
|
## What it is
|
|
44
44
|
|
|
45
|
-
- **Universe-blind.** `resolvePrincipal(charter, universe, roles, section)` runs the same resolution against any universe. `actions` selects Nova action ids; `data` selects `table.verb` capabilities (the vex-policy dialect); `layouts` selects layout-variant ids (ring 2 — moss's dialect: which variant of an action's layout a principal is served). Adding a governed domain is adding a universe, never new grammar.
|
|
45
|
+
- **Universe-blind.** `resolvePrincipal(charter, universe, roles, section)` runs the same resolution against any universe. `actions` selects Nova action ids; `data` selects `table.verb` capabilities (the vex-policy dialect); `layouts` selects layout-variant ids (ring 2 — moss's dialect: which variant of an action's layout a principal is served); `functions` selects the names of the app's functions a principal may call. Adding a governed domain is adding a universe, never new grammar.
|
|
46
46
|
- **A small algebra.** `resolved(role) = (∪ extends ∪ match(allow)) − match(deny) − ∪ without`. Order-independent, deny wins within a role, denies don't inherit. Roles compose whole roles; each section resolves independently.
|
|
47
47
|
- **Reach is named, not composed.** A role may carry `scoping` — a name the governed target resolves (vex: which scope behaviors apply). Unlike every section it is not inherited through `extends`: `resolveScoping(charter, role)` is that role's own answer or none, and a principal with several roles is resolved one role at a time.
|
|
48
48
|
- **One glob rule.** `*` matches any run of characters including dots — `crm.*` matches `crm.deal.form`. No `**`, no braces, no regex. When a pattern can't be expressed, the fix is a better id.
|
|
@@ -50,6 +50,6 @@ if (report.errors.length > 0) throw new Error('charter is incoherent');
|
|
|
50
50
|
|
|
51
51
|
## What it is not
|
|
52
52
|
|
|
53
|
-
It does not enforce, store documents, or know about HTTP, databases, or your app. The charter and the assignment rows are the **app's** artifacts. Enforcement is the governed target's job — vex compiles the resolved `data` set into a scope policy; a shell mounts only the resolved `actions`. Charter resolves and refuses; it never runs at request time.
|
|
53
|
+
It does not enforce, store documents, or know about HTTP, databases, or your app. The charter and the assignment rows are the **app's** artifacts. Enforcement is the governed target's job — vex compiles the resolved `data` set into a scope policy; a shell mounts only the resolved `actions`; moss lets a principal call only the resolved `functions`. Charter resolves and refuses; it never runs at request time.
|
|
54
54
|
|
|
55
55
|
See [DESIGN.md](DESIGN.md) for the thesis and [DOCS.md](DOCS.md) for the full API.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/charter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "A universe-blind policy engine — roles resolve glob selections over opaque string universes; the verifier refuses incoherence. Zero dependencies.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|