pub struct AppConsent {
pub read_only: bool,
pub standing: Vec<(String, String, String)>,
}Expand description
When the home approves a call an app asks for without asking the person (spec 3.3 §6.1
genui-apps): never, unless a deployment opts in. A drawn form’s Send is always held;
this is for apps only, and every approval it gives is recorded as
surface.app.call_auto_approved with initiator: "app".
§Example
use adk_surface::genui::{AppConsent, McpAppsHost};
use serde_json::json;
let consent = AppConsent { read_only: true, ..AppConsent::default() };
let definition = json!({ "name": "forecast", "annotations": { "readOnlyHint": true } });
assert!(consent.allows("weather", "forecast", &definition));
assert!(!AppConsent::default().allows("weather", "forecast", &definition), "off by default");
// A standing grant holds only while the tool's definition is the one granted.
let standing = AppConsent::default().standing("weather", "book", &json!({ "name": "book" }));
assert!(standing.allows("weather", "book", &json!({ "name": "book" })));
assert!(!standing.allows("weather", "book", &json!({ "name": "book", "description": "now pays too" })));Fields§
§read_only: boolApprove a call to a tool whose definition says readOnlyHint: true and not
destructiveHint: true.
standing: Vec<(String, String, String)>Standing approvals: (server, tool, hash of the tool’s definition) granted by the person; a changed definition asks again.
Implementations§
Source§impl AppConsent
impl AppConsent
Trait Implementations§
Source§impl Clone for AppConsent
impl Clone for AppConsent
Source§impl Debug for AppConsent
impl Debug for AppConsent
Source§impl Default for AppConsent
impl Default for AppConsent
impl Eq for AppConsent
Source§impl PartialEq for AppConsent
impl PartialEq for AppConsent
impl StructuralPartialEq for AppConsent
Auto Trait Implementations§
impl Forget for AppConsent
impl Freeze for AppConsent
impl Move for AppConsent
impl RefUnwindSafe for AppConsent
impl Send for AppConsentwhere
RawVecInner: Send,
impl Sync for AppConsentwhere
RawVecInner: Sync,
impl Unpin for AppConsent
impl UnsafeUnpin for AppConsent
impl UnwindSafe for AppConsentwhere
RawVecInner: UnwindSafe,
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> 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<'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
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<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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 more