1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! What the device of a session in a workspace's VM asks of the workspace's
//! host (`docs/hosted-browser.md`, "Linux apps" and "Isolation").
//!
//! The session in a workspace's VM runs strangers' code — web pages, Linux
//! programs — so its device is confined to its own record and holds none of
//! the workspace's keys: not a record's, and not the content keys of the
//! workspace's media channel, which open every call, presence and window of
//! the workspace. Yet what it shows must reach the people watching, and what
//! it shares must be written where every member reads it. It asks the host,
//! which certified it and holds the workspace's keys, for exactly that much:
//!
//! - [`MEDIA_KEYS`]: the media keys of its own streams on the workspace's
//! live session — its presence, its windows and its pages — at the epoch the
//! media channel is at, derived for it alone and sealed to its device key.
//! They seal what it publishes and open nothing: not another device's
//! stream, and no stream of its own it was not handed. Its action service asks again
//! whenever it joins, so keys that a membership change made stale are
//! replaced on the action service's next join.
//! - [`SHARE_WINDOW`] and [`END_WINDOW_SHARE`]: share one of its own windows
//! with the workspace's members ([`WindowShare`]), or end that share. The
//! host writes the grants as the workspace's governor, as it writes a web
//! page's share, once it has checked the window is one the asking device
//! minted: a confined device never writes the workspace's governance
//! itself, and never shares a window that is not its own.
//! - [`USE_ITEM`]: the text an item of a person's vault keeps for the site the device's page
//! is at ([`ItemUse`]), for one fill of a field the server itself handed that device. It
//! decides by the vault's own rule and the person's leave, and answers the text sealed to the
//! device's key for that one fill and that one site ([`ItemUsed`]): nothing that carries the
//! answer reads it, and the device learns nothing of an item it was not handed a fill for.
//!
//! Only a device the host placed in a VM asks these, and only of the
//! workspace it was placed in; anyone else is refused.
use ;
use RemoteActionTarget;
use PROVIDER;
use crateActionAddress;
/// The resource these are actions of: the asking device itself, as the
/// workspace's host knows it.
pub const RESOURCE: &str = "environment.device";
/// The media keys of the asking device's own streams.
pub const MEDIA_KEYS: &str = "media-keys";
/// Share one of the asking device's windows with the workspace.
pub const SHARE_WINDOW: &str = "share-window";
/// End the share of one of the asking device's windows.
pub const END_WINDOW_SHARE: &str = "end-window-share";
/// The text a vault item keeps for the site the asking device's page is at, for one fill
/// the server handed that device.
pub const USE_ITEM: &str = "use-item";
/// What [`MEDIA_KEYS`] answers: one sender's media keys
/// (`key_group::SenderMediaKeys`), sealed to its device key, in their
/// wire encoding as hex.
/// The window [`SHARE_WINDOW`] and [`END_WINDOW_SHARE`] name: the app it is
/// a window of, and its tab, as the device's session minted it.
/// What [`USE_ITEM`] names: the page action that fills a field from a vault item by reference,
/// as the server handed it to the asking device, the item it names, and the site the device's
/// engine says its page is at.
/// What [`USE_ITEM`] answers. A refusal is the ask's own: the item is not released there.
/// Where the device sends `action`: the workspace's host, under the
/// environment's provider.
/// Whether `target` is one of these actions, and which.