@niscorp/charter 0.1.2 → 0.1.3
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/DOCS.md +7 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @niscorp/charter
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- de2a757: DOCS.md no longer tells an app to import `auditClosure` from `@niscorp/moss`. Moss stops exporting it (see the moss changeset): it supplies its own closure auditor whenever it verifies an app, at boot and in `verifyApp(app, grants)`. The `ClosureAuditor` section says so, and the usage pattern calls `verifyCharter` without an auditor, which is what a consumer with no auditor of its own does. No code changed.
|
|
8
|
+
|
|
9
|
+
**What to change:** nothing.
|
|
10
|
+
|
|
3
11
|
## 0.1.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/DOCS.md
CHANGED
|
@@ -182,10 +182,10 @@ type ClosureAuditor = (grantedIds: readonly string[], layoutIds?: readonly strin
|
|
|
182
182
|
|
|
183
183
|
Given a role's resolved action ids (and, when the app governs layouts, its
|
|
184
184
|
granted variant ids), return the cross-action wiring problems inside that
|
|
185
|
-
closure. Supplied by the consumer that owns actions
|
|
186
|
-
`
|
|
187
|
-
substitutes granted variants so the audit sees each
|
|
188
|
-
definitions
|
|
185
|
+
closure. Supplied by the consumer that owns actions. Moss supplies its own
|
|
186
|
+
whenever it verifies an app, at boot and in `verifyApp(app, grants)`: built on
|
|
187
|
+
Nova's `auditAction`, it substitutes granted variants so the audit sees each
|
|
188
|
+
role's effective definitions. Absent, every role's `issues` is empty.
|
|
189
189
|
|
|
190
190
|
### `VerifyReport`
|
|
191
191
|
|
|
@@ -220,16 +220,17 @@ type RoleClosure = { role: string; actions: string[]; data: string[]; layouts: s
|
|
|
220
220
|
|
|
221
221
|
```typescript
|
|
222
222
|
import { resolvePrincipal, verifyCharter } from '@niscorp/charter';
|
|
223
|
-
import { auditClosure } from '@niscorp/moss';
|
|
224
223
|
import { createScopePolicy, scopeGrants } from '@niscorp/vex';
|
|
225
224
|
|
|
226
225
|
// 1. Boot: derive the universes from the governed targets, refuse incoherence.
|
|
226
|
+
// (An app served by moss does not write this step: moss runs it at boot,
|
|
227
|
+
// with its closure auditor, and `verifyApp(app, grants)` runs it for a check.)
|
|
227
228
|
const universes = {
|
|
228
229
|
actions: Object.keys(app.actions), // the shell's dialect
|
|
229
230
|
data: scopeGrants(tableNames), // vex's dialect — `table.verb` leaves
|
|
230
231
|
};
|
|
231
232
|
const wearable = Object.values(app.assignments); // the role combinations in use
|
|
232
|
-
const report = verifyCharter(app.charter, universes, wearable
|
|
233
|
+
const report = verifyCharter(app.charter, universes, wearable);
|
|
233
234
|
if (report.errors.length > 0) {
|
|
234
235
|
throw new Error(report.errors.map((e) => `${e.rule}: ${e.detail}`).join('\n'));
|
|
235
236
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/charter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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": {
|