#[non_exhaustive]pub enum Permission {
Network {
host: &'static str,
reason: &'static str,
},
Files {
path: &'static str,
write: bool,
reason: &'static str,
},
Launch {
program: &'static str,
reason: &'static str,
},
Credentials {
reason: &'static str,
},
}Expand description
Something an addon needs to be allowed to do (FR-046).
Declared as a set the addon needs in order to work, not as a wish list: the user grants or refuses the whole declaration, because a half-granted addon is a matrix of broken states nobody asked for and every one of them would have to be designed.
§Only one of these is enforced, and this type does not pretend otherwise
Self::Credentials is real: the daemon holds the credential store and an
addon can only ask, so a refusal is a refusal. The other three are
declarations shown to the user, and an ungranted addon is simply not
started — which is a genuine control, because a process that is not running
opens no sockets. What is not true is that a running addon is confined
to what it declared. Nothing stops a granted addon reaching a host it never
mentioned.
That gap is ADR-0016’s, deliberately, and it is named in the interface rather than papered over: “may reach api.spotify.com” must not be read as “and nothing else” until platform confinement makes it true.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network
Reach a host over the network.
One host per declaration rather than a list, so the interface can show them as separate lines and so a diff between two versions of an addon reads as “it now also wants X”.
Fields
Files
Read or write files under a path.
Fields
Launch
Start another program.
Fields
Credentials
Keep credentials of its own, in the OS credential store.
The enforced one. Ungranted, the daemon answers every credential ask with a refusal, which an addon must survive: it is the same answer as “nothing stored yet”, and an addon that handles being signed out already handles this.
Implementations§
Trait Implementations§
Source§impl Clone for Permission
impl Clone for Permission
Source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Permission
impl Debug for Permission
Source§impl PartialEq for Permission
impl PartialEq for Permission
Source§fn eq(&self, other: &Permission) -> bool
fn eq(&self, other: &Permission) -> bool
self and other values to be equal, and is used by ==.