pub struct PermissionRequest { /* private fields */ }Expand description
Runtime-owned normalized permission request.
Implementations§
Source§impl PermissionRequest
impl PermissionRequest
Sourcepub fn for_network_url(
call: &PendingToolCall,
tool: impl Into<String>,
url: impl Into<String>,
host: impl Into<String>,
reason: Option<String>,
) -> Result<Self, PermissionAdmissionError>
pub fn for_network_url( call: &PendingToolCall, tool: impl Into<String>, url: impl Into<String>, host: impl Into<String>, reason: Option<String>, ) -> Result<Self, PermissionAdmissionError>
Builds a validated domain-scoped network permission request for a web or browser tool call.
pub fn tool_call_id(&self) -> &ToolCallId
pub fn tool_name(&self) -> &ToolName
pub fn reason(&self) -> Option<&str>
pub fn requested(&self) -> &[RequestedCapability]
Sourcepub fn triggers(&self) -> &[ActionReviewTrigger]
pub fn triggers(&self) -> &[ActionReviewTrigger]
Returns structured action-review triggers associated with this request.
Sourcepub fn allows_session_scope(&self) -> bool
pub fn allows_session_scope(&self) -> bool
Returns whether this request is eligible for [ApprovalScope::Session]
retention under Merry’s hard security rules.
Destructive, remote-git, privilege, nested-shell, and unparseable
triggers are strictly once-only. Requests that touch .git metadata
paths are also once-only.
Sourcepub fn allows_workspace_persistence(&self) -> bool
pub fn allows_workspace_persistence(&self) -> bool
Returns whether this request is eligible for explicit per-workspace
persistence in $XDG_STATE_HOME/merry/workspace-permissions.json.
Protected targets (providers/, MERRY_API_KEY_FILE, sandboxed
config.toml/state/), .git metadata, local loopback hosts,
action-review triggers, and host integrations are never eligible for
per-workspace persistence.
Sourcepub fn allows_workspace_persistence_for_fallback(
&self,
fallback_reason: Option<&HostFallbackReason>,
) -> bool
pub fn allows_workspace_persistence_for_fallback( &self, fallback_reason: Option<&HostFallbackReason>, ) -> bool
Returns whether this request is eligible for explicit per-workspace persistence given an optional AI fallback reason.
In addition to Self::allows_workspace_persistence, requests flagged
as PermissionReviewRisk::Critical by the AI reviewer are never
eligible for per-workspace persistence.
Sourcepub fn is_high_risk(&self) -> bool
pub fn is_high_risk(&self) -> bool
Returns whether this request is classified as high-risk (and should
default to Deny in interactive review UIs).
Sourcepub fn requests_network(&self) -> bool
pub fn requests_network(&self) -> bool
Returns whether this request asks for network capability.
Sourcepub const fn is_protected_target(&self) -> bool
pub const fn is_protected_target(&self) -> bool
Returns whether this request targets a built-in Merry protected path
(such as providers/, MERRY_API_KEY_FILE, or sandboxed config.toml / state/).
Sourcepub fn is_action_review(&self) -> bool
pub fn is_action_review(&self) -> bool
Returns whether this request reviews an action without granting a capability.
pub fn action(&self) -> &PermissionedAction
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Returns the stable fingerprint for the exact action and capability set.
Sourcepub fn approval_id(&self) -> String
pub fn approval_id(&self) -> String
Returns the stable identifier used to correlate a host response.
Trait Implementations§
Source§impl Clone for PermissionRequest
impl Clone for PermissionRequest
Source§impl Debug for PermissionRequest
impl Debug for PermissionRequest
impl Eq for PermissionRequest
Source§impl PartialEq for PermissionRequest
impl PartialEq for PermissionRequest
impl StructuralPartialEq for PermissionRequest
Auto Trait Implementations§
impl Forget for PermissionRequest
impl Freeze for PermissionRequestwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<RequestedCapability>: Freeze,
PhantomData<String>: Freeze,
PhantomData<PermissionReviewContextEntry>: Freeze,
PhantomData<ActionReviewTrigger>: Freeze,
impl Move for PermissionRequest
impl RefUnwindSafe for PermissionRequest
impl Send for PermissionRequest
impl Sync for PermissionRequestwhere
RawVecInner: Sync,
impl Unpin for PermissionRequest
impl UnsafeUnpin for PermissionRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<RequestedCapability>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<PermissionReviewContextEntry>: UnsafeUnpin,
PhantomData<ActionReviewTrigger>: UnsafeUnpin,
impl UnwindSafe for PermissionRequest
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.