Skip to main content

LysSession

Trait LysSession 

Source
pub trait LysSession:
    Send
    + Sync
    + Debug {
    // Required methods
    fn holder(&self) -> &str;
    fn decide(
        &self,
        subject: &SubjectBinding,
        action: HotAction,
        now: u64,
    ) -> Result<GrantReceipt, AccessDecisionError>;
    fn decide_link(
        &self,
        subject: &SubjectBinding,
        action: LinkAction,
        now: u64,
    ) -> Result<GrantReceipt, AccessDecisionError>;
    fn open_link(
        &self,
        link: &AccessResource,
        end: LinkAction,
        now: u64,
    ) -> Result<DeliberateDecision, AccessDecisionError>;
    fn decide_live(
        &self,
        resource: &AccessResource,
        action: AccessAction,
        now: u64,
    ) -> Result<DeliberateDecision, AccessDecisionError>;

    // Provided methods
    fn hold_permission(
        &self,
        _request: PermissionRequest<'_>,
    ) -> Result<Value, Error> { ... }
    fn hold_site(&self, _request: SiteRequest<'_>) -> Result<Value, Error> { ... }
    fn holder_kind(&self) -> Option<&str> { ... }
    fn issued_at(&self) -> Option<u64> { ... }
}
Expand description

An admitted pass deciding hot actions for one connection.

Required Methods§

Source

fn holder(&self) -> &str

The holder the one verification proved, as Lys names it.

Source

fn decide( &self, subject: &SubjectBinding, action: HotAction, now: u64, ) -> Result<GrantReceipt, AccessDecisionError>

Decides one hot action on one bound subject at now, offline.

§Errors

The one refusal shape with its cause.

Decides one link grant (link_export or link_import) on one bound link at now, offline from the admitted pass (ACCESS-002 R1).

§Errors

The one refusal shape with its cause.

Asks Lys, live, whether this holder may open end of link: never decided from the pass alone, and DeliberateUnavailable when Lys cannot be asked (ACCESS-002 R1).

§Errors

The one refusal shape with its cause.

Source

fn decide_live( &self, resource: &AccessResource, action: AccessAction, now: u64, ) -> Result<DeliberateDecision, AccessDecisionError>

Asks Lys live for action on resource with this connection’s pass (ACCESS-003 R1): the deliberate decision a service of class deliberate is served on. A held answer carries the grant and draft; without a live seam the answer is DeliberateUnavailable, never a hot fallback.

§Errors

Refused, by cause, with the resource and action named.

Provided Methods§

Source

fn hold_permission( &self, _request: PermissionRequest<'_>, ) -> Result<Value, Error>

Holds a generic host permission through this session’s consumer.

§Errors

Missing prepared support or an authenticated refusal.

Source

fn hold_site(&self, _request: SiteRequest<'_>) -> Result<Value, Error>

Prepares through the admitted credential, borrowed only by its consumer.

§Errors

Missing prepared support or an authenticated refusal.

Source

fn holder_kind(&self) -> Option<&str>

The directory kind of that holder as the signed pass states it, for the membership question (ACCESS-006 R1); None when unknown, which a membership-protected channel refuses by name.

Source

fn issued_at(&self) -> Option<u64>

When the admitted pass was issued, in Unix seconds; None when the consumer cannot name it, and nothing is then asked live for want of it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§