pub struct ClassPolicyHttpExecutor<H> { /* private fields */ }Expand description
An HttpExecutor that re-checks every request
against the static class policy once its path is resolved, then delegates.
Validation sees a dynamic path (/items/${id}) only as a template; this
wrapper sees the path the request actually goes to, so a run-time value
cannot carry a call into a class, blocked path or blocked operation the
policy refuses. A refusal is
ExecutionError::RequestRefused,
and its message never contains the resolved path.
Implementations§
Source§impl<H> ClassPolicyHttpExecutor<H>
impl<H> ClassPolicyHttpExecutor<H>
Sourcepub fn new(inner: H, config: &CodeModeConfig) -> ClassPolicyHttpExecutor<H>
pub fn new(inner: H, config: &CodeModeConfig) -> ClassPolicyHttpExecutor<H>
Wrap inner with the policy and catalog of config.
Sourcepub fn with_policy(
inner: H,
policy: OpenApiClassPolicy,
operations: &[OperationEntry],
) -> ClassPolicyHttpExecutor<H>
pub fn with_policy( inner: H, policy: OpenApiClassPolicy, operations: &[OperationEntry], ) -> ClassPolicyHttpExecutor<H>
Wrap inner with an explicit policy and operation catalog — the
executor counterpart of
ValidationPipeline::with_openapi_class_policy.
Trait Implementations§
Source§impl<H> Clone for ClassPolicyHttpExecutor<H>where
H: Clone,
Available on crate feature js-runtime only.
impl<H> Clone for ClassPolicyHttpExecutor<H>where
H: Clone,
Available on crate feature
js-runtime only.Source§fn clone(&self) -> ClassPolicyHttpExecutor<H>
fn clone(&self) -> ClassPolicyHttpExecutor<H>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<H> HttpExecutor for ClassPolicyHttpExecutor<H>where
H: HttpExecutor,
impl<H> HttpExecutor for ClassPolicyHttpExecutor<H>where
H: HttpExecutor,
Source§fn execute_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
path: ResolvedPath<'life2>,
body: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, ExecutionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ClassPolicyHttpExecutor<H>: 'async_trait,
fn execute_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
path: ResolvedPath<'life2>,
body: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<Value, ExecutionError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ClassPolicyHttpExecutor<H>: 'async_trait,
Execute an HTTP request. Read more
Source§fn placeholder_rules(
&self,
method: &str,
path_template: &str,
param: &str,
) -> PlaceholderRules<'_>
fn placeholder_rules( &self, method: &str, path_template: &str, param: &str, ) -> PlaceholderRules<'_>
The placeholder rules to apply to one LAYER-2
{param} value. Read moreAuto Trait Implementations§
impl<H> Freeze for ClassPolicyHttpExecutor<H>where
H: Freeze,
impl<H> RefUnwindSafe for ClassPolicyHttpExecutor<H>where
H: RefUnwindSafe,
impl<H> Send for ClassPolicyHttpExecutor<H>where
H: Send,
impl<H> Sync for ClassPolicyHttpExecutor<H>where
H: Sync,
impl<H> Unpin for ClassPolicyHttpExecutor<H>where
H: Unpin,
impl<H> UnsafeUnpin for ClassPolicyHttpExecutor<H>where
H: UnsafeUnpin,
impl<H> UnwindSafe for ClassPolicyHttpExecutor<H>where
H: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.