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
pub fn new( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, ) -> Self
pub fn new_with_trusted_capability_issuers( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, trusted_capability_issuers: Vec<PublicKey>, ) -> Self
pub fn new_with_approval_store( routes: Vec<RouteEntry>, keypair: Keypair, policy_hash: String, approval_store: Arc<dyn ApprovalStore>, ) -> Self
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
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_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 Freeze for RequestEvaluator
impl !RefUnwindSafe for RequestEvaluator
impl Send for RequestEvaluator
impl Sync for RequestEvaluator
impl Unpin for RequestEvaluator
impl UnsafeUnpin for RequestEvaluator
impl !UnwindSafe for RequestEvaluator
Blanket Implementations§
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
Mutably borrows from an owned value. Read more