#[non_exhaustive]pub struct BindIdentity {
pub project_root: PathBuf,
pub harness: String,
pub session: String,
pub project_id: Option<String>,
}Expand description
Per-route bind identity shared by client-facing and module-facing control.
EVERY FIELD HERE IS CLIENT-SUPPLIED AND UNATTESTED. The daemon canonicalizes
project_root as a path but does not verify that the caller has any relation
to it, and harness, session, and project_id are strings the caller chose.
A client holding the connection key can present any values it likes.
This sits directly above Principal, which is the opposite: stamped BY the
daemon from a launch nonce it minted. The two travel together on every
route.bind, so a module reading them side by side is reading one fact it can
trust and four it cannot. THE DISTINCTION IS INVISIBLE FROM THE TYPES, which
is why it is written here.
So these fields are for SCOPING AND ATTRIBUTION – which project’s state to
open, which session to thread, what to log – and never for authorization. A
module that grants capability on harness or trusts project_root to bound
what a caller may reach has built an authorization check on a value the caller
controls. Gate on Principal instead, and where a module needs a caller fact
subc does not stamp, it must establish that fact itself rather than believe
this struct.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.project_root: PathBuf§harness: String§session: String§project_id: Option<String>The entorhinal-registered project id (pj-…) for project_root, when
the root is a registered project. Aliases count as registered projects;
implicit roots do not. Absent means “no stable id, key on the triple”,
not “unknown”.
A producer sends the id on every bind of a session or on none. A producer
that alternates between Some(id) and None across binds silently forks
the consumer’s lineage into separate stores, with no error at either end.
Therefore, a producer that cannot answer consistently must answer None
consistently.
Resolve this at most once per session, before its first bind, and persist
the outcome with the session. ALF’s resolver has real Resolved, Unavailable,
and Disabled outcomes: if unavailable at cold start is re-resolved on a
later bind, the session can alternate from None to Some(id). Send only
registered or alias resolutions, never implicit, unavailable, or disabled
fallback ids.
Implementations§
Source§impl BindIdentity
impl BindIdentity
Sourcepub fn new(
project_root: impl Into<PathBuf>,
harness: impl Into<String>,
session: impl Into<String>,
) -> Self
pub fn new( project_root: impl Into<PathBuf>, harness: impl Into<String>, session: impl Into<String>, ) -> Self
Constructs an identity with no registered project id.
Use this instead of a struct literal so future additive identity fields do not force construction-site migrations across the fleet.
Trait Implementations§
Source§impl Clone for BindIdentity
impl Clone for BindIdentity
Source§fn clone(&self) -> BindIdentity
fn clone(&self) -> BindIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more