pub enum SessionUse {
None,
Route,
Identity {
what: Vec<Arc<str>>,
},
}Expand description
What a view can observe about the Session it is handed.
Three verdicts rather than a boolean, because “reads the session” was one word for two facts and Mode B’s refusal only ever meant one of them.
Variants§
None
The view never touches its Session. §5.1’s Mode B class, and what signal_map produces.
Route
The view reads the route and nothing else. Eligible for Mode B: the browser chose the route and already holds the state, so a page that varies by it discloses nothing.
Identity
The view can observe who is asking — actor, claims, or the whole record. Refused Mode B.
Implementations§
Source§impl SessionUse
impl SessionUse
pub fn reads_identity(&self) -> bool
Sourcepub fn describe(&self) -> String
pub fn describe(&self) -> String
What the view reads, for a message and for beck explain render.
Sourcepub fn of(view: &Core, defs: &BTreeMap<Arc<str>, Def>) -> SessionUse
pub fn of(view: &Core, defs: &BTreeMap<Arc<str>, Def>) -> SessionUse
Read the view’s code, and every definition it reaches, for what it does with a Session.
The rule is one sentence: a Session can only be observed by having a field read off it,
so collect every field read whose base is Session-typed anywhere the view can reach.
That is sound without tracking where the value flows, because flow does not create an
observation — wherever the record ends up, reading it is still a Field over a
Session-typed base, and every definition it could end up in is in this closure. What flow
could hide is an observation that is not a field read: an equality, a digest, a session
stored inside a value that crosses. Those are the escapes below, and they are the
conservative answer rather than an ignored case.
Types make it cheap. A field read needs a concrete record type, so a Session passed
through a generic definition cannot have anything read off it there — the parameter is a
rigid variable and x.actor does not check. There is nowhere for a read to hide.
Trait Implementations§
Source§impl Clone for SessionUse
impl Clone for SessionUse
Source§fn clone(&self) -> SessionUse
fn clone(&self) -> SessionUse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more