pub struct DefaultPolicy;Expand description
Computes the default policy for an operation given its HTTP method and any Chio extension overrides.
Implementations§
Source§impl DefaultPolicy
impl DefaultPolicy
Sourcepub fn for_method(method: HttpMethod) -> PolicyDecision
pub fn for_method(method: HttpMethod) -> PolicyDecision
Determine the policy decision for an HTTP method. Safe methods get session-scoped allow; side-effect methods get deny-by-default.
Sourcepub fn for_method_with_extensions(
method: HttpMethod,
extensions: &ChioExtensions,
) -> PolicyDecision
pub fn for_method_with_extensions( method: HttpMethod, extensions: &ChioExtensions, ) -> PolicyDecision
Determine the policy decision, taking Chio extensions into account.
If x-chio-side-effects is explicitly set, it overrides the method
default: true forces deny-by-default, false forces session-allow.
If x-chio-approval-required is true, the result is always
deny-by-default regardless of other settings.
Sourcepub fn has_side_effects(method: HttpMethod, extensions: &ChioExtensions) -> bool
pub fn has_side_effects(method: HttpMethod, extensions: &ChioExtensions) -> bool
Whether the operation has side effects, considering both the HTTP method default and any Chio extension override.
Auto Trait Implementations§
impl Freeze for DefaultPolicy
impl RefUnwindSafe for DefaultPolicy
impl Send for DefaultPolicy
impl Sync for DefaultPolicy
impl Unpin for DefaultPolicy
impl UnsafeUnpin for DefaultPolicy
impl UnwindSafe for DefaultPolicy
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