Skip to main content

BindIdentity

Struct BindIdentity 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

Source

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

Source§

fn clone(&self) -> BindIdentity

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BindIdentity

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for BindIdentity

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for BindIdentity

Source§

impl PartialEq for BindIdentity

Source§

fn eq(&self, other: &BindIdentity) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for BindIdentity

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for BindIdentity

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.