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§
Sourcefn decide(
&self,
subject: &SubjectBinding,
action: HotAction,
now: u64,
) -> Result<GrantReceipt, AccessDecisionError>
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.
Sourcefn decide_link(
&self,
subject: &SubjectBinding,
action: LinkAction,
now: u64,
) -> Result<GrantReceipt, AccessDecisionError>
fn decide_link( &self, subject: &SubjectBinding, action: LinkAction, now: u64, ) -> Result<GrantReceipt, AccessDecisionError>
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.
Sourcefn open_link(
&self,
link: &AccessResource,
end: LinkAction,
now: u64,
) -> Result<DeliberateDecision, AccessDecisionError>
fn open_link( &self, link: &AccessResource, end: LinkAction, now: u64, ) -> Result<DeliberateDecision, AccessDecisionError>
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.
Sourcefn decide_live(
&self,
resource: &AccessResource,
action: AccessAction,
now: u64,
) -> Result<DeliberateDecision, AccessDecisionError>
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§
Sourcefn hold_permission(
&self,
_request: PermissionRequest<'_>,
) -> Result<Value, Error>
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.
Sourcefn hold_site(&self, _request: SiteRequest<'_>) -> Result<Value, Error>
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.
Sourcefn holder_kind(&self) -> Option<&str>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".