pub struct RequestEvaluator { /* private fields */ }Expand description
The request evaluator holds the loaded route table and shared HTTP authority.
Implementations§
Source§impl RequestEvaluator
impl RequestEvaluator
Sourcepub fn new(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
) -> Self
👎Deprecated: renamed to new_ephemeral: this keeps the receipt log and revocation state in memory, lost on restart
pub fn new( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, ) -> Self
renamed to new_ephemeral: this keeps the receipt log and revocation state in memory, lost on restart
Compatibility shim for the pre-rename constructor name. Renamed to
RequestEvaluator::new_ephemeral so an embedder never gets in-memory
audit state by mistake; kept so existing callers keep compiling.
Sourcepub fn new_with_trusted_capability_issuers(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
trusted_capability_issuers: Vec<PublicKey>,
) -> Self
👎Deprecated: renamed to new_ephemeral_with_trusted_capability_issuers: this keeps the receipt log and revocation state in memory, lost on restart
pub fn new_with_trusted_capability_issuers( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, trusted_capability_issuers: Vec<PublicKey>, ) -> Self
renamed to new_ephemeral_with_trusted_capability_issuers: this keeps the receipt log and revocation state in memory, lost on restart
Compatibility shim for the pre-rename constructor name; see
RequestEvaluator::new_ephemeral_with_trusted_capability_issuers.
Sourcepub fn new_with_approval_store(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
approval_store: Arc<dyn ApprovalStore>,
) -> Self
👎Deprecated: renamed to new_ephemeral_with_approval_store: this keeps the receipt log and revocation state in memory, lost on restart
pub fn new_with_approval_store( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, approval_store: Arc<dyn ApprovalStore>, ) -> Self
renamed to new_ephemeral_with_approval_store: this keeps the receipt log and revocation state in memory, lost on restart
Compatibility shim for the pre-rename constructor name; see
RequestEvaluator::new_ephemeral_with_approval_store.
Sourcepub fn new_with_approval_store_and_trusted_capability_issuers(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
approval_store: Arc<dyn ApprovalStore>,
trusted_capability_issuers: Vec<PublicKey>,
) -> Self
👎Deprecated: renamed to new_ephemeral_with_approval_store_and_trusted_capability_issuers: this keeps the receipt log and revocation state in memory, lost on restart
pub fn new_with_approval_store_and_trusted_capability_issuers( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, approval_store: Arc<dyn ApprovalStore>, trusted_capability_issuers: Vec<PublicKey>, ) -> Self
renamed to new_ephemeral_with_approval_store_and_trusted_capability_issuers: this keeps the receipt log and revocation state in memory, lost on restart
Compatibility shim for the pre-rename constructor name; see
RequestEvaluator::new_ephemeral_with_approval_store_and_trusted_capability_issuers.
Sourcepub fn new_ephemeral(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
) -> Self
pub fn new_ephemeral( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, ) -> Self
Build an evaluator whose embedded kernel keeps its receipt log and
revocation state in memory; both are lost on restart. Ephemerality is
opted into through the constructor name so an embedder never gets
in-memory audit state by mistake. Durable-by-default construction goes
through RequestEvaluator::new_with_durable_stores.
Sourcepub fn new_ephemeral_with_trusted_capability_issuers(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
trusted_capability_issuers: Vec<PublicKey>,
) -> Self
pub fn new_ephemeral_with_trusted_capability_issuers( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, trusted_capability_issuers: Vec<PublicKey>, ) -> Self
Ephemeral evaluator with additional trusted capability issuers; see
RequestEvaluator::new_ephemeral.
Sourcepub fn new_ephemeral_with_approval_store(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
approval_store: Arc<dyn ApprovalStore>,
) -> Self
pub fn new_ephemeral_with_approval_store( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, approval_store: Arc<dyn ApprovalStore>, ) -> Self
Ephemeral evaluator with a caller-provided approval store; see
RequestEvaluator::new_ephemeral.
Sourcepub fn new_ephemeral_with_approval_store_and_trusted_capability_issuers(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
approval_store: Arc<dyn ApprovalStore>,
trusted_capability_issuers: Vec<PublicKey>,
) -> Self
pub fn new_ephemeral_with_approval_store_and_trusted_capability_issuers( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, approval_store: Arc<dyn ApprovalStore>, trusted_capability_issuers: Vec<PublicKey>, ) -> Self
Ephemeral evaluator with a caller-provided approval store and additional
trusted capability issuers; see RequestEvaluator::new_ephemeral.
Sourcepub fn new_with_durable_stores(
routes: Vec<RouteEntry>,
keypair: Keypair,
policy_hash: String,
approval_store: Arc<dyn ApprovalStore>,
trusted_capability_issuers: Vec<PublicKey>,
receipt_store: Option<Arc<dyn ReceiptStore>>,
revocation_store: Option<Arc<dyn RevocationStore>>,
allow_ephemeral: bool,
) -> Result<Self, HttpAuthorityError>
pub fn new_with_durable_stores( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, approval_store: Arc<dyn ApprovalStore>, trusted_capability_issuers: Vec<PublicKey>, receipt_store: Option<Arc<dyn ReceiptStore>>, revocation_store: Option<Arc<dyn RevocationStore>>, allow_ephemeral: bool, ) -> Result<Self, HttpAuthorityError>
Build an evaluator whose embedded kernel is backed by durable stores when
provided. A Some store is attached and the kernel runs fail-closed
against it. When a store is absent (or an attached one reports ephemeral),
the kernel runs in-memory for that backend only when allow_ephemeral is
set: durable-by-default, an operator must explicitly opt into losing
receipts or revocation state on restart rather than getting it silently.
Sourcepub fn receipt_backend(&self) -> &'static str
pub fn receipt_backend(&self) -> &'static str
Health label for the embedded kernel’s receipt backend.
Sourcepub fn revocation_backend(&self) -> &'static str
pub fn revocation_backend(&self) -> &'static str
Health label for the embedded kernel’s revocation backend.
Sourcepub fn evaluate(
&self,
method: HttpMethod,
path: &str,
query: &HashMap<String, String>,
headers: &HashMap<String, String>,
body_hash: Option<String>,
body_length: u64,
) -> Result<EvaluationResult, ProtectError>
pub fn evaluate( &self, method: HttpMethod, path: &str, query: &HashMap<String, String>, headers: &HashMap<String, String>, body_hash: Option<String>, body_length: u64, ) -> Result<EvaluationResult, ProtectError>
Evaluate an incoming HTTP request against the route table.
Sourcepub fn evaluate_with_execution_nonce(
&self,
method: HttpMethod,
path: &str,
query: &HashMap<String, String>,
headers: &HashMap<String, String>,
body_hash: Option<String>,
body_length: u64,
execution_nonce: Option<&SignedExecutionNonce>,
) -> Result<EvaluationResult, ProtectError>
pub fn evaluate_with_execution_nonce( &self, method: HttpMethod, path: &str, query: &HashMap<String, String>, headers: &HashMap<String, String>, body_hash: Option<String>, body_length: u64, execution_nonce: Option<&SignedExecutionNonce>, ) -> Result<EvaluationResult, ProtectError>
Evaluate an incoming HTTP request with an optional direct-proxy nonce.
Sourcepub fn evaluate_chio_request(
&self,
request: ChioHttpRequest,
presented_capability: Option<&str>,
) -> Result<EvaluationResult, ProtectError>
pub fn evaluate_chio_request( &self, request: ChioHttpRequest, presented_capability: Option<&str>, ) -> Result<EvaluationResult, ProtectError>
Evaluate a fully normalized sidecar request.
Source§impl RequestEvaluator
impl RequestEvaluator
pub fn finalize_receipt( &self, decision_receipt: &HttpReceipt, response_status: u16, ) -> Result<HttpReceipt, ProtectError>
Auto Trait Implementations§
impl !RefUnwindSafe for RequestEvaluator
impl !UnwindSafe for RequestEvaluator
impl Freeze for RequestEvaluator
impl Send for RequestEvaluator
impl Sync for RequestEvaluator
impl Unpin for RequestEvaluator
impl UnsafeUnpin for RequestEvaluator
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.