@capybara-hq/plugin-sdk 0.1.0-rc.60 → 0.1.0-rc.62
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/dist/device-denied-paths.d.ts +3 -1
- package/dist/device-denied-paths.js +35 -1
- package/dist/device-provider.d.ts +12 -2
- package/dist/device-provider.js +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/sandbox-linux-runtime-source.js +34 -9
- package/dist/sandbox-linux-staged-runtime-source.d.ts +10 -0
- package/dist/sandbox-linux-staged-runtime-source.js +2419 -0
- package/dist/sandbox-runtime-source.d.ts +33 -5
- package/dist/sandbox-runtime-source.js +53 -12
- package/package.json +1 -1
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A capability of a runtime file that a consumer may use only when the file it runs declares it.
|
|
3
|
+
* `fileReadRoots`: `linux-sandbox.py` accepts exact file read roots (`roots.readFiles`, exec mode).
|
|
4
|
+
*/
|
|
5
|
+
export type SandboxRuntimeFeature = "fileReadRoots";
|
|
6
|
+
/** One runtime file: its exact bytes and their sha256 (hex). */
|
|
7
|
+
export interface SandboxRuntimeFile {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly source: string;
|
|
10
|
+
readonly sha256: string;
|
|
11
|
+
/** What this revision supports beyond the bundle's base protocol; absent means nothing more. */
|
|
12
|
+
readonly features?: readonly SandboxRuntimeFeature[];
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* Immutable runtime bytes for trusted consumer staging (requires Python 3). Consumers verify every
|
|
3
16
|
* hash before use, stage the files together in a directory the operation user cannot write, and
|
|
@@ -8,12 +21,27 @@
|
|
|
8
21
|
* notification broker). It decides nothing about authority; its `probe` reports whether the
|
|
9
22
|
* running kernel, architecture and container policy support restricted execution, and every
|
|
10
23
|
* unsupported case reports unavailable. Shipping these bytes is not a provider support claim.
|
|
24
|
+
*
|
|
25
|
+
* Two sets, because an image provider (device-docker) builds the bytes into its image in another
|
|
26
|
+
* repository and release, while the host SDK moves with the kernel:
|
|
27
|
+
*
|
|
28
|
+
* - `files`: the staged set, exactly what released image providers stage and check against the
|
|
29
|
+
* host SDK. It changes only in the core change that moves `marketplace.commit` and the
|
|
30
|
+
* device-docker pin to an image staging it.
|
|
31
|
+
* - `current`: the newest runtime. A consumer that carries the bytes itself (capybara-device sends
|
|
32
|
+
* them inline with every request) runs these, and uses a capability only when the file it runs
|
|
33
|
+
* declares it in `features`; an image provider restages from these.
|
|
34
|
+
* - `accepted`: by file name, every digest a staged copy may have: `files` and `current`, plus at
|
|
35
|
+
* most one previous revision kept for instances built from an earlier image. Only SDK-shipped
|
|
36
|
+
* digests are listed; nothing configures this.
|
|
37
|
+
*
|
|
38
|
+
* A runtime change therefore lands in three steps (tools/checks/README.md, "Changing the SDK
|
|
39
|
+
* runtime sources"): `current` first, then the provider restages, then core promotes `current` to
|
|
40
|
+
* `files` with the pin.
|
|
11
41
|
*/
|
|
12
42
|
export declare const SANDBOX_RUNTIME_SOURCE: {
|
|
13
43
|
readonly version: number;
|
|
14
|
-
readonly files: readonly
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
readonly sha256: string;
|
|
18
|
-
}[];
|
|
44
|
+
readonly files: readonly SandboxRuntimeFile[];
|
|
45
|
+
readonly current: readonly SandboxRuntimeFile[];
|
|
46
|
+
readonly accepted: Readonly<Record<string, readonly string[]>>;
|
|
19
47
|
};
|
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
import { LINUX_SANDBOX_SOURCE } from "./sandbox-linux-runtime-source.js";
|
|
2
|
+
import { LINUX_SANDBOX_STAGED_SOURCE } from "./sandbox-linux-staged-runtime-source.js";
|
|
2
3
|
import { NATIVE_FILES_SOURCE } from "./sandbox-native-runtime-source.js";
|
|
4
|
+
const NATIVE_FILES = Object.freeze({
|
|
5
|
+
name: "native-files.py",
|
|
6
|
+
source: NATIVE_FILES_SOURCE,
|
|
7
|
+
sha256: "c1712198af4ffedc0b48f789c28ed4233dc9008521b897300731c4f903168950",
|
|
8
|
+
});
|
|
9
|
+
/** The launcher every released image provider stages (`sandbox-linux-staged-runtime-source.ts`). */
|
|
10
|
+
const LINUX_SANDBOX_STAGED = Object.freeze({
|
|
11
|
+
name: "linux-sandbox.py",
|
|
12
|
+
source: LINUX_SANDBOX_STAGED_SOURCE,
|
|
13
|
+
sha256: "4e046df902dc644532ada9f2a3bef30a983daf7d1f238bd46dcd16524d96c66c",
|
|
14
|
+
});
|
|
15
|
+
const LINUX_SANDBOX = Object.freeze({
|
|
16
|
+
name: "linux-sandbox.py",
|
|
17
|
+
source: LINUX_SANDBOX_SOURCE,
|
|
18
|
+
sha256: "ceb5bb0971437978a7695091792bfafcf3dbf2e7c74e8425d8aceb76e442f848",
|
|
19
|
+
features: Object.freeze(["fileReadRoots"]),
|
|
20
|
+
});
|
|
21
|
+
const STAGED = Object.freeze([NATIVE_FILES, LINUX_SANDBOX_STAGED]);
|
|
22
|
+
const CURRENT = Object.freeze([NATIVE_FILES, LINUX_SANDBOX]);
|
|
23
|
+
function acceptedDigests(...sets) {
|
|
24
|
+
const out = {};
|
|
25
|
+
for (const set of sets)
|
|
26
|
+
for (const file of set) {
|
|
27
|
+
const list = out[file.name] ?? [];
|
|
28
|
+
if (!list.includes(file.sha256))
|
|
29
|
+
list.push(file.sha256);
|
|
30
|
+
out[file.name] = list;
|
|
31
|
+
}
|
|
32
|
+
for (const name of Object.keys(out))
|
|
33
|
+
Object.freeze(out[name]);
|
|
34
|
+
return Object.freeze(out);
|
|
35
|
+
}
|
|
3
36
|
/**
|
|
4
37
|
* Immutable runtime bytes for trusted consumer staging (requires Python 3). Consumers verify every
|
|
5
38
|
* hash before use, stage the files together in a directory the operation user cannot write, and
|
|
@@ -10,19 +43,27 @@ import { NATIVE_FILES_SOURCE } from "./sandbox-native-runtime-source.js";
|
|
|
10
43
|
* notification broker). It decides nothing about authority; its `probe` reports whether the
|
|
11
44
|
* running kernel, architecture and container policy support restricted execution, and every
|
|
12
45
|
* unsupported case reports unavailable. Shipping these bytes is not a provider support claim.
|
|
46
|
+
*
|
|
47
|
+
* Two sets, because an image provider (device-docker) builds the bytes into its image in another
|
|
48
|
+
* repository and release, while the host SDK moves with the kernel:
|
|
49
|
+
*
|
|
50
|
+
* - `files`: the staged set, exactly what released image providers stage and check against the
|
|
51
|
+
* host SDK. It changes only in the core change that moves `marketplace.commit` and the
|
|
52
|
+
* device-docker pin to an image staging it.
|
|
53
|
+
* - `current`: the newest runtime. A consumer that carries the bytes itself (capybara-device sends
|
|
54
|
+
* them inline with every request) runs these, and uses a capability only when the file it runs
|
|
55
|
+
* declares it in `features`; an image provider restages from these.
|
|
56
|
+
* - `accepted`: by file name, every digest a staged copy may have: `files` and `current`, plus at
|
|
57
|
+
* most one previous revision kept for instances built from an earlier image. Only SDK-shipped
|
|
58
|
+
* digests are listed; nothing configures this.
|
|
59
|
+
*
|
|
60
|
+
* A runtime change therefore lands in three steps (tools/checks/README.md, "Changing the SDK
|
|
61
|
+
* runtime sources"): `current` first, then the provider restages, then core promotes `current` to
|
|
62
|
+
* `files` with the pin.
|
|
13
63
|
*/
|
|
14
64
|
export const SANDBOX_RUNTIME_SOURCE = Object.freeze({
|
|
15
65
|
version: 2,
|
|
16
|
-
files:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
source: NATIVE_FILES_SOURCE,
|
|
20
|
-
sha256: "c1712198af4ffedc0b48f789c28ed4233dc9008521b897300731c4f903168950",
|
|
21
|
-
}),
|
|
22
|
-
Object.freeze({
|
|
23
|
-
name: "linux-sandbox.py",
|
|
24
|
-
source: LINUX_SANDBOX_SOURCE,
|
|
25
|
-
sha256: "4e046df902dc644532ada9f2a3bef30a983daf7d1f238bd46dcd16524d96c66c",
|
|
26
|
-
}),
|
|
27
|
-
]),
|
|
66
|
+
files: STAGED,
|
|
67
|
+
current: CURRENT,
|
|
68
|
+
accepted: acceptedDigests(STAGED, CURRENT),
|
|
28
69
|
});
|