Skip to main content

Session

Struct Session 

Source
pub struct Session<'a> {
    pub keys: &'a [KeypairEntry],
    pub scope: &'a AgentScope,
    pub confirmer: &'a dyn Confirmer,
    pub audit: &'a dyn AuditSink,
    pub clock: &'a dyn Clock,
    pub confirm_timeout: Duration,
    pub requesting_process: Option<String>,
}
Expand description

Everything the session needs from the face: the custodied keys, the agent’s scope, the confirmation broker, the audit sink, the clock, and the confirmation timeout. All behind traits so tests inject mocks.

Fields§

§keys: &'a [KeypairEntry]

The keys this agent may offer/sign with (already filtered to those with a private half).

§scope: &'a AgentScope

The agent’s capability scope (I13).

§confirmer: &'a dyn Confirmer

The per-signature confirmation broker (biometric / file fallback).

§audit: &'a dyn AuditSink

The append-only audit sink (I12).

§clock: &'a dyn Clock

The clock for audit timestamps.

§confirm_timeout: Duration

How long a high/prod confirmation may block before failing safe.

§requesting_process: Option<String>

The observed requesting process, for the I16 prompt line (set by the face from kovra_wrapper::observe_parent()); None when unobserved.

Implementations§

Source§

impl Session<'_>

Source

pub fn handle(&self, request: &Request) -> Result<Vec<u8>, AgentError>

Handle one parsed request, returning the response body (ready to be framed by the daemon). All policy faults map to SSH_AGENT_FAILURE; this function never returns an Err for a protocol-level refusal (the wire answer carries it). It returns Err only on an audit/IO fault the daemon should log.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Session<'a>

§

impl<'a> !Send for Session<'a>

§

impl<'a> !Sync for Session<'a>

§

impl<'a> !UnwindSafe for Session<'a>

§

impl<'a> Freeze for Session<'a>

§

impl<'a> Unpin for Session<'a>

§

impl<'a> UnsafeUnpin for Session<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V