@markii/bundle 0.3.0 → 0.4.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/README.md +3 -1
- package/dist/fs.js +1 -1
- package/dist/script-view.d.ts +4 -3
- package/dist/script-view.js +4 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @markii/bundle
|
|
2
2
|
|
|
3
|
-
Bundle (`.
|
|
3
|
+
Bundle (`.mkz`) storage and policy handling for [Markii](https://github.com/sadigaxund/markii): manifest parsing/validation, a bundle-relative path-jail, the zip storage form (via `fflate`), a Node-only directory storage form (`./fs` subpath), and a capability-restricted script view. No React, no markdown parsing.
|
|
4
|
+
|
|
5
|
+
The legacy `.mkbundle` extension is still recognized for one more release; new bundles are always written as `.mkz`.
|
|
4
6
|
|
|
5
7
|
See the [repository](https://github.com/sadigaxund/markii) for the format spec and the reference library as a whole.
|
package/dist/fs.js
CHANGED
|
@@ -116,7 +116,7 @@ async function resolveInsideRoot(rootAbs, relPath) {
|
|
|
116
116
|
* Writes `data` to an already symlink-checked `target` that is known to
|
|
117
117
|
* exist, refusing to write through a hard link (ESCAPE 3: `st_nlink > 1`
|
|
118
118
|
* means some other path — possibly outside the bundle entirely, e.g.
|
|
119
|
-
* `ln b.
|
|
119
|
+
* `ln b.mkz/../victim.txt b.mkz/cache/hard` — refers to the exact same
|
|
120
120
|
* inode, so writing here would also silently modify that other path).
|
|
121
121
|
*
|
|
122
122
|
* Opens the file first *without* truncating (`'r+'`), `fstat`s the open
|
package/dist/script-view.d.ts
CHANGED
|
@@ -22,8 +22,9 @@ export interface ScriptView {
|
|
|
22
22
|
* trust (their own note, a dev/test harness) — but it must always be an
|
|
23
23
|
* explicit, named opt-in at the call site, never `createScriptView`'s
|
|
24
24
|
* default. See the DEFECT-10 note on `createScriptView` for why: an
|
|
25
|
-
* untrusted `.
|
|
26
|
-
*
|
|
25
|
+
* untrusted `.mkz` bundle (or its legacy `.mkbundle` counterpart) opened
|
|
26
|
+
* from elsewhere must never be able to grant itself capabilities merely by
|
|
27
|
+
* declaring them in its own manifest.
|
|
27
28
|
*/
|
|
28
29
|
export declare function grantAllDeclaredPermissions(manifest: BundleManifest): BundlePermissions;
|
|
29
30
|
/**
|
|
@@ -31,7 +32,7 @@ export declare function grantAllDeclaredPermissions(manifest: BundleManifest): B
|
|
|
31
32
|
*
|
|
32
33
|
* DEFECT 10 / spec §10: "Capabilities are declared in the manifest, granted
|
|
33
34
|
* by the user" — declaring is not granting. `manifest.permissions` is
|
|
34
|
-
* whatever the (possibly untrusted) `.
|
|
35
|
+
* whatever the (possibly untrusted) `.mkz` bundle *asks for*; `grantedPermissions`
|
|
35
36
|
* is whatever the user has actually *approved* for this note (e.g. via a
|
|
36
37
|
* permission-prompt UI, remembered per note and re-prompted if scripts
|
|
37
38
|
* change — see §10). The capability this view actually exposes is the
|
package/dist/script-view.js
CHANGED
|
@@ -7,8 +7,9 @@ import { isWriteAllowed } from './paths.js';
|
|
|
7
7
|
* trust (their own note, a dev/test harness) — but it must always be an
|
|
8
8
|
* explicit, named opt-in at the call site, never `createScriptView`'s
|
|
9
9
|
* default. See the DEFECT-10 note on `createScriptView` for why: an
|
|
10
|
-
* untrusted `.
|
|
11
|
-
*
|
|
10
|
+
* untrusted `.mkz` bundle (or its legacy `.mkbundle` counterpart) opened
|
|
11
|
+
* from elsewhere must never be able to grant itself capabilities merely by
|
|
12
|
+
* declaring them in its own manifest.
|
|
12
13
|
*/
|
|
13
14
|
export function grantAllDeclaredPermissions(manifest) {
|
|
14
15
|
return manifest.permissions ?? {};
|
|
@@ -18,7 +19,7 @@ export function grantAllDeclaredPermissions(manifest) {
|
|
|
18
19
|
*
|
|
19
20
|
* DEFECT 10 / spec §10: "Capabilities are declared in the manifest, granted
|
|
20
21
|
* by the user" — declaring is not granting. `manifest.permissions` is
|
|
21
|
-
* whatever the (possibly untrusted) `.
|
|
22
|
+
* whatever the (possibly untrusted) `.mkz` bundle *asks for*; `grantedPermissions`
|
|
22
23
|
* is whatever the user has actually *approved* for this note (e.g. via a
|
|
23
24
|
* permission-prompt UI, remembered per note and re-prompted if scripts
|
|
24
25
|
* change — see §10). The capability this view actually exposes is the
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markii/bundle",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Bundle (.mkbundle) storage and policy layer for
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Bundle (.mkz, formerly .mkbundle) storage and policy layer for Markii: manifest handling, the bundle-relative path-jail, zip (fflate) and Node directory storage forms, and a capability-restricted script view. No React, no parsing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
7
7
|
"mark",
|